Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bayes_snapper.npy outdated and undocumented #7

Open
geissdoerfer opened this issue Feb 19, 2024 · 3 comments
Open

bayes_snapper.npy outdated and undocumented #7

geissdoerfer opened this issue Feb 19, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@geissdoerfer
Copy link

The repository contains a bayes_snapper.npy that apparently contains a bayesian model to rate satellite quality. Unfortunately the model seems to have been generated with an outdated scikit version that is not compatible anymore with recent Python. Would you be able to provide the data and method to generate the model? This would benefit reproducibility. Thanks!

@JonasBchrt
Copy link
Owner

I will have a look - give me a few days.

Some preliminary notes:

  • I have a dataset with SnapperGPS data from different scenarios with all satellites labelled whether they are visible or not (based on an elevation threshold) and whether their pseudorange was useful to estimate a position or is an outlier. In addition, it contains the estimated SNRs of all satellites.
  • Then - for each GNSS separately - I fit a Bayes classifier that maps SNRs to a binary label good satellite/bad satellite.
  • I use GaussianNB from sklearn.naive_bayes for fitting.
  • This assumes that SNRs are Gaussian distributed given the label, which is obviously an approximation.

This is from my thesis:

At first, it derives a prior probability P (vi = 1|SNRi) for each satellite observation
i ∈ 1, . . . N to be reliable, i.e., to be a so-called inlier, given the associated SNR.
The distribution p (SNRi) of the SNRs is modelled as a Gaussian mixture model
with two components, p (SNRi|vi = 1) for the inliers and p (SNRi|vi = 0) for the
outliers. Mean, standard deviation, and prior of each component are fitted to a
training dataset. This is done separately for each GNSS since the GPS L1 signal,
the Galileo E1 signal, and the BeiDou B1C signal have different properties and,
therefore, differently distributed SNRs. Using the resulting probabilistic models and
Bayes’ rule, the priors P (vi = 1|SNRi) = p(SNRi|vi=1)P(vi=1)/p(SNRi) for each satellite to be
an inlier and P (vi = 0|SNRi) = 1 − P (vi = 1|SNRi) to be an outlier are obtained.

Footnote:

Technically, SNRs are strictly positive while a Gaussian distribution’s support includes all
non-positive numbers, too. However, a Gaussian distribution is chosen because the probability
contained in the distribution’s tail that extends into the negative numbers is negligibly small
for the considered problem in practice. In addition, efficient algorithms for interference exist for
Gaussian distributions.

@JonasBchrt JonasBchrt added the documentation Improvements or additions to documentation label Feb 20, 2024
@geissdoerfer
Copy link
Author

Thanks for the explanation, it makes sense. The table of labeled training data (csv?) and a script to train the model in the repository would be very helpful!

@sunmouren
Copy link

I will have a look - give me a few days.

Some preliminary notes:

  • I have a dataset with SnapperGPS data from different scenarios with all satellites labelled whether they are visible or not (based on an elevation threshold) and whether their pseudorange was useful to estimate a position or is an outlier. In addition, it contains the estimated SNRs of all satellites.
  • Then - for each GNSS separately - I fit a Bayes classifier that maps SNRs to a binary label good satellite/bad satellite.
  • I use GaussianNB from sklearn.naive_bayes for fitting.
  • This assumes that SNRs are Gaussian distributed given the label, which is obviously an approximation.

This is from my thesis:

At first, it derives a prior probability P (vi = 1|SNRi) for each satellite observation
i ∈ 1, . . . N to be reliable, i.e., to be a so-called inlier, given the associated SNR.
The distribution p (SNRi) of the SNRs is modelled as a Gaussian mixture model
with two components, p (SNRi|vi = 1) for the inliers and p (SNRi|vi = 0) for the
outliers. Mean, standard deviation, and prior of each component are fitted to a
training dataset. This is done separately for each GNSS since the GPS L1 signal,
the Galileo E1 signal, and the BeiDou B1C signal have different properties and,
therefore, differently distributed SNRs. Using the resulting probabilistic models and
Bayes’ rule, the priors P (vi = 1|SNRi) = p(SNRi|vi=1)P(vi=1)/p(SNRi) for each satellite to be
an inlier and P (vi = 0|SNRi) = 1 − P (vi = 1|SNRi) to be an outlier are obtained.

Footnote:

Technically, SNRs are strictly positive while a Gaussian distribution’s support includes all
non-positive numbers, too. However, a Gaussian distribution is chosen because the probability
contained in the distribution’s tail that extends into the negative numbers is negligibly small
for the considered problem in practice. In addition, efficient algorithms for interference exist for
Gaussian distributions.

There is a simple solution. You only need to modify the attributes of the old version model to the attributes of the new version model.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants