.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_calibration/least_squares_and_gaussian_calibration/plot_calibration_chaboche.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_calibration_least_squares_and_gaussian_calibration_plot_calibration_chaboche.py: Calibration of the Chaboche mechanical model ============================================ .. GENERATED FROM PYTHON SOURCE LINES 6-7 In this example we present calibration methods on the Chaboche model. A detailed explanation of this mechanical law is presented :ref:`here `. .. GENERATED FROM PYTHON SOURCE LINES 10-17 .. code-block:: default import openturns as ot import openturns.viewer as viewer from matplotlib import pylab as plt from openturns.usecases import chaboche_model ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 18-19 Load the Chaboche data structure .. GENERATED FROM PYTHON SOURCE LINES 19-21 .. code-block:: default cm = chaboche_model.ChabocheModel() .. GENERATED FROM PYTHON SOURCE LINES 22-23 We get the Chaboche model and the joint input distribution : .. GENERATED FROM PYTHON SOURCE LINES 23-26 .. code-block:: default g = cm.model inputDistribution = cm.inputDistribution .. GENERATED FROM PYTHON SOURCE LINES 27-28 Create the Monte-Carlo sample. .. GENERATED FROM PYTHON SOURCE LINES 30-35 .. code-block:: default sampleSize = 100 inputSample = inputDistribution.getSample(sampleSize) outputStress = g(inputSample) outputStress[0:5] .. raw:: html
y0
07.601227e+08
18.596645e+08
27.530982e+08
38.597423e+08
48.375939e+08


