are in the following list: ["APosterioriCorrelations",
"APosterioriCovariance", "APosterioriStandardDeviations",
"APosterioriVariances", "BMA", "CostFunctionJ", "CurrentOptimum",
- "CurrentState", "IndexOfOptimum", "Innovation", "MahalanobisConsistency",
- "OMA", "OMB", "SigmaObs2", "SimulatedObservationAtBackground",
- "SimulatedObservationAtCurrentOptimum",
+ "CurrentState", "IndexOfOptimum", "Innovation", "InnovationAtCurrentState",
+ "MahalanobisConsistency", "OMA", "OMB", "SigmaObs2",
+ "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentOptimum",
"SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum",
"SimulationQuantiles"].
possibles sont dans la liste suivante : ["APosterioriCorrelations",
"APosterioriCovariance", "APosterioriStandardDeviations",
"APosterioriVariances", "BMA", "CostFunctionJ", "CurrentOptimum",
- "CurrentState", "IndexOfOptimum", "Innovation", "MahalanobisConsistency",
- "OMA", "OMB", "SigmaObs2", "SimulatedObservationAtBackground",
- "SimulatedObservationAtCurrentOptimum",
+ "CurrentState", "IndexOfOptimum", "Innovation", "InnovationAtCurrentState",
+ "MahalanobisConsistency", "OMA", "OMB", "SigmaObs2",
+ "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentOptimum",
"SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum",
"SimulationQuantiles"].
default = [],
typecast = tuple,
message = "Liste de calculs supplémentaires à stocker et/ou effectuer",
- listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "CurrentOptimum", "IndexOfOptimum", "Innovation", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", "SimulatedObservationAtCurrentOptimum"]
+ listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CostFunctionJ", "CurrentState", "CurrentOptimum", "IndexOfOptimum", "Innovation", "InnovationAtCurrentState", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", "SimulatedObservationAtCurrentOptimum"]
)
self.defineRequiredParameter(
name = "Quantiles",
self.StoredVariables["CurrentState"].store( _X )
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
+ _Innovation = Y - _HX
if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
"SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
+ if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ self.StoredVariables["InnovationAtCurrentState"].store( _HX )
Jb = 0.5 * (_X - Xb).T * BI * (_X - Xb)
- Jo = 0.5 * (Y - _HX).T * RI * (Y - _HX)
+ Jo = 0.5 * _Innovation.T * RI * _Innovation
J = float( Jb ) + float( Jo )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
#
self.StoredVariables["Analysis"].store( Xn.A1 )
if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
- self.StoredVariables["APosterioriCovariance"].store( Pn )
+ self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) )
covarianceXa = Pn
Xa = Xn
previousJMinimum = numpy.finfo(float).max
#
self.StoredVariables["Analysis"].store( Xn.A1 )
if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
- self.StoredVariables["APosterioriCovariance"].store( Pn )
+ self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) )
covarianceXa = Pn
Xa = Xn
previousJMinimum = numpy.finfo(float).max
- SimulatedObservationAtCurrentState : l'état observé H(X) à l'état courant
- SimulatedObservationAtOptimum : l'état observé H(Xa) à l'optimum
- Innovation : l'innovation : d = Y - H(X)
+ - InnovationAtCurrentState : l'innovation à l'état courant : dn = Y - H(Xn)
- SigmaObs2 : indicateur de correction optimale des erreurs d'observation
- SigmaBck2 : indicateur de correction optimale des erreurs d'ébauche
- MahalanobisConsistency : indicateur de consistance des covariances
self.__required_parameters = {}
self.StoredVariables = {}
#
- self.StoredVariables["CostFunctionJ"] = Persistence.OneScalar(name = "CostFunctionJ")
- self.StoredVariables["CostFunctionJb"] = Persistence.OneScalar(name = "CostFunctionJb")
- self.StoredVariables["CostFunctionJo"] = Persistence.OneScalar(name = "CostFunctionJo")
- self.StoredVariables["GradientOfCostFunctionJ"] = Persistence.OneVector(name = "GradientOfCostFunctionJ")
- self.StoredVariables["GradientOfCostFunctionJb"] = Persistence.OneVector(name = "GradientOfCostFunctionJb")
- self.StoredVariables["GradientOfCostFunctionJo"] = Persistence.OneVector(name = "GradientOfCostFunctionJo")
- self.StoredVariables["CurrentState"] = Persistence.OneVector(name = "CurrentState")
- self.StoredVariables["Analysis"] = Persistence.OneVector(name = "Analysis")
- self.StoredVariables["IndexOfOptimum"] = Persistence.OneIndex(name = "IndexOfOptimum")
- self.StoredVariables["CurrentOptimum"] = Persistence.OneVector(name = "CurrentOptimum")
- self.StoredVariables["SimulatedObservationAtBackground"] = Persistence.OneVector(name = "SimulatedObservationAtBackground")
- self.StoredVariables["SimulatedObservationAtCurrentState"] = Persistence.OneVector(name = "SimulatedObservationAtCurrentState")
- self.StoredVariables["SimulatedObservationAtOptimum"] = Persistence.OneVector(name = "SimulatedObservationAtOptimum")
+ self.StoredVariables["CostFunctionJ"] = Persistence.OneScalar(name = "CostFunctionJ")
+ self.StoredVariables["CostFunctionJb"] = Persistence.OneScalar(name = "CostFunctionJb")
+ self.StoredVariables["CostFunctionJo"] = Persistence.OneScalar(name = "CostFunctionJo")
+ self.StoredVariables["GradientOfCostFunctionJ"] = Persistence.OneVector(name = "GradientOfCostFunctionJ")
+ self.StoredVariables["GradientOfCostFunctionJb"] = Persistence.OneVector(name = "GradientOfCostFunctionJb")
+ self.StoredVariables["GradientOfCostFunctionJo"] = Persistence.OneVector(name = "GradientOfCostFunctionJo")
+ self.StoredVariables["CurrentState"] = Persistence.OneVector(name = "CurrentState")
+ self.StoredVariables["Analysis"] = Persistence.OneVector(name = "Analysis")
+ self.StoredVariables["IndexOfOptimum"] = Persistence.OneIndex(name = "IndexOfOptimum")
+ self.StoredVariables["CurrentOptimum"] = Persistence.OneVector(name = "CurrentOptimum")
+ self.StoredVariables["SimulatedObservationAtBackground"] = Persistence.OneVector(name = "SimulatedObservationAtBackground")
+ self.StoredVariables["SimulatedObservationAtCurrentState"] = Persistence.OneVector(name = "SimulatedObservationAtCurrentState")
+ self.StoredVariables["SimulatedObservationAtOptimum"] = Persistence.OneVector(name = "SimulatedObservationAtOptimum")
self.StoredVariables["SimulatedObservationAtCurrentOptimum"] = Persistence.OneVector(name = "SimulatedObservationAtCurrentOptimum")
- self.StoredVariables["Innovation"] = Persistence.OneVector(name = "Innovation")
- self.StoredVariables["SigmaObs2"] = Persistence.OneScalar(name = "SigmaObs2")
- self.StoredVariables["SigmaBck2"] = Persistence.OneScalar(name = "SigmaBck2")
- self.StoredVariables["MahalanobisConsistency"] = Persistence.OneScalar(name = "MahalanobisConsistency")
- self.StoredVariables["OMA"] = Persistence.OneVector(name = "OMA")
- self.StoredVariables["OMB"] = Persistence.OneVector(name = "OMB")
- self.StoredVariables["BMA"] = Persistence.OneVector(name = "BMA")
- self.StoredVariables["APosterioriCovariance"] = Persistence.OneMatrix(name = "APosterioriCovariance")
- self.StoredVariables["APosterioriVariances"] = Persistence.OneVector(name = "APosterioriVariances")
- self.StoredVariables["APosterioriStandardDeviations"] = Persistence.OneVector(name = "APosterioriStandardDeviations")
- self.StoredVariables["APosterioriCorrelations"] = Persistence.OneMatrix(name = "APosterioriCorrelations")
- self.StoredVariables["SimulationQuantiles"] = Persistence.OneMatrix(name = "SimulationQuantiles")
+ self.StoredVariables["Innovation"] = Persistence.OneVector(name = "Innovation")
+ self.StoredVariables["InnovationAtCurrentState"] = Persistence.OneVector(name = "InnovationAtCurrentState")
+ self.StoredVariables["SigmaObs2"] = Persistence.OneScalar(name = "SigmaObs2")
+ self.StoredVariables["SigmaBck2"] = Persistence.OneScalar(name = "SigmaBck2")
+ self.StoredVariables["MahalanobisConsistency"] = Persistence.OneScalar(name = "MahalanobisConsistency")
+ self.StoredVariables["OMA"] = Persistence.OneVector(name = "OMA")
+ self.StoredVariables["OMB"] = Persistence.OneVector(name = "OMB")
+ self.StoredVariables["BMA"] = Persistence.OneVector(name = "BMA")
+ self.StoredVariables["APosterioriCovariance"] = Persistence.OneMatrix(name = "APosterioriCovariance")
+ self.StoredVariables["APosterioriVariances"] = Persistence.OneVector(name = "APosterioriVariances")
+ self.StoredVariables["APosterioriStandardDeviations"] = Persistence.OneVector(name = "APosterioriStandardDeviations")
+ self.StoredVariables["APosterioriCorrelations"] = Persistence.OneMatrix(name = "APosterioriCorrelations")
+ self.StoredVariables["SimulationQuantiles"] = Persistence.OneMatrix(name = "SimulationQuantiles")
def _pre_run(self):
logging.debug("%s Lancement"%self._name)
return 0
def _post_run(self,_oH=None):
- if self._parameters.has_key("StoreSupplementaryCalculations") and \
+ if ("StoreSupplementaryCalculations" in self._parameters) and \
"APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
for _A in self.StoredVariables["APosterioriCovariance"]:
if "APosterioriVariances" in self._parameters["StoreSupplementaryCalculations"]:
else:
return self.StoredVariables
- def has_key(self, key=None):
+ def __contains__(self, key=None):
"""
Vérifie si l'une des variables stockées est identifiée par la clé.
"""
- return self.StoredVariables.has_key(key)
+ return (key in self.StoredVariables)
def keys(self):
"""
for tagKey in __filteringKwTags:
__tmp = []
for i in __indexOfFilteredItems:
- if self.__tags[i].has_key(tagKey):
+ if tagKey in self.__tags[i]:
if self.__tags[i][tagKey] == kwargs[tagKey]:
__tmp.append( i )
elif isinstance(kwargs[tagKey],(list,tuple)) and self.__tags[i][tagKey] in kwargs[tagKey]:
__indexOfFilteredItems = self.__filteredIndexes(**kwargs)
__keys = []
for i in __indexOfFilteredItems:
- if self.__tags[i].has_key( keyword ):
+ if keyword in self.__tags[i]:
__keys.append( self.__tags[i][keyword] )
else:
__keys.append( None )
__indexOfFilteredItems = self.__filteredIndexes(**kwargs)
__pairs = []
for i in __indexOfFilteredItems:
- if self.__tags[i].has_key( keyword ):
+ if keyword in self.__tags[i]:
__pairs.append( [self.__tags[i][keyword], self.__values[i]] )
else:
__pairs.append( [None, self.__values[i]] )
ObserversList = [
"Analysis",
"Innovation",
+ "InnovationAtCurrentState",
"CurrentState",
"CurrentOptimum",
"IndexOfOptimum",