def getPODCLModel(self, confidenceLevel=0.95): """ Accessor to the POD model at a given confidence level. Parameters ---------- confidenceLevel : float The confidence level the POD must be computed. Default is 0.95 Returns ------- PODModelCl : :py:class:`openturns.Function` The function which computes the probability of detection for a given defect value at the confidence level given as parameter. """ if self._resDistFact is None: # Berens Binomial PODfunction = self._PODbinomialModelCl(self._residuals, self._linearModel, confidenceLevel) else: # Linear regression model + gaussian residuals or + bootstrap def PODfunction(x): samplePODDef = ot.Sample(self._simulationSize, 1) for i in range(self._simulationSize): samplePODDef[i] = [self._PODcollDict[i](x[0])] return samplePODDef.computeQuantilePerComponent( 1. - confidenceLevel) PODmodelCl = ot.PythonFunction(1, 1, PODfunction) return PODmodelCl
def _exec_sample_ipyparallel(func, n, p): """Return a function that executes a sample in parallel using ipyparallel. Parameters ---------- func : Function or callable A callable python object, usually a function. The function should take an input vector as argument and return an output vector. n_cpus : int Number of CPUs on which to distribute the function calls. Returns ------- _exec_sample : Function or callable The parallelized function. """ import ipyparallel as ipp rc = ipp.Client() return ot.PythonFunction(func_sample=lambda X: rc[:].map_sync(func, X), n=func.getInputDimension(), p=func.getOutputDimension())
def __init__(self, dijkpaal): self.dijkpaal = dijkpaal self.data_dijkpaal = self.data1[dijkpaal] #Sellmeijer model deterministische waarden self.h = self.data_dijkpaal['Algemene gegevens', 'Waterstand bij norm [m NAP]'] self.gamma_sat = self.data_dijkpaal[ 'Berekening Opbarsten', 'Volumegewicht deklaag verzadigd [kN/m3]'] #volumetric weight of saturated sand #Sellmeijer model stochastische waarden self.i_ch = self.data_dijkpaal[ 'Berekening Heave', 'Kritieke heave gradient'] #critical heave gradient mu self.D = self.data_dijkpaal[ 'Piping gegevens', 'Dikte zandlaag [m]'] #upper sand cover layer self.D_std = 0 self.D_cover = self.data_dijkpaal[ 'Piping gegevens', 'Dikte deklaag [m]'] #aquifer cover layer self.D_cover_std = 0 self.d70 = self.data_dijkpaal['Piping gegevens', 'Korreldiameter [m]'] #grain size self.d70_std = 0 self.h_exit = self.data_dijkpaal[ 'Piping gegevens', 'Kwelslootpeil [m NAP]'] #seepage ditch level self.h_exit_std = 0 self.k = self.data_dijkpaal[ 'Piping gegevens', 'Doorlatendheid zandlaag [m/s]'] #permeability sand self.k_std = 0 self.L = self.data_dijkpaal[ 'Piping gegevens', 'Aanwezige kwelweglengte [m]'] #seepage length self.L_std = 0 self.Z_function = ot.PythonFunction(9, 1, self.Z)