.. GENERATED FROM PYTHON SOURCE LINES 36-37 Plot the histogram of the output. .. GENERATED FROM PYTHON SOURCE LINES 39-45 .. code-block:: default histoGraph = ot.HistogramFactory().build(outputStress / 1.0e6).drawPDF() histoGraph.setTitle("Histogram of the sample stress") histoGraph.setXTitle("Stress (MPa)") histoGraph.setLegends([""]) view = viewer.View(histoGraph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_001.png :alt: Histogram of the sample stress :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 46-47 Generate observation noise. .. GENERATED FROM PYTHON SOURCE LINES 49-54 .. code-block:: default stressObservationNoiseSigma = 10.0e6 # (Pa) noiseSigma = ot.Normal(0.0, stressObservationNoiseSigma) sampleNoiseH = noiseSigma.getSample(sampleSize) observedStress = outputStress + sampleNoiseH .. GENERATED FROM PYTHON SOURCE LINES 55-57 .. code-block:: default observedStrain = inputSample[:, 0] .. GENERATED FROM PYTHON SOURCE LINES 58-63 .. code-block:: default graph = ot.Graph("Observations", "Strain", "Stress (MPa)", True) cloud = ot.Cloud(observedStrain, observedStress / 1.0e6) graph.add(cloud) view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_002.png :alt: Observations :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 64-66 Set the calibration parameters ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 68-69 Define the value of the reference values of the :math:`\theta` parameter. In the bayesian framework, this is called the mean of the *prior* gaussian distribution. In the data assimilation framework, this is called the *background*. .. GENERATED FROM PYTHON SOURCE LINES 71-77 .. code-block:: default R = 700e6 # Exact : 750e6 C = 2500e6 # Exact : 2750e6 Gamma = 8.0 # Exact : 10 thetaPrior = [R, C, Gamma] .. GENERATED FROM PYTHON SOURCE LINES 78-79 The following statement create the calibrated function from the model. The calibrated parameters `R`, `C`, `Gamma` are at indices 1, 2, 3 in the inputs arguments of the model. .. GENERATED FROM PYTHON SOURCE LINES 81-84 .. code-block:: default calibratedIndices = [1, 2, 3] mycf = ot.ParametricFunction(g, calibratedIndices, thetaPrior) .. GENERATED FROM PYTHON SOURCE LINES 85-87 Calibration with linear least squares ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 89-90 The `LinearLeastSquaresCalibration` class performs the linear least squares calibration by linearizing the model in the neighbourhood of the reference point. .. GENERATED FROM PYTHON SOURCE LINES 92-96 .. code-block:: default algo = ot.LinearLeastSquaresCalibration( mycf, observedStrain, observedStress, thetaPrior, "SVD" ) .. GENERATED FROM PYTHON SOURCE LINES 97-98 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 100-102 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 103-105 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 106-108 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 110-111 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 113-116 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.50932e+08,2.68658e+09,9.17074]



.. GENERATED FROM PYTHON SOURCE LINES 117-118 We can compute a 95% confidence interval of the parameter :math:`\theta^\star`. .. GENERATED FROM PYTHON SOURCE LINES 120-123 .. code-block:: default thetaPosterior = calibrationResult.getParameterPosterior() thetaPosterior.computeBilateralConfidenceIntervalWithMarginalProbability(0.95)[0] .. raw:: html

[7.43518e+08, 7.58346e+08]
[2.18991e+09, 3.18325e+09]
[-487.552, 505.893]



.. GENERATED FROM PYTHON SOURCE LINES 124-128 We can see that the `Gamma` parameter has a large confidence interval : even the sign of the parameter is unknown. The parameter which is calibrated with the smallest confidence interval is `R`, which confidence interval is [708.3,780.0] (MPa). This is why this parameter seems the most important in this case. .. GENERATED FROM PYTHON SOURCE LINES 130-134 .. code-block:: default graph = calibrationResult.drawObservationsVsInputs() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_003.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 135-136 We see that there is a good fit after calibration, since the predictions after calibration (i.e. the green crosses) are close to the observations (i.e. the blue crosses). .. GENERATED FROM PYTHON SOURCE LINES 138-141 .. code-block:: default graph = calibrationResult.drawObservationsVsPredictions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_004.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 142-143 We see that there is a much better fit after calibration, since the predictions are close to the diagonal of the graphics. .. GENERATED FROM PYTHON SOURCE LINES 145-148 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

Normal(mu = 0, sigma = 9.77968e+06)



.. GENERATED FROM PYTHON SOURCE LINES 149-153 .. code-block:: default graph = calibrationResult.drawResiduals() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_005.png :alt: , Residual analysis :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_005.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 154-157 The analysis of the residuals shows that the distribution is centered on zero and symmetric. This indicates that the calibration performed well. Moreover, the distribution of the residuals is close to being gaussian. .. GENERATED FROM PYTHON SOURCE LINES 159-162 .. code-block:: default graph = calibrationResult.drawParameterDistributions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_006.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_006.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 163-165 Calibration with nonlinear least squares ---------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 167-168 The `NonLinearLeastSquaresCalibration` class performs the non linear least squares calibration by minimizing the squared euclidian norm between the predictions and the observations. .. GENERATED FROM PYTHON SOURCE LINES 170-175 .. code-block:: default algo = ot.NonLinearLeastSquaresCalibration( mycf, observedStrain, observedStress, thetaPrior ) .. GENERATED FROM PYTHON SOURCE LINES 176-177 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 179-181 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 182-184 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 185-187 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 189-190 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 192-195 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.52607e+08,2.55463e+09,7.74755]



.. GENERATED FROM PYTHON SOURCE LINES 196-197 We can compute a 95% confidence interval of the parameter :math:`\theta^\star`. .. GENERATED FROM PYTHON SOURCE LINES 199-202 .. code-block:: default thetaPosterior = calibrationResult.getParameterPosterior() thetaPosterior.computeBilateralConfidenceIntervalWithMarginalProbability(0.95)[0] .. raw:: html

[7.41551e+08, 7.6616e+08]
[1.73663e+09, 3.25998e+09]
[-1.48291, 14.4063]



.. GENERATED FROM PYTHON SOURCE LINES 203-204 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 206-210 .. code-block:: default graph = calibrationResult.drawObservationsVsInputs() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_007.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_007.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 211-212 We see that there is a good fit after calibration, since the predictions after calibration (i.e. the green crosses) are close to the observations (i.e. the blue crosses). .. GENERATED FROM PYTHON SOURCE LINES 214-217 .. code-block:: default graph = calibrationResult.drawObservationsVsPredictions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_008.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_008.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 218-219 We see that there is a much better fit after calibration, since the predictions are close to the diagonal of the graphics. .. GENERATED FROM PYTHON SOURCE LINES 221-224 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

