{
  "id": 238583,
  "title": "Methodology behind the baseline location estimates",
  "url": "/competitions/google-smartphone-decimeter-challenge/discussion/238583",
  "author_name": "",
  "post_date": "2021-05-12T17:04:36.745363100Z",
  "votes": 49,
  "comment_count": 8,
  "views": 0,
  "content": "<p>The <strong>baseline_locations_[train/test].csv</strong> files were generated using a<br>\nstandard Weighted Least Squares (WLS) approach run on the raw GNSS measurements. Similar<br>\nWLS implementations can be found in <a href=\"http://www.rtklib.com/\" target=\"_blank\">RTKLib</a> and the public version of<br>\n<a href=\"https://github.com/google/gps-measurement-tools\" target=\"_blank\">Android GPS tools</a>.</p>\n<ol>\n<li>It uses measurements from all satellite constellations (GPS/GLO/BDS/GAL/QZS).\nInvalid measurements are discarded if:<ul>\n<li>the BiasUncertaintyNanos is larger or equal than 1E6</li>\n<li>GnssClock values are invalid, e.g. FullBiasNanos is not a meaningful number</li>\n<li>STATE_CODE_LOCK (for non-GAL E1) or STATE_GAL_E1BC_CODE_LOCK (for GAL E1)  is not set</li>\n<li>STATE_TOW_DECODED and STATE_TOW_KNOWN are not set for non-GLO signals</li>\n<li>STATE_GLO_TOD_DECODED and STATE_GLO_TOD_KNOWN are not set for GLO signals,</li>\n<li>CN0 is less than 20 dB-Hz</li>\n<li>ReceivedSvTimeUncertaintyNanos is larger than 500 nanoseconds</li>\n<li>Carrier frequency is out of nominal range of each band.</li></ul></li>\n<li>It is based on pseudorange, which is the difference between satellite transmit time (Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()\" target=\"_blank\">ReceivedSvTimeNanos</a> and signal arrival time Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()\" target=\"_blank\">TimeNanos</a> - Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()\" target=\"_blank\">FullBiasNanos</a> - Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getBiasNanos()\" target=\"_blank\">BiasNanos</a>.<br>\nIt doesn't utilize Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeMeters()\" target=\"_blank\">AccumulatedDeltaRangeMeters</a><br>\nnor Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateMetersPerSecond()\" target=\"_blank\">PseudorangeRateMetersPerSecond</a>.<br>\na.  The <a href=\"http://www.navipedia.net/index.php/Klobuchar_Ionospheric_Model\" target=\"_blank\">Klobuchar ionosphere model</a><br>\n   has been applied to correct the ionospheric delay.<br>\nb.  The <a href=\"http://espace.library.curtin.edu.au/cgi-bin/espace.pdf?file=/2008/11/13/file_1/18917\" target=\"_blank\">EGNOS troposphere model</a><br>\n   has been applied to correct the tropospheric delay.<br>\nc.  The ephemeris satellite clock model has been applied to correct the satellite clock bias and group delay.</li>\n<li>It uses Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos()\" target=\"_blank\">ReceivedSvTimeUncertaintyNanos</a><br>\nto weight each signal's pseudorange.</li>\n<li>It has 4+N states, where 4 refers to the user's position in ECEF and clock offset (x, y, z, t), and N states are inter-signal biases (ISB) for the number of non-GPS-L1 signal types. For instance, if the device measures signals of GPS L1 frequency, GLO G1 frequency, GPS L5 frequency, GAL E1 frequency at the same epoch, the number of non-GPS-L1 signal types equals 3 (i.e. N=3).</li>\n<li>It uses the broadcast ephemeris to compute satellite positions and clock bias.<br>\n<br><br>\nThanks to <a href=\"https://www.kaggle.com/gymf123\" target=\"_blank\">@gymf123</a> for the details!</li>\n</ol>",
  "messages": [
    {
      "id": "1304518",
      "postDate": "05/12/2021 17:04:36",
      "content": "<p>The <strong>baseline_locations_[train/test].csv</strong> files were generated using a<br>\nstandard Weighted Least Squares (WLS) approach run on the raw GNSS measurements. Similar<br>\nWLS implementations can be found in <a href=\"http://www.rtklib.com/\" target=\"_blank\">RTKLib</a> and the public version of<br>\n<a href=\"https://github.com/google/gps-measurement-tools\" target=\"_blank\">Android GPS tools</a>.</p>\n<ol>\n<li>It uses measurements from all satellite constellations (GPS/GLO/BDS/GAL/QZS).\nInvalid measurements are discarded if:<ul>\n<li>the BiasUncertaintyNanos is larger or equal than 1E6</li>\n<li>GnssClock values are invalid, e.g. FullBiasNanos is not a meaningful number</li>\n<li>STATE_CODE_LOCK (for non-GAL E1) or STATE_GAL_E1BC_CODE_LOCK (for GAL E1)  is not set</li>\n<li>STATE_TOW_DECODED and STATE_TOW_KNOWN are not set for non-GLO signals</li>\n<li>STATE_GLO_TOD_DECODED and STATE_GLO_TOD_KNOWN are not set for GLO signals,</li>\n<li>CN0 is less than 20 dB-Hz</li>\n<li>ReceivedSvTimeUncertaintyNanos is larger than 500 nanoseconds</li>\n<li>Carrier frequency is out of nominal range of each band.</li></ul></li>\n<li>It is based on pseudorange, which is the difference between satellite transmit time (Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()\" target=\"_blank\">ReceivedSvTimeNanos</a> and signal arrival time Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()\" target=\"_blank\">TimeNanos</a> - Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()\" target=\"_blank\">FullBiasNanos</a> - Raw::<a href=\"https://developer.android.com/reference/android/location/GnssClock#getBiasNanos()\" target=\"_blank\">BiasNanos</a>.<br>\nIt doesn't utilize Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeMeters()\" target=\"_blank\">AccumulatedDeltaRangeMeters</a><br>\nnor Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateMetersPerSecond()\" target=\"_blank\">PseudorangeRateMetersPerSecond</a>.<br>\na.  The <a href=\"http://www.navipedia.net/index.php/Klobuchar_Ionospheric_Model\" target=\"_blank\">Klobuchar ionosphere model</a><br>\n   has been applied to correct the ionospheric delay.<br>\nb.  The <a href=\"http://espace.library.curtin.edu.au/cgi-bin/espace.pdf?file=/2008/11/13/file_1/18917\" target=\"_blank\">EGNOS troposphere model</a><br>\n   has been applied to correct the tropospheric delay.<br>\nc.  The ephemeris satellite clock model has been applied to correct the satellite clock bias and group delay.</li>\n<li>It uses Raw::<a href=\"https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos()\" target=\"_blank\">ReceivedSvTimeUncertaintyNanos</a><br>\nto weight each signal's pseudorange.</li>\n<li>It has 4+N states, where 4 refers to the user's position in ECEF and clock offset (x, y, z, t), and N states are inter-signal biases (ISB) for the number of non-GPS-L1 signal types. For instance, if the device measures signals of GPS L1 frequency, GLO G1 frequency, GPS L5 frequency, GAL E1 frequency at the same epoch, the number of non-GPS-L1 signal types equals 3 (i.e. N=3).</li>\n<li>It uses the broadcast ephemeris to compute satellite positions and clock bias.<br>\n<br><br>\nThanks to <a href=\"https://www.kaggle.com/gymf123\" target=\"_blank\">@gymf123</a> for the details!</li>\n</ol>",
      "rawMarkdown": "The **baseline_locations_[train/test].csv** files were generated using a\nstandard Weighted Least Squares (WLS) approach run on the raw GNSS measurements. Similar\nWLS implementations can be found in [RTKLib](http://www.rtklib.com/) and the public version of\n[Android GPS tools](https://github.com/google/gps-measurement-tools).\n\n\n1.  It uses measurements from all satellite constellations (GPS/GLO/BDS/GAL/QZS).\n    Invalid measurements are discarded if:\n\n    - the BiasUncertaintyNanos is larger or equal than 1E6\n    - GnssClock values are invalid, e.g. FullBiasNanos is not a meaningful number\n    - STATE_CODE_LOCK (for non-GAL E1) or STATE_GAL_E1BC_CODE_LOCK (for GAL E1)  is not set\n    - STATE_TOW_DECODED and STATE_TOW_KNOWN are not set for non-GLO signals\n    - STATE_GLO_TOD_DECODED and STATE_GLO_TOD_KNOWN are not set for GLO signals,\n    - CN0 is less than 20 dB-Hz\n    - ReceivedSvTimeUncertaintyNanos is larger than 500 nanoseconds\n    - Carrier frequency is out of nominal range of each band.\n\n\n2.  It is based on pseudorange, which is the difference between satellite transmit time (Raw::[ReceivedSvTimeNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()) and signal arrival time Raw::[TimeNanos](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()) - Raw::[FullBiasNanos](https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()) - Raw::[BiasNanos](https://developer.android.com/reference/android/location/GnssClock#getBiasNanos()).\n\n    It doesn't utilize Raw::[AccumulatedDeltaRangeMeters](https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeMeters())\n    nor Raw::[PseudorangeRateMetersPerSecond](https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateMetersPerSecond()).\n\n\n    a.  The [Klobuchar ionosphere model](http://www.navipedia.net/index.php/Klobuchar_Ionospheric_Model)\n        has been applied to correct the ionospheric delay.\n\n\n    b.  The [EGNOS troposphere model](http://espace.library.curtin.edu.au/cgi-bin/espace.pdf?file=/2008/11/13/file_1/18917)\n        has been applied to correct the tropospheric delay.\n\n\n    c.  The ephemeris satellite clock model has been applied to correct the satellite clock bias and group delay.\n\n\n3.  It uses Raw::[ReceivedSvTimeUncertaintyNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos())\n    to weight each signal's pseudorange.\n\n\n4.  It has 4+N states, where 4 refers to the user's position in ECEF and clock offset (x, y, z, t), and N states are inter-signal biases (ISB) for the number of non-GPS-L1 signal types. For instance, if the device measures signals of GPS L1 frequency, GLO G1 frequency, GPS L5 frequency, GAL E1 frequency at the same epoch, the number of non-GPS-L1 signal types equals 3 (i.e. N=3).\n\n5.  It uses the broadcast ephemeris to compute satellite positions and clock bias.\n\n<br>\nThanks to @gymf123 for the details!",
      "votes": null
    },
    {
      "id": "1304641",
      "postDate": "05/12/2021 18:49:14",
      "content": "<p>Is the data accurate? What if the data collection is wrong or the data is biased?</p>",
      "rawMarkdown": "Is the data accurate? What if the data collection is wrong or the data is biased?",
      "votes": null
    },
    {
      "id": "1305196",
      "postDate": "05/13/2021 06:25:58",
      "content": "<p>thanks for sharing details. Is it possible to get the working code for the outlined procedure as well?</p>",
      "rawMarkdown": "thanks for sharing details. Is it possible to get the working code for the outlined procedure as well?",
      "votes": null
    },
    {
      "id": "1306176",
      "postDate": "05/13/2021 16:46:52",
      "content": "<p><a href=\"https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583\" target=\"_blank\">https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583</a></p>",
      "rawMarkdown": "https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583",
      "votes": null
    },
    {
      "id": "1307920",
      "postDate": "05/14/2021 19:10:45",
      "content": "<p><a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> the link you provide is the link to the page we are reading right now. Is that intentional?</p>",
      "rawMarkdown": "sohier the link you provide is the link to the page we are reading right now. Is that intentional?",
      "votes": null
    },
    {
      "id": "1308703",
      "postDate": "05/15/2021 11:57:05",
      "content": "<blockquote>\n  <p>Similar WLS implementations can be found in RTKLib and the public version of Android GPS tools.</p>\n</blockquote>",
      "rawMarkdown": ">Similar WLS implementations can be found in RTKLib and the public version of Android GPS tools.",
      "votes": null
    },
    {
      "id": "1308704",
      "postDate": "05/15/2021 11:59:10",
      "content": "<p>What if the Earth is flat</p>",
      "rawMarkdown": "What if the Earth is flat",
      "votes": null
    },
    {
      "id": "1322813",
      "postDate": "05/25/2021 17:41:01",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a>, Thank you for sharing this!</p>\n<p>I'm new to GNSS areas and currently I'm failed to reproduce the baseline result from \"*_derived.csv\". The reproduction code is shown at <a href=\"https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data\" target=\"_blank\">this notebook</a>.</p>\n<p>Currently I'm confused about these following things:</p>\n<ol>\n<li><p>How to weight the dx from each signal's pseudorange. In <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L26-L27\" target=\"_blank\">official tools</a> or <a href=\"https://github.com/google/gps-measurement-tools/blob/master/GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/UserPositionVelocityWeightedLeastSquare.java#L438\" target=\"_blank\">Java version</a> or <a href=\"https://github.com/commaai/laika/blob/66d1e0438fc5d490e33d1ef74ba4d763914efbe0/laika/raw_gnss.py#L311\" target=\"_blank\">3rd party implementation</a>, they use standard deviation of pseudorange to weight it. But as you mentioned here, we should use <code>Raw::ReceivedSvTimeUncertaintyNanos</code><br>\nto weight each signal's pseudorange. Which is related to <code>rawPrUncM</code> in the drived version. But what does this mean, is there any mathematics for weight function?</p></li>\n<li><p>Why we need to estimate isrbM? Does the Inter-Signal Range Bias between different signal should be a fix value? And how should we formulate the isrbM as states in weighted least squares?</p></li>\n<li><p>Did the problem constellations in the drived version has already been filtered? Since lots of fields are related to filter the problem constellations.</p></li>\n<li><p>Each epoch contains the signal received in 1s, but should we consider the movement of the object in this 1s in the baseline model? And should we also consider the receivedSvTimeInGpsNanos in WLS since the signal is recieved in different time?</p></li>\n</ol>\n<p>Would you mind providing some information for these questions? Any suggestion would be super helpful to guide the new bird~</p>\n<p>Thanks in advance!</p>",
      "rawMarkdown": "Hi, @sohier, Thank you for sharing this!\n\nI'm new to GNSS areas and currently I'm failed to reproduce the baseline result from \"*_derived.csv\". The reproduction code is shown at [this notebook](https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data).\n\nCurrently I'm confused about these following things:\n1. How to weight the dx from each signal's pseudorange. In [official tools](https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L26-L27) or [Java version](https://github.com/google/gps-measurement-tools/blob/master/GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/UserPositionVelocityWeightedLeastSquare.java#L438) or [3rd party implementation](https://github.com/commaai/laika/blob/66d1e0438fc5d490e33d1ef74ba4d763914efbe0/laika/raw_gnss.py#L311), they use standard deviation of pseudorange to weight it. But as you mentioned here, we should use `Raw::ReceivedSvTimeUncertaintyNanos`\nto weight each signal's pseudorange. Which is related to `rawPrUncM` in the drived version. But what does this mean, is there any mathematics for weight function?\n\n2. Why we need to estimate isrbM? Does the Inter-Signal Range Bias between different signal should be a fix value? And how should we formulate the isrbM as states in weighted least squares?\n\n3. Did the problem constellations in the drived version has already been filtered? Since lots of fields are related to filter the problem constellations.\n\n4. Each epoch contains the signal received in 1s, but should we consider the movement of the object in this 1s in the baseline model? And should we also consider the receivedSvTimeInGpsNanos in WLS since the signal is recieved in different time?\n\nWould you mind providing some information for these questions? Any suggestion would be super helpful to guide the new bird~\n\nThanks in advance!",
      "votes": null
    },
    {
      "id": "1324448",
      "postDate": "05/27/2021 00:55:56",
      "content": "<p>For question 1, it seems that the rawPrUncM equals PrSigmaM based on the calculation in <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/ProcessGnssMeas.m#L98-L99\" target=\"_blank\">here</a>. With this information I tried to reproduce the <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L62-L111\" target=\"_blank\">WLS shown in official code</a> at <a href=\"https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data\" target=\"_blank\">this notebook</a>. But it still far away from the baseline result. Any idea about it?</p>",
      "rawMarkdown": "For question 1, it seems that the rawPrUncM equals PrSigmaM based on the calculation in [here](https://github.com/google/gps-measurement-tools/blob/master/opensource/ProcessGnssMeas.m#L98-L99). With this information I tried to reproduce the [WLS shown in official code](https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L62-L111) at [this notebook](https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data). But it still far away from the baseline result. Any idea about it?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1304641,
      "author_name": "maharsh011",
      "author_url": "",
      "post_date": "05/12/2021 18:49:14",
      "content": "<p>Is the data accurate? What if the data collection is wrong or the data is biased?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1308704,
          "author_name": "avtobusbratiev",
          "author_url": "",
          "post_date": "05/15/2021 11:59:10",
          "content": "<p>What if the Earth is flat</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1305196,
      "author_name": "emaerthin",
      "author_url": "",
      "post_date": "05/13/2021 06:25:58",
      "content": "<p>thanks for sharing details. Is it possible to get the working code for the outlined procedure as well?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1306176,
          "author_name": "sohier",
          "author_url": "",
          "post_date": "05/13/2021 16:46:52",
          "content": "<p><a href=\"https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583\" target=\"_blank\">https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1307920,
          "author_name": "cdeotte",
          "author_url": "",
          "post_date": "05/14/2021 19:10:45",
          "content": "<p><a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> the link you provide is the link to the page we are reading right now. Is that intentional?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1308703,
          "author_name": "avtobusbratiev",
          "author_url": "",
          "post_date": "05/15/2021 11:57:05",
          "content": "<blockquote>\n  <p>Similar WLS implementations can be found in RTKLib and the public version of Android GPS tools.</p>\n</blockquote>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1322813,
      "author_name": "foreveryoung",
      "author_url": "",
      "post_date": "05/25/2021 17:41:01",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a>, Thank you for sharing this!</p>\n<p>I'm new to GNSS areas and currently I'm failed to reproduce the baseline result from \"*_derived.csv\". The reproduction code is shown at <a href=\"https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data\" target=\"_blank\">this notebook</a>.</p>\n<p>Currently I'm confused about these following things:</p>\n<ol>\n<li><p>How to weight the dx from each signal's pseudorange. In <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L26-L27\" target=\"_blank\">official tools</a> or <a href=\"https://github.com/google/gps-measurement-tools/blob/master/GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/UserPositionVelocityWeightedLeastSquare.java#L438\" target=\"_blank\">Java version</a> or <a href=\"https://github.com/commaai/laika/blob/66d1e0438fc5d490e33d1ef74ba4d763914efbe0/laika/raw_gnss.py#L311\" target=\"_blank\">3rd party implementation</a>, they use standard deviation of pseudorange to weight it. But as you mentioned here, we should use <code>Raw::ReceivedSvTimeUncertaintyNanos</code><br>\nto weight each signal's pseudorange. Which is related to <code>rawPrUncM</code> in the drived version. But what does this mean, is there any mathematics for weight function?</p></li>\n<li><p>Why we need to estimate isrbM? Does the Inter-Signal Range Bias between different signal should be a fix value? And how should we formulate the isrbM as states in weighted least squares?</p></li>\n<li><p>Did the problem constellations in the drived version has already been filtered? Since lots of fields are related to filter the problem constellations.</p></li>\n<li><p>Each epoch contains the signal received in 1s, but should we consider the movement of the object in this 1s in the baseline model? And should we also consider the receivedSvTimeInGpsNanos in WLS since the signal is recieved in different time?</p></li>\n</ol>\n<p>Would you mind providing some information for these questions? Any suggestion would be super helpful to guide the new bird~</p>\n<p>Thanks in advance!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1324448,
          "author_name": "foreveryoung",
          "author_url": "",
          "post_date": "05/27/2021 00:55:56",
          "content": "<p>For question 1, it seems that the rawPrUncM equals PrSigmaM based on the calculation in <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/ProcessGnssMeas.m#L98-L99\" target=\"_blank\">here</a>. With this information I tried to reproduce the <a href=\"https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L62-L111\" target=\"_blank\">WLS shown in official code</a> at <a href=\"https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data\" target=\"_blank\">this notebook</a>. But it still far away from the baseline result. Any idea about it?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1304518": "The **baseline_locations_[train/test].csv** files were generated using a\nstandard Weighted Least Squares (WLS) approach run on the raw GNSS measurements. Similar\nWLS implementations can be found in [RTKLib](http://www.rtklib.com/) and the public version of\n[Android GPS tools](https://github.com/google/gps-measurement-tools).\n\n\n1.  It uses measurements from all satellite constellations (GPS/GLO/BDS/GAL/QZS).\n    Invalid measurements are discarded if:\n\n    - the BiasUncertaintyNanos is larger or equal than 1E6\n    - GnssClock values are invalid, e.g. FullBiasNanos is not a meaningful number\n    - STATE_CODE_LOCK (for non-GAL E1) or STATE_GAL_E1BC_CODE_LOCK (for GAL E1)  is not set\n    - STATE_TOW_DECODED and STATE_TOW_KNOWN are not set for non-GLO signals\n    - STATE_GLO_TOD_DECODED and STATE_GLO_TOD_KNOWN are not set for GLO signals,\n    - CN0 is less than 20 dB-Hz\n    - ReceivedSvTimeUncertaintyNanos is larger than 500 nanoseconds\n    - Carrier frequency is out of nominal range of each band.\n\n\n2.  It is based on pseudorange, which is the difference between satellite transmit time (Raw::[ReceivedSvTimeNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()) and signal arrival time Raw::[TimeNanos](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()) - Raw::[FullBiasNanos](https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()) - Raw::[BiasNanos](https://developer.android.com/reference/android/location/GnssClock#getBiasNanos()).\n\n    It doesn't utilize Raw::[AccumulatedDeltaRangeMeters](https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeMeters())\n    nor Raw::[PseudorangeRateMetersPerSecond](https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateMetersPerSecond()).\n\n\n    a.  The [Klobuchar ionosphere model](http://www.navipedia.net/index.php/Klobuchar_Ionospheric_Model)\n        has been applied to correct the ionospheric delay.\n\n\n    b.  The [EGNOS troposphere model](http://espace.library.curtin.edu.au/cgi-bin/espace.pdf?file=/2008/11/13/file_1/18917)\n        has been applied to correct the tropospheric delay.\n\n\n    c.  The ephemeris satellite clock model has been applied to correct the satellite clock bias and group delay.\n\n\n3.  It uses Raw::[ReceivedSvTimeUncertaintyNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos())\n    to weight each signal's pseudorange.\n\n\n4.  It has 4+N states, where 4 refers to the user's position in ECEF and clock offset (x, y, z, t), and N states are inter-signal biases (ISB) for the number of non-GPS-L1 signal types. For instance, if the device measures signals of GPS L1 frequency, GLO G1 frequency, GPS L5 frequency, GAL E1 frequency at the same epoch, the number of non-GPS-L1 signal types equals 3 (i.e. N=3).\n\n5.  It uses the broadcast ephemeris to compute satellite positions and clock bias.\n\n<br>\nThanks to @gymf123 for the details!",
    "1304641": "Is the data accurate? What if the data collection is wrong or the data is biased?",
    "1305196": "thanks for sharing details. Is it possible to get the working code for the outlined procedure as well?",
    "1306176": "https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/238583",
    "1307920": "sohier the link you provide is the link to the page we are reading right now. Is that intentional?",
    "1308703": ">Similar WLS implementations can be found in RTKLib and the public version of Android GPS tools.",
    "1308704": "What if the Earth is flat",
    "1322813": "Hi, @sohier, Thank you for sharing this!\n\nI'm new to GNSS areas and currently I'm failed to reproduce the baseline result from \"*_derived.csv\". The reproduction code is shown at [this notebook](https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data).\n\nCurrently I'm confused about these following things:\n1. How to weight the dx from each signal's pseudorange. In [official tools](https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L26-L27) or [Java version](https://github.com/google/gps-measurement-tools/blob/master/GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/UserPositionVelocityWeightedLeastSquare.java#L438) or [3rd party implementation](https://github.com/commaai/laika/blob/66d1e0438fc5d490e33d1ef74ba4d763914efbe0/laika/raw_gnss.py#L311), they use standard deviation of pseudorange to weight it. But as you mentioned here, we should use `Raw::ReceivedSvTimeUncertaintyNanos`\nto weight each signal's pseudorange. Which is related to `rawPrUncM` in the drived version. But what does this mean, is there any mathematics for weight function?\n\n2. Why we need to estimate isrbM? Does the Inter-Signal Range Bias between different signal should be a fix value? And how should we formulate the isrbM as states in weighted least squares?\n\n3. Did the problem constellations in the drived version has already been filtered? Since lots of fields are related to filter the problem constellations.\n\n4. Each epoch contains the signal received in 1s, but should we consider the movement of the object in this 1s in the baseline model? And should we also consider the receivedSvTimeInGpsNanos in WLS since the signal is recieved in different time?\n\nWould you mind providing some information for these questions? Any suggestion would be super helpful to guide the new bird~\n\nThanks in advance!",
    "1324448": "For question 1, it seems that the rawPrUncM equals PrSigmaM based on the calculation in [here](https://github.com/google/gps-measurement-tools/blob/master/opensource/ProcessGnssMeas.m#L98-L99). With this information I tried to reproduce the [WLS shown in official code](https://github.com/google/gps-measurement-tools/blob/master/opensource/WlsPvt.m#L62-L111) at [this notebook](https://www.kaggle.com/foreveryoung/least-squares-solution-from-gnss-derived-data). But it still far away from the baseline result. Any idea about it?"
  },
  "source": "meta"
}