Skip to content

Commit 302493c

Browse files
committed
Updated driver.rst, overview.rst, and covariance.rst files
1 parent a8f1e76 commit 302493c

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

doc/OnlineDocs/explanation/analysis/parmest/covariance.rst

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ following methods which have been implemented in parmest.
1212

1313
1. Reduced Hessian Method
1414

15-
When the objective function is the sum of squared errors (SSE) defined as
16-
:math:`\text{SSE} = \sum_{i = 1}^{n}
17-
\left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})\right)^2`,
18-
the covariance matrix is:
15+
When the objective function is the sum of squared errors (SSE) for homogeneous data, defined as
16+
:math:`\text{SSE} = \sum_{i = 1}^{n} \left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};
17+
\boldsymbol{\theta})\right)^\text{T} \left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};
18+
\boldsymbol{\theta})\right)`, the covariance matrix is:
1919

2020
.. math::
2121
\boldsymbol{V}_{\boldsymbol{\theta}} = 2 \sigma^2 \left(\frac{\partial^2 \text{SSE}}
2222
{\partial \boldsymbol{\theta}^2}\right)^{-1}_{\boldsymbol{\theta}
2323
= \hat{\boldsymbol{\theta}}}
2424
25-
Similarly, when the objective function is the weighted SSE (WSSE) defined as
25+
Similarly, when the objective function is the weighted SSE (WSSE) for heterogeneous data, defined as
2626
:math:`\text{WSSE} = \frac{1}{2} \sum_{i = 1}^{n} \left(\boldsymbol{y}_{i} -
2727
\boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})\right)^\text{T} \boldsymbol{\Sigma}_{\boldsymbol{y}}^{-1}
2828
\left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})\right)`,
@@ -34,12 +34,15 @@ following methods which have been implemented in parmest.
3434
= \hat{\boldsymbol{\theta}}}
3535
3636
Where :math:`\boldsymbol{V}_{\boldsymbol{\theta}}` is the covariance matrix of the estimated
37-
parameters :math:`\hat{\boldsymbol{\theta}}`, :math:`\boldsymbol{y}` are observations of the measured variables,
38-
:math:`n` is the number of experiments, :math:`\boldsymbol{\Sigma}_{\boldsymbol{y}}` is the measurement error
39-
covariance matrix, and :math:`\sigma^2` is the variance of the measurement error. When the standard deviation of
40-
the measurement error is not supplied by the user, parmest approximates :math:`\sigma^2` as:
41-
:math:`\hat{\sigma}^2 = \frac{1}{n-l} \sum_{i=1}^{n} e_i^2`, where :math:`l` is the number of fitted parameters,
42-
and :math:`e_i` is the residual between the data and model for experiment :math:`i`.
37+
parameters :math:`\hat{\boldsymbol{\theta}} \in \mathbb{R}^p`, :math:`\boldsymbol{y}_{i} \in \mathbb{R}^m` are
38+
observations of the measured output variables, :math:`\boldsymbol{f}` is the model function,
39+
:math:`\boldsymbol{x}_{i} \in \mathbb{R}^{q}` are the input variables, :math:`n` is the number of experiments,
40+
:math:`\boldsymbol{\Sigma}_{\boldsymbol{y}}` is the measurement error covariance matrix, and :math:`\sigma^2`
41+
is the variance of the measurement error. When the standard deviation of the measurement error is not supplied
42+
by the user, parmest approximates :math:`\sigma^2` as:
43+
:math:`\hat{\sigma}^2 = \frac{1}{n-p} \sum_{i=1}^{n} \boldsymbol{\varepsilon}_{i}(\boldsymbol{\theta})^{\text{T}}
44+
\boldsymbol{\varepsilon}_{i}(\boldsymbol{\theta})`, and :math:`\boldsymbol{\varepsilon}_{i} \in \mathbb{R}^m`
45+
are the residuals between the data and model for experiment :math:`i`.
4346

4447
In parmest, this method computes the inverse of the Hessian by scaling the
4548
objective function (SSE or WSSE) with a constant probability factor, :math:`\frac{1}{n}`.
@@ -48,9 +51,9 @@ following methods which have been implemented in parmest.
4851

