levels = [8, 5] box = ot.Box(levels) inputSample = box.generate() # Scale each direction inputSample *= 10 # Define model model = ot.Function(['x', 'y'], ['z'], ['cos(0.5*x) + sin(y)']) outputSample = model(inputSample) # 2) Definition of exponential model covarianceModel = ot.SquaredExponential([1.988, 0.924], [3.153]) # 3) Basis definition basisCollection = ot.BasisCollection( 1, ot.ConstantBasisFactory(spatialDimension).build()) # Kriring algorithm algo = ot.KrigingAlgorithm(inputSample, outputSample, covarianceModel, basisCollection) algo.run() result = algo.getResult() vertices = [[1.0, 0.0], [2.0, 0.0], [2.0, 1.0], [1.0, 1.0], [1.5, 0.5]] simplicies = [[0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 0, 4]] mesh2D = ot.Mesh(vertices, simplicies) process = ot.ConditionedGaussianProcess(result, mesh2D) # Get a realization of the process
levels = [8, 5] box = ot.Box(levels) inputSample = box.generate() # Scale each direction inputSample *= 10 # Define model model = ot.SymbolicFunction(['x', 'y'], ['cos(0.5*x) + sin(y)']) outputSample = model(inputSample) # 2) Definition of exponential model covarianceModel = ot.SquaredExponential([1.988, 0.924], [3.153]) # 3) Basis definition basisCollection = ot.BasisCollection( 1, ot.ConstantBasisFactory(inputDimension).build()) # Kriring algorithm algo = ot.KrigingAlgorithm(inputSample, outputSample, covarianceModel, basisCollection) algo.run() result = algo.getResult() vertices = [[1.0, 0.0], [2.0, 0.0], [2.0, 1.0], [1.0, 1.0], [1.5, 0.5]] simplicies = [[0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 0, 4]] mesh2D = ot.Mesh(vertices, simplicies) process = ot.ConditionedGaussianProcess(result, mesh2D) # Get a realization of the process