if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
d = d - Cm * Un
#
- K = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
- Xn = Xn_predicted + K * d
- Pn = Pn_predicted - K * Ht * Pn_predicted
+ 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 "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
d = d - Cm * Un
#
- K = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
- Xn = Xn_predicted + K * d
- Pn = Pn_predicted - K * Ht * Pn_predicted
+ 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 "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
else:
return self.__B * numpy.ones(int(msize))
+ def asfullmatrix(self, msize=None):
+ if self.ismatrix():
+ return self.__B
+ elif self.isvector():
+ return numpy.matrix( numpy.diag(self.__B), float )
+ elif self.isscalar():
+ if msize is None:
+ raise ValueError("the size of the %s covariance matrix has to be given in case of definition as a scalar over the diagonal."%(self.__name,))
+ else:
+ return numpy.matrix( self.__B * numpy.eye(int(msize)), float )
+
def trace(self, msize=None):
if self.ismatrix():
return numpy.trace(self.__B)