.. 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 Click :ref:`here ` 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-18 .. code-block:: default import numpy as np 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 19-20 Load the Chaboche data structure .. GENERATED FROM PYTHON SOURCE LINES 20-22 .. code-block:: default cm = chaboche_model.ChabocheModel() .. GENERATED FROM PYTHON SOURCE LINES 23-24 We get the Chaboche model and the joint input distribution : .. GENERATED FROM PYTHON SOURCE LINES 24-27 .. code-block:: default g = cm.model inputDistribution = cm.inputDistribution .. GENERATED FROM PYTHON SOURCE LINES 28-29 Create the Monte-Carlo sample. .. GENERATED FROM PYTHON SOURCE LINES 31-36 .. code-block:: default sampleSize = 100 inputSample = inputDistribution.getSample(sampleSize) outputStress = g(inputSample) outputStress[0:5] .. raw:: html
y0
07.964051e+08
17.568162e+08
28.176283e+08
38.378045e+08
48.209594e+08


.. GENERATED FROM PYTHON SOURCE LINES 37-38 Plot the histogram of the output. .. GENERATED FROM PYTHON SOURCE LINES 40-46 .. 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 47-48 Generate observation noise. .. GENERATED FROM PYTHON SOURCE LINES 50-55 .. 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 56-58 .. code-block:: default observedStrain = inputSample[:, 0] .. GENERATED FROM PYTHON SOURCE LINES 59-64 .. 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 65-67 Set the calibration parameters ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 69-70 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 72-78 .. 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 79-80 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 82-85 .. code-block:: default calibratedIndices = [1, 2, 3] mycf = ot.ParametricFunction(g, calibratedIndices, thetaPrior) .. GENERATED FROM PYTHON SOURCE LINES 86-88 Calibration with linear least squares ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 90-91 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 93-97 .. code-block:: default algo = ot.LinearLeastSquaresCalibration( mycf, observedStrain, observedStress, thetaPrior, "SVD" ) .. GENERATED FROM PYTHON SOURCE LINES 98-99 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 101-103 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 104-106 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 107-109 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 111-112 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 114-117 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.52186e+08,2.73419e+09,10.3137]



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

[7.46006e+08, 7.58365e+08]
[2.30892e+09, 3.15947e+09]
[-415.004, 435.631]



.. GENERATED FROM PYTHON SOURCE LINES 126-130 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 132-136 .. 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 137-138 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 140-143 .. 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 144-145 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 147-150 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

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



.. GENERATED FROM PYTHON SOURCE LINES 151-155 .. 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 156-159 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 161-164 .. 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 165-167 Calibration with nonlinear least squares ---------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 169-170 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 172-177 .. code-block:: default algo = ot.NonLinearLeastSquaresCalibration( mycf, observedStrain, observedStress, thetaPrior ) .. GENERATED FROM PYTHON SOURCE LINES 178-179 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 181-183 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 184-186 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 187-189 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 191-192 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 194-197 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.52257e+08,2.73324e+09,10.3073]



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

[7.46122e+08, 7.62238e+08]
[2.03438e+09, 3.1518e+09]
[1.47283, 15.3863]



.. GENERATED FROM PYTHON SOURCE LINES 206-207 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 209-213 .. 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 214-215 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 217-220 .. 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 221-222 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 224-227 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

Normal(mu = -60571.5, sigma = 9.39046e+06)



