# Usage of *MeasurementBuilder

Hello everyone!

My question is about usage of *MeasurementBuilder: what do sigma in constructor and getTheoreticalStandardDeviation method stand for?

I was thinking of it as mathematic characteristic of measurements, but the description says it is a theoretical value used for normalizing the residuals ... and constructor takes CorrelatedRandomVectorGenerator as input parameter for generating noise…

For example, imagine that I want to generate perfect PV measurements. In this case, how should PVBuilder object be created (in particular, values for sigmaPosition  and sigmaVelocity)?

final double sigmaPosition = ?;
final double sigmaVelocity = ?;
final double weight = 1.0;
final PVBuilder pvb = new PVBuilder(null, sigmaPosition, sigmaVelocity, weight, observableSatellite);


Both your interpretation as mathematical characteristic of measurement and normalizing (or scaling) value explained in the documentation are correct. The normalization part is important because it is the key to mix measurements with different units. In your case, you will have both residuals in meters and residuals in meter per second, so mixing them in a root mean square compound value can be done only after scaling.
Having a standard deviation that is consistent with the physical meaning of the measurement is therefore important, otherwise you would weight too much either the position or the velocity with respect to the other measurement types. Of course, if you multiply all standard deviations for all measurements by the same factor, then the final estimated orbit would be the same, it is the relative value of one measurement type with respect to another measurement type that is important.
Beware that in the PV case, the standard deviation for position is most probably 3 orders of magnitude larger than the standard deviation for velocity, in SI units (for example 10m for position and 10mm/s for velocity). However you should check with the technology that will ultimately be used so your simulations are realistic.

Hi @Carboh,

This code will generate perfect measurement because you already did the right choice and set the CorrelatedRandomVectorGenerator to null.
However it will produce PV that have a theoretical sigma of sigmaPosition/sigmaVelocity which means that if you use the generated PVs in an orbit determination (OD) scenario, the OD algorithm will “think” that these measurements have a noise of sigmaPosition/sigmaVelocity and use those to weight the residuals.
I don’t know if it’s clear, the main reason why we have to use this theoretical sigma here is because it’s needed for the OD and we reused the same measurements’ classes for the measurements generation scheme.
So technically if you put

final double sigmaPosition = 0.;
final double sigmaVelocity = 0.;


The measurements generation should work, but then if you use the generated measurements in an OD then you will get an exception (division by 0 I guess, or singular matrix).

Hope this helps,
Maxime

I think it’s getting clearer to me, but I still have couple of questions:

1. I was using PVBuilider for generating measurements and process them to OD.
So, OD use sigmaPosition/sigmaVelocity only for scaling purposes (to mix measurements with different units). OD itself doesn’t add any noise to measurements based on sigmaPosition/sigmaVelocity. Noise should be added before to position/velocity values( with help of CorrelatedRandomVectorGenerator, for example). Am I correct?

2. Are values of sigmaPosition = 10 m and sigmaVelocity = 10 mm/s are suitable for all cases, or there are some specific cases when those values are not suitable?

Hi again @Carboh,

Yes, although it’s more than just scaling, it’s also weighting. Meaning that the smaller the sigmas, the higher the weights of the measurements in the OD scheme will be.
If you use a mixed type of measurements (PV, range, azimuth/elevation etc.) the OD algorithm will give more credits to the measurements that have the smaller weights.

These are typical GNSS values from satellite telemetry. But they could be lower, it depends on the on-board device precision.
If you use only PV measurements from the same source for your OD, the sigmas won’t have a lot of impact. The main difference will be the value of the WRMS (Weighted Root Mean Square).
WRMS = 1/N.\sum_{i}{residuals_i² / \sigma_i²} (N number of measurements)
If you have a single source like a GNSS, the OD will likely converge to the same point regardless of the sigmas, so the residuals will be the same.
In that case if you increase the sigmas, the WRMS will drop, if you decrease them, the WRMS will increase.
Having a final WRMS close to 1 means that you have a good representation of your system (actual error is close to theoretical error).

Also, if you use OutlierFilters then you have to be a bit careful. They will remove measurements where residuals_i > N_{\sigma}.\sigma_i where N_{\sigma} is a parameter you can set in the constructor of OutlierFilter.
So if your guess of \sigma_i is too small then too many measurements may be rejected by the filter, if it’s too high the filter won’t reject any measurements at all.