"""
__author__ = "Jean-Philippe ARGAUD"
-import os, copy, types, sys, logging, math, numpy, scipy, itertools
+import os, copy, types, sys, logging, math, numpy, scipy, itertools, warnings
+import scipy.linalg # Py3.6
from daCore.BasicObjects import Operator, Covariance, PartialAlgorithm
from daCore.PlatformInfo import PlatformInfo, vt, vfloat
mpr = PlatformInfo().MachinePrecision()
def SingularValuesEstimation( __Ensemble, __Using = "SVDVALS"):
"Renvoie les valeurs singulières de l'ensemble et leur carré"
if __Using == "SVDVALS": # Recommandé
- import scipy
__sv = scipy.linalg.svdvals( __Ensemble )
__svsq = __sv**2
elif __Using == "SVD":
sampleList = itertools.product(*coordinatesList)
# ---------------------------
elif len(__SampleAsMinMaxLatinHyperCube) > 0:
- import scipy, warnings
if vt(scipy.version.version) <= vt("1.7.0"):
__msg = "In order to use Latin Hypercube sampling, you must at least use Scipy version 1.7.0 (and you are presently using Scipy %s). A void sample is then generated."%scipy.version.version
warnings.warn(__msg, FutureWarning, stacklevel=50)
sampleList = scipy.stats.qmc.scale(__sample, __l_bounds, __u_bounds)
# ---------------------------
elif len(__SampleAsMinMaxSobolSequence) > 0:
- import scipy, warnings
if vt(scipy.version.version) <= vt("1.7.0"):
__msg = "In order to use Latin Hypercube sampling, you must at least use Scipy version 1.7.0 (and you are presently using Scipy %s). A void sample is then generated."%scipy.version.version
warnings.warn(__msg, FutureWarning, stacklevel=50)
if __CovForecast:
Mt = EM["Tangent"].asMatrix(Xn)
Mt = Mt.reshape(Xn.size, Xn.size) # ADAO & check shape
- if __CovForecast:
Ma = EM["Adjoint"].asMatrix(Xn)
Ma = Ma.reshape(Xn.size, Xn.size) # ADAO & check shape
Pn_predicted = Q + Mt @ (Pn @ Ma)
- M = EM["Direct"].appliedControledFormTo
- Xn_predicted = M( (Xn, Un) ).reshape((-1, 1))
+ Mm = EM["Direct"].appliedControledFormTo
+ Xn_predicted = Mm( (Xn, Un) ).reshape((-1, 1))
if CM is not None and "Tangent" in CM and Un is not None: # Attention : si Cm est aussi dans M, doublon !
Cm = CM["Tangent"].asMatrix(Xn_predicted)
Cm = Cm.reshape(Xn.size, Un.size) # ADAO & check shape