Home / Monte Carlo / Analyzing the Model / Optimize / Options
Optimize Options¶
Every control on the two Optimizer Setup screens and in the Optimizer Options window.
How the search works is not described here, deliberately. This page names every control and says what it sets.
Screen 1: Goal¶
One of two:
| Choice | What it means |
|---|---|
| Minimize dpm for all outputs | one goal across every output at once |
| Optimize one statistic | pick an output and one statistic of it |
With no saved goal, the screen starts on Minimize dpm for all outputs when at least one output has a specification limit, and on Optimize one statistic when none has. With no specification limit on any output, Minimize dpm for all outputs is unavailable and says why:
No output has a specification limit, so dpm cannot be calculated. Add a specification limit to at least one output to use this goal.
Minimize dpm for all outputs opens a panel with one row per output. Each row has a dpm Type
choice, dpm (Normal Data) or Count Out of Spec (Non-Normal Data). With two or more outputs, each
row also has a Weight (1 to 100) box: how much that output counts relative to the others. Press
Next with a weight blank or not a number and the screen refuses with "Each weight must be a number
from 1 to 100." and puts the keyboard in the box at fault.
Optimize one statistic builds the goal as a sentence from pickers: the direction (Minimize, Maximize or Set target), the statistic and the output, for example "Minimize the Mean of Output A". Set target adds a target box: "Set target for Mean of Output A to 12.5".
The statistics¶
When you optimize one statistic, these are the choices. Four of them take a number or two of their own, named in the last column.
| Statistic | Extra numbers |
|---|---|
| Mean | |
| Median | |
| Xth Percentile | Percent |
| Minimum | |
| Maximum | |
| Standard Deviation | |
| Variance | |
| Range Width | |
| Probability Less Than | Threshold |
| Probability Greater Than | Threshold |
| Probability Between | Lower threshold, Upper threshold |
| Coefficient of Variation | |
| Cpk | |
| Cp | |
| Cpk Lower | |
| Cpk Upper | |
| dpm | |
| dpm Lower | |
| dpm Upper | |
| Count Out of Spec |
Screen 1: Constraints¶
Add Constraint adds a condition the answer has to satisfy. A constraint is built from the same list of statistics above, as a sentence such as "The Mean of Output A must be Greater Than 100". The comparison is Less Than, Greater Than or Between; Between takes a second value.
Each constraint row carries Active, so one can be switched off without deleting it, and Remove.
Screen 2: the ranges¶
A grid of the input parameters the Optimizer may change, with these columns:
| Column | What it holds |
|---|---|
| Input | which marked input |
| Type | Optimized (the Optimizer may move the parameter between Low and High) or Not Optimized (the parameter stays at its current value; Low and High go blank, and what was typed in them is kept) |
| Parameter | which parameter of that input's distribution is being moved |
| Low | the bottom of the range the Optimizer may use |
| High | the top of it |
With no saved settings, each input that can be optimized gets one row, on its first parameter in the table below:
- A Normal input's Mean row runs from the input's Valid minimum (low) to its Valid maximum (high) (Mark Input, Advanced tab) when both are set, and otherwise from the mean minus 10 standard deviations to the mean plus 10.
- Every other input's row starts at the parameter's current value, with Low and High equal.
Once settings are saved, the grid shows the saved Optimized rows, and an input with no saved row at all gets the row above. An input whose saved rows are all Not Optimized has no row, and is counted under the grid instead.
To add a row, choose the input and parameter in Parameter to add, where each item reads "Input: Parameter", then click Add Input Optimization Parameter. The new row is Optimized, with the Low and High that pair last had, or both at the parameter's current value when it has none. Remove deletes the selected row.
The parameters offered depend on the input's distribution:
| Distribution | Parameters offered |
|---|---|
| Normal | Mean, Standard deviation |
| Lognormal | Mean (log), Standard deviation (log) |
| Exponential | Offset, Lambda |
| Uniform | Midpoint, Width |
| Triangular | Mode, Left width, Right width |
| Weibull | Offset, Beta (shape), Alpha (scale) |
| Gamma | Offset, Shape, Scale |
| Logistic | Location, Scale |
| Log-Logistic | Location, Scale |
| Uniform-Discrete | Midpoint, Width |
| Poisson | Offset, Mean |
| Binomial | Offset, Number of trials, Probability of success |
| Binary (Bernoulli) | Offset, Probability of 1 |
| Constant | Value |
A Custom Continuous, Custom Discrete or Empirical input offers nothing and cannot be optimized, and neither can an input whose Optimization answer in Mark Input is No.
Selecting a row draws its distribution beside the grid. For an Optimized row it draws two
curves, the parameter at Low and at High, with the legend Low (solid), High (dashed). For a Not
Optimized row it draws the distribution at its current values, Current value (solid). Below the
picture, each offered parameter's current value is listed.
Under the grid, two count lines report the inputs that are not in it: those that cannot be optimized ("1 input cannot be optimized.") and those that could be but are not being ("1 input is not being optimized."). Each has a Show names button that turns into Hide names.
Both screens¶
| Button | What it does |
|---|---|
| Save Optimizer Settings | stores the setup so the next run starts from it, confirming with Optimizer settings saved. |
| Back | screen 2 only, returns to the goal |
| Next | saves that screen's settings and goes on; Next on screen 2 starts the run |
| Cancel | leaves without running |
Cancel on screen 2 does not undo screen 1. Next on screen 1 has already saved the goal and the constraints, so they are there the next time Optimize opens.
When Next is refused¶
A refused Next or Save Optimizer Settings names what is wrong and puts the keyboard in the box at fault, so the sentence and the cursor always agree with each other. The one exception is "Nothing to optimize", which is about the whole grid, so the keyboard stays where it was.
These are the sentences, by where they come from:
| Sentence | What it means |
|---|---|
| Choose an output for the goal. | No output picked on screen 1 |
| Choose an output for each constraint. | A constraint row with no output |
| The output 'X' has no specification limit, so statistic cannot be calculated. | Cpk, dpm or Count Out of Spec chosen for an output with no limit; the lower and upper forms say "no lower specification limit" or "no upper specification limit" for Cpk Lower, dpm Lower, Cpk Upper and dpm Upper |
| The output 'X' does not have both specification limits, so Cp cannot be calculated. | Cp chosen for an output without both limits |
| Percent must be a number., Threshold must be a number., Lower threshold must be a number., Upper threshold must be a number. | A statistic's own extra number, in the goal or a constraint |
| Target must be a number. | The goal's target box is blank or is not a number |
| Value must be a number. and Value2 must be a number. | A constraint's number box, and its second box for Between |
| Second value must be greater than the first value | A two-number statistic or a Between constraint given a pair in the wrong order |
| Constraint Ranges overlap. | Two or more active constraints on the same output, statistic and extra numbers whose ranges have no value in common |
| Each weight must be a number from 1 to 100. | A weight box in the Minimize dpm for all outputs panel |
| Low and High must be numbers for the Parameter of input Input. | A range row on screen 2 with a blank or non-numeric end |
| Low must be at or below High for the Parameter of input Input. | A range row entered the wrong way round |
| Parameter must be at or above 0 for input Input. | A Low or High outside what that parameter can take; the other forms are "above 0", "from 0 to 1" and "above 0 and below 1" |
| Nothing to optimize. Give at least one parameter a range with Low below High. | Screen 2 with no Optimized row whose Low is below its High |
A range row is named by its parameter and its input, for example "Low and High must be numbers for the Standard deviation of input Wall thickness.", because one input can have several rows.
A number a statistic can never reach¶
A target or a constraint outside what the statistic can produce is refused. For a target, the sentence names the statistic, the output and the bound:
The Standard Deviation of Thickness cannot be less than 0.
For a constraint, it names the number you typed: "The Standard Deviation of Thickness cannot be less than -1.", and for Between, "... cannot be between a and b."
The bound itself is allowed, so a standard deviation of exactly 0 is accepted. What each statistic can produce:
| Statistic | Values it can take |
|---|---|
| Mean, Median, Xth Percentile, Minimum, Maximum, Cpk, Cpk Lower, Cpk Upper, Coefficient of Variation | any number |
| Standard Deviation, Variance, Range Width, Cp, Count Out of Spec | 0 or more |
| Probability Less Than, Probability Greater Than, Probability Between | 0 to 1 |
| dpm, dpm Lower, dpm Upper | 0 to 1,000,000 |
The coefficient of variation is in the first group on purpose: it is a standard deviation divided by a mean, so it goes negative whenever the mean does.
A constraint that is always true is not refused. Standard Deviation Greater Than -5 is accepted as it is.
When the run cannot start¶
After Next on screen 2, a run that cannot be started shows a message saying why, and screen 2 opens again with the setup as it was saved. Among these messages:
- "The workbook has no saved optimization goal. Open the optimizer setup and choose a goal before starting an optimization."
- "The optimizer requires every formula in the model to compile in the parser, and the following did not: ..." followed by the formulas' own messages.
- "Nothing to optimize. Give at least one parameter a range with Low below High."
Optimizer Options¶
Opened with Options... on screen 1. Five settings, and nothing else:
| Setting | What it sets | Default |
|---|---|---|
| Simulations per candidate in the final comparison | a whole number of 0 or more | 8192 |
| Simulations for the final reported answer | how many simulations the reported answer's statistics are measured on, a whole number of 0 or more | 32768 |
| Number of threads | how many processor threads the run may use, from 1 to the number the label shows for this machine | that largest number |
| Sampling method | Monte Carlo or Sobol |
Sobol |
| Random seed | blank, or a whole number from 1 to 2147483647 for a run you can reproduce | blank, which uses the clock |
Restore defaults puts all five back. OK keeps them, Cancel discards them.
During and after the run¶
| Control | Where | What it does |
|---|---|---|
| Stop optimization | Optimization in progress | ends the run and keeps the best answer found so far |
| Cancel | Optimization in progress | abandons the run, which reports nothing |
| Run Monte Carlo simulation at the optimal settings | the results screen | when you answer Yes, runs an ordinary simulation after the optimal values are written, using the Simulations and Sampling lists on the ribbon |
| Yes / No | the results screen | write the optimal values into the inputs, or leave the model as it was |
What Yes writes. For each optimized parameter, a value typed in Mark Input is replaced in the input's stored definition, and a value linked to a cell is written into that cell. The cell notes on the inputs are not rewritten, so a note can still show the value from before. Nothing else changes, and there is no undo: the results table shows every value before you answer.