In the following code from Openturns FORM example:
import openturns as ot
model = ot.SymbolicFunction(['x1', 'x2'], ['x1^2+x2'])
R = ot.CorrelationMatrix(2)
R[0,1] = -0.6
inputDist = ot.Normal([0.,0.], R)
inputDist.setDescription(['X1', 'X2'])
inputVector = ot.RandomVector(inputDist)
Create the output random vector Y=model(X)
Y = ot.CompositeRandomVector(model, inputVector)
Create the event Y > 4
threshold = 4.0
event = ot.ThresholdEvent(Y, ot.Greater(), threshold)
Create a FORM algorithm
solver = ot.Cobyla()
startingPoint = inputDist.getMean()
algo = ot.FORM(solver, event, startingPoint)
Run the algorithm and retrieve the result
algo.run()
result_form = algo.getResult()
print(result_form)
Create the post analytical importance sampling simulation algorithm
algo = ot.PostAnalyticalImportanceSampling(result_form)
algo.run()
print(algo.getResult())
result = algo.getResult()
Create the post analytical controlled importance sampling simulation algorithm
algo = ot.PostAnalyticalControlledImportanceSampling(result_form)
algo.run()
print(algo.getResult())
Is it possible to see the values of X1, X2 and Y during the optimisation?
I am hoping to implement this on a simulation that takes a few minutes to run- so would be good to watch the steps of the optimisation process.
Thanks :-)