# Calibration with noisy input parameters

**URL:** <https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197>\
**Category:** Python usage\
**Tags:** calibration\
**Created:** [March 28, 2022, 10:51am UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197 "2022-03-28T10:51:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanaaZ](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/sanaaz/32/241_2.png) [@sanaaZ](https://openturns.discourse.group/u/sanaaZ)\
**Post date:** [March 28, 2022, 10:51am UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197/1 "2022-03-28T10:51:47Z")

</div>

hello,

is it possible in OT to calibrate a model having inputs that are tainted with uncertainty but are not to be estimated ?

for instance, you could imagine calibrating the [Chaboche](https://openturns.github.io/openturns/master/auto_calibration/least_squares_and_gaussian_calibration/plot_calibration_chaboche.html) model , but with an aleatory uncertainty on the Gamma parameter (that I do not wish to be re estimated by the calibration procedure)

thanks  
sanaa

---

<div class="post-metadata">

**Author:** ![MichaelBaudin](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/michaelbaudin/32/9_2.png) [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Post date:** [March 28, 2022, 8:48pm UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197/2 "2022-03-28T20:48:50Z")

</div>

Hi Sanaa,  
If a variable is non constant and not to be calibrated, it can be considered as an observed input.  
In the Chaboche model for example, we have 3 parameters to calibrate:

```python
R = 700e6 # Exact : 750e6
C = 2500e6 # Exact : 2750e6
Gamma = 8.0 # Exact : 10
thetaPrior = [R, C, Gamma]
calibratedIndices = [1, 2, 3]
mycf = ot.ParametricFunction(g, calibratedIndices, thetaPrior)
algo = ot.LinearLeastSquaresCalibration(
    mycf, observedStrain, observedStress, thetaPrior, "SVD"
)

```

In this case, R, C and gamma are calibrated and the strain is the observed input. Now if gamma is not to be calibrated, we can set it either to a constant value (case A) or to a non-constant value (case B).

In case A, the simplest way is to define a parametric function before the calibration function:

```python
Gamma = 8.0 # Known value
referenceValue = [Gamma]
referenceIndex = [3]
intermediateFunction = ot.ParametricFunction(g, referenceIndex, referenceValue)
thetaPrior = [R, C]
calibratedIndices = [1, 2]
mycf = ot.ParametricFunction(g, calibratedIndices, thetaPrior)
algo = ot.LinearLeastSquaresCalibration(
    mycf, observedStrain, observedStress, thetaPrior, "SVD"
)

```

This way, the variable gamma is just ignored by the calibration process (but the evaluation of the function is OK).

In case B, one possibility is to include gamma to the observed inputs.

```python
sampleSize = 100
inputSample = inputDistribution.getSample(sampleSize) # Generate strain
observedStrain = inputSample[:, 0]
sample = ot.Normal().getSample(sampleSize) # Generate gamma
observedGamma = sample[:, 0]
observedInput = ot.Sample(sampleSize, 2)
observedInput[:, 0] = observedStrain
observedInput[:, 1] = observedGamma
thetaPrior = [R, C]
calibratedIndices = [1, 2]
mycf = ot.ParametricFunction(g, calibratedIndices, thetaPrior)
algo = ot.LinearLeastSquaresCalibration(
    mycf, observedInput, observedStress, thetaPrior, "SVD"
)

```

I guess that case B better matches your question.  
Does it correspond to your test case ?  
Regards,  
Michaël

---

<div class="post-metadata">

**Author:** ![sanaaZ](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/sanaaz/32/241_2.png) [@sanaaZ](https://openturns.discourse.group/u/sanaaZ)\
**Post date:** [April 1, 2022, 11:37am UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197/3 "2022-04-01T11:37:54Z")

</div>

i might have understood your proposition wrong but i don’t think it’s going to work ☹  
what i am trying to do is to model an EIV (error-in-variables) calibration. Case A definitely overlooks the uncertainty surrounding Gamma, and case B basically states that each realization of Gamma is to be matched through the Chaboche model to an observation.

thanks  
sanaa

---

<div class="post-metadata">

**Author:** ![MichaelBaudin](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/michaelbaudin/32/9_2.png) [@MichaelBaudin](https://openturns.discourse.group/u/MichaelBaudin)\
**Post date:** [April 5, 2022, 8:16am UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197/4 "2022-04-05T08:16:32Z")

</div>

Hi,  
I do not know this particular type of calibration: may you provide some pointers?  
Regards,  
Michaël

---

<div class="post-metadata">

**Author:** ![sanaaZ](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/sanaaz/32/241_2.png) [@sanaaZ](https://openturns.discourse.group/u/sanaaZ)\
**Post date:** [April 11, 2022, 1:00pm UTC](https://openturns.discourse.group/t/calibration-with-noisy-input-parameters/197/5 "2022-04-11T13:00:08Z")

</div>

well, it is just a calibration problem where the observed inputs are subject to measurement error. this type of uncertainty is referred to as parametric variability in the seminal [paper by kennedy and o’hagan](https://rss.onlinelibrary.wiley.com/doi/pdf/10.1111/1467-9868.00294).

for instance you would be confronted with this problem if you want to estimate a linear model between windspeed (input) and the generated power (output), while taking into account the measurement error of the used anemometer

thanks  
sanaa