4952
In this method, the covariance matrix, :math:`\boldsymbol{V}_{\boldsymbol{\theta}}`, is
5053
computed by differentiating the Hessian,
51-
:math:`\frac{\partial^2 \text{SSE}}{\partial \boldsymbol{\theta} \partial \boldsymbol{\theta}}`
54+
:math:`\frac{\partial^2 \text{SSE}}{\partial \boldsymbol{\theta}^2}`
5255
or
53-
:math:`\frac{\partial^2 \text{WSSE}}{\partial \boldsymbol{\theta} \partial \boldsymbol{\theta}}`, and
56+
:math:`\frac{\partial^2 \text{WSSE}}{\partial \boldsymbol{\theta}^2}`, and
5457
applying Gauss-Newton approximation which results in:
5558

5659
.. math::

doc/OnlineDocs/explanation/analysis/parmest/driver.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ Where :math:`y` is the observation of the measured variable, :math:`t` is the ti
4040
is the asymptote, and :math:`\theta_2` is the rate constant.
4141

4242
The experimental data is given in the table below:
43-
.. list-table:: Experimental Data
43+
44+
.. list-table:: Data
4445
:header-rows: 1
45-
:widths: 20 20
46+
:widths: 30 30
4647

4748
* - hour
4849
- y
@@ -59,8 +60,8 @@ The experimental data is given in the table below:
5960
* - 7
6061
- 19.8
6162

62-
To use parmest to estimate :math:`\theta_1` and :math:`\theta_2` from the data, the following
63-
detailed steps should be followed:
63+
To use parmest to estimate :math:`\theta_1` and :math:`\theta_2` from the data, we provide the following
64+
detailed steps:
6465

6566
Step 0: Import Pyomo, parmest, Experiment Class, and Pandas
6667
-----------------------------------------------------------

doc/OnlineDocs/explanation/analysis/parmest/overview.rst

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ for design optimization.
1010

1111
Functionality in parmest includes:
1212

13-
* Model based parameter estimation using experimental data
13+
* Model-based parameter estimation using experimental data
14+
* Covariance matrix estimation
1415
* Bootstrap resampling for parameter estimation
1516
* Confidence regions based on single or multi-variate distributions
1617
* Likelihood ratio
@@ -21,61 +22,56 @@ Background
2122
----------
2223

2324
The goal of parameter estimation is to estimate values for
24-
a vector, :math:`{\theta}`, to use in the functional form
25+
a vector, :math:`\boldsymbol{\theta}`, to use in the functional form
2526

2627
.. math::
2728
28-
y = g(x; \theta)
29-
30-
where :math:`x` is a vector containing measured data, typically in high
31-
dimension, :math:`{\theta}` is a vector of values to estimate, in much
32-
lower dimension, and the response vectors are given as :math:`y_{i},
33-
i=1,\ldots,m` with :math:`m` also much smaller than the dimension of
34-
:math:`x`. This is done by collecting :math:`S` data points, which are
35-
:math:`{\tilde{x}},{\tilde{y}}` pairs and then finding :math:`{\theta}`
36-
values that minimize some function of the deviation between the values
37-
of :math:`{\tilde{y}}` that are measured and the values of
38-
:math:`g({\tilde{x}};{\theta})` for each corresponding
39-
:math:`{\tilde{x}}`, which is a subvector of the vector :math:`x`. Note
40-
that for most experiments, only small parts of :math:`x` will change
41-
from one experiment to the next.
29+
\boldsymbol{y}_i & = \boldsymbol{f}\left(\boldsymbol{x}_{i}, \boldsymbol{\theta}\right) +
30+
\boldsymbol{\varepsilon}_i \quad \forall \; i \in \left\{1, \ldots, n}
31+
32+
where :math:`\boldsymbol{y}_{i} \in \mathbb{R}^m` are observations of the measured or output variables,
33+
:math:`\boldsymbol{f}` is the model function, :math:`\boldsymbol{x}_{i} \in \mathbb{R}^{q}` are the decision
34+
or input variables, :math:`\boldsymbol{\theta} \in \mathbb{R}^p` are the model parameters,
35+
:math:`\boldsymbol{\varepsilon}_{i} \in \mathbb{R}^m` are measurement errors, and :math:`n` is the number of
36+
experiments.
4237

