11.. _driversection :
22
3- Parameter Estimation
4- ====================
5-
6- Parameter Estimation using parmest requires a Pyomo model, experimental
7- data which defines multiple scenarios, and parameters
8- (thetas) to estimate. parmest uses Pyomo [PyomoBookIII ]_ and (optionally)
9- mpi-sppy [KMM+23 ]_ to solve a
10- two-stage stochastic programming problem, where the experimental data is
11- used to create a scenario tree. The objective function needs to be
12- written with the Pyomo Expression for first stage cost
13- (named "FirstStageCost") set to zero and the Pyomo Expression for second
14- stage cost (named "SecondStageCost") defined as the deviation between
15- the model and the observations (typically defined as the sum of squared
16- deviation between model values and observed values).
17-
18- If the Pyomo model is not formatted as a two-stage stochastic
19- programming problem in this format, the user can choose either the
20- built-in "SSE" or "SSE_weighted" objective functions, or supply a custom
21- objective function to use as the second stage cost. The Pyomo model will then be
22- modified within parmest to match the required specifications.
23- The stochastic programming callback function is also defined within parmest.
24- The callback function returns a populated and initialized model for each scenario.
25-
26- Quick Guide
27- ===========
28- We use a simple model to provide a quick guide on how to use parmest to estimate model parameters
3+ Parmest Quick Start Guide
4+ =========================
5+
6+ This quick start guide shows how to use parmest to estimate model parameters
297from experimental data as well as compute their uncertainty. The model and data used in this
30- guide is taken from: Rooney, W. C.; Biegler, L. T. Design for Model Parameter Uncertainty Using
31- Nonlinear Confidence Regions. AIChE J. 2001, 47 (8), 1794–1804.
8+ guide were taken from [RB01 ]_.
329
3310The mathematical model of interest is:
3411
@@ -95,10 +72,10 @@ required packages for parameter estimation in parmest:
9572
9673.. _ExperimentClass :
9774
98- Step 1: Create the Experiment Class for the Model
99- -------------------------------------------------
75+ Step 1: Create an Experiment Class
76+ ----------------------------------
10077
101- parmest requires that the user create an :class: `~pyomo.contrib.parmest.experiment.Experiment ` class that
78+ Parmest requires that the user create an :class: `~pyomo.contrib.parmest.experiment.Experiment ` class that
10279builds an annotated Pyomo model denoting experiment outputs, unknown parameters, and measurement errors using
10380Pyomo `Suffix ` components.
10481
@@ -115,15 +92,10 @@ Pyomo `Suffix` components.
11592The experiment class has one required method:
11693
11794* :class: `~pyomo.contrib.parmest.experiment.Experiment.get_labeled_model ` which returns the labeled Pyomo model.
118- Note that the model does not have to be specifically written as a
119- two-stage stochastic programming problem for parmest.
120- That is, parmest can modify the
121- objective, see the :ref: `EstimatorObj ` Section below.
12295
123- This step shows how to create the :class: `~pyomo.contrib.parmest.experiment.Experiment ` class using the
124- mathematical model outlined in the introduction section of this Quick Start.
96+ An example :class: `~pyomo.contrib.parmest.experiment.Experiment ` class is shown below.
12597
126- .. literalinclude :: ../../../ pyomo/contrib/parmest/examples/rooney_biegler/rooney_biegler.py
98+ .. literalinclude :: ../../pyomo/contrib/parmest/examples/rooney_biegler/rooney_biegler.py
12799 :language: python
128100 :pyobject: RooneyBieglerExperiment
129101 :caption: RooneyBieglerExperiment class from the parmest example
@@ -204,24 +176,21 @@ Optionally, solver options can be supplied, e.g.,
204176Objective function
205177^^^^^^^^^^^^^^^^^^
206178
207- The second argument, ``obj_function ``, is used to specify the objective function to use for parameter
208- estimation if the user has not manually defined an objective function in their ``Experiment `` class.
209-
210- If ``obj_function `` is not specified, the Pyomo model is used "as is" and
211- should be defined with "FirstStageCost" and "SecondStageCost"
212- expressions that are used to build an objective for the two-stage
213- stochastic programming problem.
214-
215- If the Pyomo model is not written as a two-stage stochastic programming problem in
216- this format, the user can select the "SSE" or "SSE_weighted" built-in objective
217- functions. If the user wants to use an objective that is different from the built-in
218- options, a custom objective function can be defined for parameter estimation. However,
179+ The ``obj_function `` keyword argument is used to specify the objective function to use for parameter
180+ estimation if the user has not implemented their own custom objective function.
181+ Parmest includes two built-in objective functions ("SSE" and "SSE_weighted") to compute
182+ the sum of squared errors between the ``m.experiment_outputs `` model values and
183+ data values. If the user wants to use an objective that is different from the built-in
184+ options, a custom objective function can be specified in the user's model, however,
219185covariance matrix estimation (see :ref: `covariancesection ` Section) is not supported
220186for custom objective functions.
221187
222- Parmest includes two built-in objective functions ("SSE" and "SSE_weighted") to compute
223- the sum of squared errors between the ``m.experiment_outputs `` model values and
224- data values.
188+ When declaring a custom objective function, parmest assumes the model has the structure of
189+ a two-stage stochastic programming problem so the objective function should be implemented
190+ using Pyomo Expressions for the first stage cost (named "FirstStageCost") and the second stage
191+ cost (named "SecondStageCost"). For parameter estimation problems the first stage cost is usually
192+ set to zero and the second stage cost is usually defined as the deviation between the model and
193+ the observations.
225194
226195Step 4: Estimate the Parameters
227196-------------------------------
0 commit comments