[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Covariance matrix after Least Squares estimation




alessandro.vananti@aiub.unibe.ch a écrit :

Hi all,

Hi Allessandro,

I use the BatchLSEstimator class to perform an orbit determination. The
computed orbit is correct.
Now I would like to see the covariance matrix of my orbit.  I tried to use
BatchLSEstimator.getOptimum().getCovariances() but the values seem to be
wrong. They seem to be dependent from the scale factor introduced in
NumericalPropagatorBuilder.
Is there a way to obtain the standard covariance matrix?

Good catch!

As the getOptimum() method returns a view of the low level mathematical object
provided by the optimizer, all the data it contains is in the units as seen by
the optimizer, i.e. rescaled.

So currently, the way to unscale this covariance matrix and get it back to physical
scale exists but is not easy. Here is how you could do that:
 - get all the drivers for estimated orbital parameters by calling
   estimator.getOrbitalParametersDrivers(true)
 - get all the drivers for estimated propagators parameters by calling
   estimator.getPropagatorParametersDrivers(true)
 - get all the drivers for estimated measurements parameters by calling
   estimator.getMeasurementsParametersDrivers(true)
 - from these three lists, and in the retrieval order (i.e. orbit drivers,
   followed by propagators drivers, followed by measurements drivers),
   build an unscaling array by using driverslist.getDrivers(),
   and driver.getScale()
 - for each element (i, j) in the mathematical matrix from the optimum,
   you should get the corresponding physical element by multiplying
   (or dividing ?) by array[i] * array[j].

We should provide a convenience method in the estimator to do all
these parameters retrieval, scale extraction and multiplication
for users. Could you open a new issue in our forge (you have to register
first, at <https://www.orekit.org/forge/projects/orekit>) so we do not
forget to add this improvement?

best regards,
Luc

Any help is appreciated!

Alessandro