4338
The following least squares objective can be used to estimate parameter
4439
values assuming Gaussian independent and identically distributed measurement
45-
errors, where data points are indexed by :math:`s=1,\ldots,S`
40+
errors:
4641

4742
.. math::
4843
49-
\min_{{\theta}} Q({\theta};{\tilde{x}}, {\tilde{y}}) \equiv \sum_{s=1}^{S}q_{s}({\theta};{\tilde{x}}_{s}, {\tilde{y}}_{s}) \;\;
44+
\min_{\boldsymbol{\theta}} \, g(\boldsymbol{x}, \boldsymbol{y};\boldsymbol{\theta}) \;\;
5045
51-
where :math:`q_{s}({\theta};{\tilde{x}}_{s}, {\tilde{y}}_{s})` can be:
46+
where :math:`g(\boldsymbol{x}, \boldsymbol{y};\boldsymbol{\theta})` can be:
5247

5348
1. Sum of squared errors
5449

5550
.. math::
5651
57-
q_{s}({\theta};{\tilde{x}}_{s}, {\tilde{y}}_{s}) =
58-
\sum_{i=1}^{m}\left({\tilde{y}}_{s,i} - g_{i}({\tilde{x}}_{s};{\theta})\right)^{2}
52+
g(\boldsymbol{x}, \boldsymbol{y};\boldsymbol{\theta}) =
53+
\sum_{i = 1}^{n} \left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})
54+
\right)^\text{T} \left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})\right)
5955
6056
2. Weighted sum of squared errors
6157

6258
.. math::
6359
64-
q_{s}({\theta};{\tilde{x}}_{s}, {\tilde{y}}_{s}) =
65-
\sum_{i=1}^{m}\left(\frac{{\tilde{y}}_{s,i} - g_{i}({\tilde{x}}_{s};{\theta})}{w_i}\right)^{2}
60+
g(\boldsymbol{x}, \boldsymbol{y};\boldsymbol{\theta}) =
61+
\frac{1}{2} \sum_{i = 1}^{n} \left(\boldsymbol{y}_{i} - \boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})
62+
\right)^\text{T} \boldsymbol{\Sigma}_{\boldsymbol{y}}^{-1} \left(\boldsymbol{y}_{i} -
63+
\boldsymbol{f}(\boldsymbol{x}_{i};\boldsymbol{\theta})\right)
6664
67-
i.e., the contribution of sample :math:`s` to :math:`Q`, where :math:`w
68-
\in \Re^{m}` is a vector containing the standard deviation of the measurement
69-
errors of :math:`y`. Custom objectives can also be defined for parameter estimation.
65+
where :math:`\boldsymbol{\Sigma}_{\boldsymbol{y}}` is the measurement error covariance matrix containing the
66+
standard deviation of the measurement errors of :math:`\boldsymbol{y}`. Custom objectives can also be defined
67+
for parameter estimation.
7068

7169
In the applications of interest to us, the function :math:`g(\cdot)` is
7270
usually defined as an optimization problem with a large number of
7371
(perhaps constrained) optimization variables, a subset of which are
74-
fixed at values :math:`{\tilde{x}}` when the optimization is performed.
75-
In other applications, the values of :math:`{\theta}` are fixed
72+
fixed at values :math:`\boldsymbol{x}` when the optimization is performed.
73+
In other applications, the values of :math:`\boldsymbol{\theta}` are fixed
7674
parameter values, but for the problem formulation above, the values of
77-
:math:`{\theta}` are the primary optimization variables. Note that in
75+
:math:`\boldsymbol{\theta}` are the primary optimization variables. Note that in
7876
general, the function :math:`g(\cdot)` will have a large set of
79-
parameters that are not included in :math:`{\theta}`. Often, the
80-
:math:`y_{is}` will be vectors themselves, perhaps indexed by time with
81-
index sets that vary with :math:`s`.
77+
parameters that are not included in :math:`\boldsymbol{\theta}`.

0 commit comments

Comments
 (0)