Dynamic Estimation Statistics

Learning outcomes

  • Compute the parameter covariance from the sensitivity matrix and the residuals, and a confidence interval for each parameter.
  • Apply the F-test to decide whether a model with more parameters, such as a reversible reaction, is justified by the data.
  • Interpret the parameter correlation matrix and identify parameters that the data cannot tell apart.

Book chapter: Process Dynamics, Modeling, and Identification (Volume 1), Chapter 11, Model Structure Selection and Identifiability on a Temperature Control Lab (PDF).
Practice in 15 minutes: 3 · Fit an Energy Balance to Data, 4 · A Multivariable Model From Records Alone
Model: Physics-based kinetic models with Arrhenius rates, fitted to batch data; the same statistics apply to any fitted model.
Decision: The estimator chooses the parameters; the statistics decide which of them, and which model, the data support.
Learning: Confidence intervals and correlations are how a fitted model reports what it has and has not learned.

Sensitivity and statistical analysis are important methods to understand the behavior of dynamic estimators such as Moving Horizon Estimation (MHE).

Linearized Statistics

Near the optimal parameters `p^*`, the model output `\hat y` at the `n` measurement points changes with the `m` parameters through the sensitivity (Jacobian) matrix `J`. With independent errors of equal variance, the parameter covariance is approximately

$$J_{ij} = \left.\frac{\partial \hat y_i}{\partial p_j}\right|_{p^*}, \qquad C = \operatorname{Cov}(p^*) \approx \hat\sigma^2 \left(J^T J\right)^{-1}, \qquad \hat\sigma^2 = \frac{SSE(p^*)}{n - m}$$

and a confidence interval for each parameter and a confidence ellipse for all of them are

$$\begin{gathered} p_j^* \pm t_{1-\alpha/2,\; n-m} \sqrt{C_{jj}}, \\ \left(p - p^*\right)^T J^T J \left(p - p^*\right) \le m\, \hat\sigma^2\, F_{1-\alpha}(m,\, n-m) \end{gathered}$$

The ellipse is the linear approximation of the nonlinear region shown below. When the two differ much, as for a banana-shaped region, trust the nonlinear one.

F-test for nested models. To test whether `m_f - m_r` extra parameters (a full model) improve on a reduced model enough to be kept, compare

$$F = \frac{\left(SSE_r - SSE_f\right)/\left(m_f - m_r\right)}{SSE_f/\left(n - m_f\right)}$$

with `F_{1-\alpha}(m_f - m_r,\; n - m_f)`. A larger value means the extra parameters explain more than noise would. This is the test for the reverse reaction in Case Study 2.

Correlation. The correlation between parameters `j` and `l` is `R_{jl} = C_{jl}/\sqrt{C_{jj} C_{ll}}`. A value near `\pm 1` means the data cannot tell the two apart: a change in one is compensated by the other. The frequency factor `A` and activation energy `E_a` of an Arrhenius rate are the classic case. Writing the rate around a reference temperature `T_r` inside the data range, `k = k_r \exp\left(-\frac{E_a}{R}\left(\frac{1}{T} - \frac{1}{T_r}\right)\right)`, usually removes most of the correlation.

Case Study 1: Reversible Reaction

The reaction of phenolphthalein with a base solution follows the 2 reaction sequence given below.

  • Reaction 1:
    • Irreversible reaction, fast reaction dynamics
    • Ph + 2 OH- => Ph(2-) + 2 H2O
  • Reaction 2:
    • Reversible, slow reaction dynamics
    • Ph(2-) + OH- <=> PhOH(3-)

Reaction 1 is very fast and can be assumed to be instantaneous when the phenolphthalein (Ph) is added to a hydroxide solution. We are considering using phenolphthalein as an indicator to determine the residence time of several large CSTR reactors in a pilot plant. Please determine the kinetic parameters for reaction 2 with respect to phenolphthalein associated with the fading of phenolphthalein in sodium hydroxide solutions (reaction orders, A1, A2, Ea1, and Ea2).

An engineer collected time-varying data for a non-isothermal run and needs you to estimate the kinetic parameters. The temperature ranged from about 60 - 140 degF. In order to appropriately size the reactor vessel, engineers need the kinetic parameters with the associated 95% confidence intervals.

Nonlinear Confidence Interval for Dye Fading Kinetics

Nonlinear confidence intervals can also be visualized as a function of 2 parameters. In this case, both parameters are simultaneously varied to find the confidence region. The confidence interval is determined with an F-test that specifies an upper limit to the deviation from the optimal solution

