# ---------------------------------
if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] or \
"SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if (Y.size <= Xb.size) and (Y.size > 100): K = B * Ha * (R + Hm * B * Ha).I
+ elif (Y.size > Xb.size) and (Y.size > 100): K = (BI + Ha * RI * Hm).I * Ha * RI
+ else: pass # K deja calcule
A = B - K * Hm * B
if min(A.shape) != max(A.shape):
raise ValueError("The %s a posteriori covariance matrix A is of shape %s, despites it has to be a squared matrix. There is an error in the observation operator, please check it."%(self._name,str(A.shape)))
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
d = d - Cm * Un
#
+ _A = R + Ht * Pn_predicted * Ha
+ _u = numpy.linalg.solve( _A , d )
+ Xn = Xn_predicted + Pn_predicted * Ha * _u
Kn = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
- Xn = Xn_predicted + Kn * d
Pn = Pn_predicted - Kn * Ht * Pn_predicted
#
self.StoredVariables["Analysis"].store( Xn.A1 )
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
d = d - Cm * Un
#
+ _A = R + Ht * Pn_predicted * Ha
+ _u = numpy.linalg.solve( _A , d )
+ Xn = Xn_predicted + Pn_predicted * Ha * _u
Kn = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
- Xn = Xn_predicted + Kn * d
Pn = Pn_predicted - Kn * Ht * Pn_predicted
#
self.StoredVariables["Analysis"].store( Xn.A1 )