Normal(mu = -2501.22, sigma = 9.71764e+06)



.. GENERATED FROM PYTHON SOURCE LINES 225-228 .. code-block:: default graph = observationError.drawPDF() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_009.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_009.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 229-233 .. code-block:: default graph = calibrationResult.drawResiduals() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_010.png :alt: , Residual analysis :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_010.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 234-237 The analysis of the residuals shows that the distribution is centered on zero and symmetric. This indicates that the calibration performed well. Moreover, the distribution of the residuals is close to being gaussian. This indicates that the observation error might be gaussian. .. GENERATED FROM PYTHON SOURCE LINES 239-242 .. code-block:: default graph = calibrationResult.drawParameterDistributions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_011.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_011.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 243-245 Gaussian calibration parameters ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 247-248 The standard deviation of the observations errors. .. GENERATED FROM PYTHON SOURCE LINES 250-252 .. code-block:: default sigmaStress = 1.0e7 # (Pa) .. GENERATED FROM PYTHON SOURCE LINES 253-254 Define the covariance matrix of the output Y of the model. .. GENERATED FROM PYTHON SOURCE LINES 256-259 .. code-block:: default errorCovariance = ot.CovarianceMatrix(1) errorCovariance[0, 0] = sigmaStress**2 .. GENERATED FROM PYTHON SOURCE LINES 260-261 Define the covariance matrix of the parameters :math:`\theta` to calibrate. .. GENERATED FROM PYTHON SOURCE LINES 263-267 .. code-block:: default sigmaR = 0.1 * R sigmaC = 0.1 * C sigmaGamma = 0.1 * Gamma .. GENERATED FROM PYTHON SOURCE LINES 268-274 .. code-block:: default sigma = ot.CovarianceMatrix(3) sigma[0, 0] = sigmaR**2 sigma[1, 1] = sigmaC**2 sigma[2, 2] = sigmaGamma**2 sigma .. raw:: html

[[ 4.9e+15 0 0 ]
[ 0 6.25e+16 0 ]
[ 0 0 0.64 ]]



.. GENERATED FROM PYTHON SOURCE LINES 275-277 Gaussian linear calibration --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 279-280 The `GaussianLinearCalibration` class performs the gaussian linear calibration by linearizing the model in the neighbourhood of the prior. .. GENERATED FROM PYTHON SOURCE LINES 282-286 .. code-block:: default algo = ot.GaussianLinearCalibration( mycf, observedStrain, observedStress, thetaPrior, sigma, errorCovariance ) .. GENERATED FROM PYTHON SOURCE LINES 287-288 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 290-292 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 293-295 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 296-298 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 300-301 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 303-306 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.52048e+08,2.58853e+09,8.04591]



.. GENERATED FROM PYTHON SOURCE LINES 307-308 We can compute a 95% confidence interval of the parameter :math:`\theta^\star`. .. GENERATED FROM PYTHON SOURCE LINES 310-313 .. code-block:: default thetaPosterior = calibrationResult.getParameterPosterior() thetaPosterior.computeBilateralConfidenceIntervalWithMarginalProbability(0.95)[0] .. raw:: html

[7.46471e+08, 7.57625e+08]
[2.38992e+09, 2.78714e+09]
[6.33812, 9.7537]



.. GENERATED FROM PYTHON SOURCE LINES 314-315 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 317-321 .. code-block:: default graph = calibrationResult.drawObservationsVsInputs() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_012.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_012.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 322-323 We see that there is a good fit after calibration, since the predictions after calibration (i.e. the green crosses) are close to the observations (i.e. the blue crosses). .. GENERATED FROM PYTHON SOURCE LINES 325-328 .. code-block:: default graph = calibrationResult.drawObservationsVsPredictions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_013.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_013.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 329-330 We see that there is a much better fit after calibration, since the predictions are close to the diagonal of the graphics. .. GENERATED FROM PYTHON SOURCE LINES 332-333 The observation error is predicted by linearizing the problem at the prior. .. GENERATED FROM PYTHON SOURCE LINES 335-338 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