with p=2 (number of parameters), n=number of measurements, theta=[parameter 1, parameter 2] (parameters), theta* as the optimal parameters, SSE as the sum of squared errors, and the F statistic that has 3 arguments (alpha=confidence level, degrees of freedom 1, and degrees of freedom 2). For many problems, this creates a multi-dimensional nonlinear confidence region. In the case of 2 parameters, the nonlinear confidence region is a 2-dimensional space. Below is an example that shows the confidence region for the dye fading experiment confidence region for forward and reverse activation energies.

The optimal parameter values are in the 95% confidence region. This plot demonstrates that the 2D confidence region is not necessarily symmetric.


Case Study 2: Ethyl Acetate Kinetics

This assignment contains a kinetic analysis of several experiments using the reaction of Ethyl Acetate with Sodium Hydroxide to produce Ethanol and Sodium Acetate.

CH2COOCH2CH3 + NaOH → CH2COO- Na+ + CH3CH2OH

Determine the kinetic parameters for the Ethyl-Acetate/Sodium Hydroxide reaction including the frequency factor (A), reaction orders (α and β), and activation energy (Ea) for the reaction.

r = k COHα CEt-Acβ
k = A exp(-Ea/RT)

This reaction has been studied previously and literature values provide starting values for the parameter estimation1.

The data is obtained by operating a glass reaction vessel with the following supplies:

  • Fisher Scientific accumet XL60 pH meter and probe
  • Benchtop heat exchanger
  • 95.5 wt.% Ethyl Acetate
  • Sodium Hydroxide solution

The measured amount of Ethyl Acetate is added to the Sodium Hydroxide solution. The temperature and pH are measured over the course of an hour to record the data for analysis. Download the sample scripts and model files below for a starting point for the dynamic simulation and parameter estimation.

Once the pH is measured, it must be translated into a hydroxide concentration for use in these calculations. The concentration of hydroxide ion is related to the pH as measured by the probe and pKw which is temperature dependent.

-log10(COH-)= pKw - pH

More information is contained in the experimental data when the temperature is varied throughout the one hour run. The variable temperature also causes the pKw to change. The self ionization of water as indicated by pKw is dependent on the temperature2,3

pKw = 4470.99 / T(K) - 6.0875 + 0.01706 T(K)

Nonlinear Confidence Interval for Ethyl Acetate Kinetics

The above script produces 1-dimensional confidence intervals for all of the reaction parameters. In this example, the reversibility of the reaction is tested by including the reverse reaction rate in the data fit. The optimizer decides whether to assign a sufficiently large reverse reaction rate to optimally fit the model to the dynamic data.

Nonlinear confidence intervals can also be visualized as a function of 2 parameters. In this case, both parameters are simultaneously varied to find the confidence region. The confidence interval is determined with an F-test that specifies an upper limit to the deviation from the optimal solution

with p=2 (number of parameters), n=number of measurements, theta=[parameter 1, parameter 2] (parameters), theta* as the optimal parameters, SSE as the sum of squared errors, and the F statistic that has 3 arguments (alpha=confidence level, degrees of freedom 1, and degrees of freedom 2). For many problems, this creates a multi-dimensional nonlinear confidence region. In the case of 2 parameters, the nonlinear confidence region is a 2-dimensional space.


References

  1. Laidler, K. J. and Chen, D. (1957). The influence of pressure on the kinetics of the alkaline hydrolysis of esters and amides. Trans. Faraday Soc., 1958,54, 1026-1033, DOI: 10.1039/TF9585401026 View Article
  2. Whitfield, M. (1975). Chemical Oceanography. In J. P. Riley, & E. Skirrows, Vol. 2 2nd Ed. (pp. 44-171). Academic, New York.
  3. Wikipedia, Self-ionization of water, URL: https://en.wikipedia.org/wiki/Self-ionization_of_water.

Generative AI Learning

"I fitted A and Ea of an Arrhenius rate to data from 60 to 140 degF and the confidence intervals are huge, with a correlation of 0.99. Is the model wrong, or the data? Tell me how to reparameterize and what should happen to the correlation and the intervals."

Check the answer: Refit with k_r at a reference temperature in the middle of your data and recompute the covariance. The correlation between k_r and Ea should drop well below 0.99, and the fitted curve should not change. If the assistant says the model is wrong, the unchanged objective after reparameterizing shows it was the parameterization.

Course Information

TCLab

Project

Applications

Advanced Control Exercises

Exams

Modeling

Machine Learning

Estimation

Control

Reinforcement Learning

Related Courses

Admin