.. GENERATED FROM PYTHON SOURCE LINES 228-231 .. 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 232-236 .. 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 237-240 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 242-245 .. 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 246-248 Gaussian calibration parameters ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 250-251 The standard deviation of the observations errors. .. GENERATED FROM PYTHON SOURCE LINES 253-255 .. code-block:: default sigmaStress = 1.0e7 # (Pa) .. GENERATED FROM PYTHON SOURCE LINES 256-257 Define the covariance matrix of the output Y of the model. .. GENERATED FROM PYTHON SOURCE LINES 259-262 .. code-block:: default errorCovariance = ot.CovarianceMatrix(1) errorCovariance[0, 0] = sigmaStress ** 2 .. GENERATED FROM PYTHON SOURCE LINES 263-264 Define the covariance matrix of the parameters :math:`\theta` to calibrate. .. GENERATED FROM PYTHON SOURCE LINES 266-270 .. code-block:: default sigmaR = 0.1 * R sigmaC = 0.1 * C sigmaGamma = 0.1 * Gamma .. GENERATED FROM PYTHON SOURCE LINES 271-277 .. 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 278-280 Gaussian linear calibration --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 282-283 The `GaussianLinearCalibration` class performs the gaussian linear calibration by linearizing the model in the neighbourhood of the prior. .. GENERATED FROM PYTHON SOURCE LINES 285-289 .. code-block:: default algo = ot.GaussianLinearCalibration( mycf, observedStrain, observedStress, thetaPrior, sigma, errorCovariance ) .. GENERATED FROM PYTHON SOURCE LINES 290-291 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 293-295 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 296-298 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 299-301 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 303-304 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 306-309 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.53937e+08,2.56053e+09,8.2239]



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

[7.48931e+08, 7.58942e+08]
[2.36514e+09, 2.75593e+09]
[6.53167, 9.91613]



.. GENERATED FROM PYTHON SOURCE LINES 318-319 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 321-325 .. 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 326-327 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 329-332 .. 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 333-334 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 336-337 The observation error is predicted by linearizing the problem at the prior. .. GENERATED FROM PYTHON SOURCE LINES 339-342 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

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



.. GENERATED FROM PYTHON SOURCE LINES 343-344 This can be compared to the residuals distribution, which is computed at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 346-350 .. 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 351-352 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 354-357 .. 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 358-361 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 363-365 Gaussian nonlinear calibration ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 367-368 The `GaussianNonLinearCalibration` class performs the gaussian nonlinear calibration. .. GENERATED FROM PYTHON SOURCE LINES 370-374 .. code-block:: default algo = ot.GaussianNonLinearCalibration( mycf, observedStrain, observedStress, thetaPrior, sigma, errorCovariance ) .. GENERATED FROM PYTHON SOURCE LINES 375-376 The `run` method computes the solution of the problem. .. GENERATED FROM PYTHON SOURCE LINES 378-380 .. code-block:: default algo.run() .. GENERATED FROM PYTHON SOURCE LINES 381-383 .. code-block:: default calibrationResult = algo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 384-386 Analysis of the results ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 388-389 The `getParameterMAP` method returns the maximum of the posterior distribution of :math:`\theta`. .. GENERATED FROM PYTHON SOURCE LINES 391-394 .. code-block:: default thetaMAP = calibrationResult.getParameterMAP() thetaMAP .. raw:: html

[7.55122e+08,2.50161e+09,7.88447]



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

[7.5044e+08, 7.60584e+08]
[2.35961e+09, 2.63302e+09]
[7.29957, 8.49989]



.. GENERATED FROM PYTHON SOURCE LINES 403-404 We can see that all three parameters are estimated with a large confidence interval. .. GENERATED FROM PYTHON SOURCE LINES 406-410 .. 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 411-412 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 414-417 .. 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 418-419 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 421-422 The observation error is predicted by bootstraping the problem at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 424-427 .. code-block:: default observationError = calibrationResult.getObservationsError() observationError .. raw:: html

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



.. GENERATED FROM PYTHON SOURCE LINES 428-429 This can be compared to the residuals distribution, which is computed at the posterior. .. GENERATED FROM PYTHON SOURCE LINES 431-434 .. 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 435-436 The analysis is very similar to the linear calibration. .. GENERATED FROM PYTHON SOURCE LINES 438-442 .. 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 443-444 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 4.930 seconds) .. _sphx_glr_download_auto_calibration_least_squares_and_gaussian_calibration_plot_calibration_chaboche.py: .. only :: html .. container:: sphx-glr-footer :class: 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 ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_