Normal(mu = 0, sigma = 1e+07)



.. GENERATED FROM PYTHON SOURCE LINES 339-340 This can be compared to the residuals distribution, which is computed at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 342-346 .. code-block:: default graph = calibrationResult.drawResiduals() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_014.png :alt: , Residual analysis :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_014.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 347-348 The analysis of the gaussian distribution (the blue line) of the observation errors is close to the posterior distribution of the residuals (the green line). Moreover, the posterior distribution is centered. These information indicate that the calibration performed well. .. GENERATED FROM PYTHON SOURCE LINES 350-353 .. code-block:: default graph = calibrationResult.drawParameterDistributions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_015.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_015.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 354-357 For the :math:`R` variable, the observations are much more important than the prior: this is shown by the fact that the posterior and prior distribution of the :math:`R` variable are very different. We see that the prior and posterior distribution are close to each other for the :math:`\gamma` variable: the observations did not convey much information for this variable. .. GENERATED FROM PYTHON SOURCE LINES 359-361 Gaussian nonlinear calibration ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 363-364 The `GaussianNonLinearCalibration` class performs the gaussian nonlinear calibration. .. GENERATED FROM PYTHON SOURCE LINES 366-370 .. code-block:: default algo = ot.GaussianNonLinearCalibration( mycf, observedStrain, observedStress, thetaPrior, sigma, errorCovariance ) .. GENERATED FROM PYTHON SOURCE LINES 371-372 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 374-376 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 377-379 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 380-382 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 384-385 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 387-390 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.52932e+08,2.54883e+09,7.82095]



.. GENERATED FROM PYTHON SOURCE LINES 391-392 We can compute a 95% confidence interval of the parameter :math:`\theta^\star`. .. GENERATED FROM PYTHON SOURCE LINES 394-397 .. code-block:: default thetaPosterior = calibrationResult.getParameterPosterior() thetaPosterior.computeBilateralConfidenceIntervalWithMarginalProbability(0.95)[0] .. raw:: html

[7.46344e+08, 7.58328e+08]
[2.40036e+09, 2.75072e+09]
[7.22426, 8.31639]



.. GENERATED FROM PYTHON SOURCE LINES 398-399 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 401-405 .. code-block:: default graph = calibrationResult.drawObservationsVsInputs() graph.setLegendPosition("topleft") view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_016.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_016.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 406-407 We see that there is a good fit after calibration, since the predictions after calibration (i.e. the green crosses) are close to the observations (i.e. the blue crosses). .. GENERATED FROM PYTHON SOURCE LINES 409-412 .. code-block:: default graph = calibrationResult.drawObservationsVsPredictions() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_017.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_017.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 413-414 We see that there is a much better fit after calibration, since the predictions are close to the diagonal of the graphics. .. GENERATED FROM PYTHON SOURCE LINES 416-417 The observation error is predicted by bootstraping the problem at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 419-422 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

Normal(mu = -15449.5, sigma = 1e+07)



.. GENERATED FROM PYTHON SOURCE LINES 423-424 This can be compared to the residuals distribution, which is computed at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 426-429 .. code-block:: default graph = calibrationResult.drawResiduals() view = viewer.View(graph) .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_018.png :alt: , Residual analysis :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_018.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 430-431 The analysis is very similar to the linear calibration. .. GENERATED FROM PYTHON SOURCE LINES 433-437 .. code-block:: default graph = calibrationResult.drawParameterDistributions() view = viewer.View(graph) plt.show() .. image-sg:: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_019.png :alt: plot calibration chaboche :srcset: /auto_calibration/least_squares_and_gaussian_calibration/images/sphx_glr_plot_calibration_chaboche_019.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 438-439 We see that the prior and posterior distribution for the :math:`\gamma` parameter are close to each other, but not superimposed: the observations significantly brought information to the variable :math:`\gamma` during the calibration. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 5.345 seconds) .. _sphx_glr_download_auto_calibration_least_squares_and_gaussian_calibration_plot_calibration_chaboche.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_calibration_chaboche.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_calibration_chaboche.ipynb `