Difference between revisions of "Defining a variable as a distribution"
m (updated see using a library link) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
+ | [[Category: Variables]] | ||
+ | [[Category: Definitions]] | ||
<breadcrumbs>Analytica User Guide > Expressing Uncertainty > {{PAGENAME}}</breadcrumbs> | <breadcrumbs>Analytica User Guide > Expressing Uncertainty > {{PAGENAME}}</breadcrumbs> | ||
− | To define a variable as an Analytica probability distribution, first select the variable and open either the variable’s | + | To define a variable as an Analytica probability distribution, first select the variable and open either the variable’s [[Object window]] or the [[Attribute panel]] of the diagram with [[Definition]] selected from the [[Attribute dropdown menu]]. |
To define the distribution: | To define the distribution: | ||
− | # Click the | + | # Click the [[expr]] menu above the definition field and select '''Distribution'''. |
− | [[File:Menu.png]] | + | #:[[File:Menu.png]] |
− | + | # The [[Object Finder dialog]] opens, showing the Distribution library. | |
− | + | #:[[File:Distribution library.png]] | |
− | # The | ||
− | |||
− | |||
− | [[File:Distribution library.png]] | ||
− | |||
# Select the distribution you wish to use. | # Select the distribution you wish to use. | ||
# Enter the values for the parameters. You can use an expression or refer to other variables by name in the parameter fields. | # Enter the values for the parameters. You can use an expression or refer to other variables by name in the parameter fields. | ||
− | # Click OK to accept the distribution. | + | # Click '''OK''' to accept the distribution. |
If the parameters of the distribution are single numbers, a button appears with the name of the distribution, indicating that the variable is defined as a distribution. To edit the parameters, click this button. | If the parameters of the distribution are single numbers, a button appears with the name of the distribution, indicating that the variable is defined as a distribution. To edit the parameters, click this button. | ||
− | [[File:Button.png]] | + | :[[File:Button.png]] |
− | |||
If the parameters of the distribution are complex expressions, the distribution displays as an expression. For example: | If the parameters of the distribution are complex expressions, the distribution displays as an expression. For example: | ||
− | <code>Normal((Price/Mpy)*Mpg, Mpg/10)</code> | + | :<code>Normal((Price/Mpy)*Mpg, Mpg/10)</code> |
'''Entering a distribution as an expression''' | '''Entering a distribution as an expression''' | ||
Line 35: | Line 31: | ||
# Press ''Alt-Enter'' or click the[[File:checks.png|centre|18x18px]]button. | # Press ''Alt-Enter'' or click the[[File:checks.png|centre|18x18px]]button. | ||
− | You can also paste a distribution from the Distribution library in the | + | You can also paste a distribution from the Distribution library in the [[Definition menu]] (see [[User Libraries#Using a library | Using a library]]). |
+ | |||
+ | You can edit a distribution as an expression, whether it was entered as a distribution from the Distribution library or as an expression, by selecting '''expr''' from the [[expr]] menu. | ||
− | + | :[[File:Expression.png]] | |
− | [[ | + | == See Also == |
+ | * [[How to Fit a Distribution to Data]] | ||
+ | * [[Choosing an appropriate distribution]] | ||
− | |||
<footer>Choosing an appropriate distribution / {{PAGENAME}} / Including a distribution in a definition </footer> | <footer>Choosing an appropriate distribution / {{PAGENAME}} / Including a distribution in a definition </footer> |
Latest revision as of 23:05, 11 August 2016
To define a variable as an Analytica probability distribution, first select the variable and open either the variable’s Object window or the Attribute panel of the diagram with Definition selected from the Attribute dropdown menu.
To define the distribution:
- Click the expr menu above the definition field and select Distribution.
- The Object Finder dialog opens, showing the Distribution library.
- Select the distribution you wish to use.
- Enter the values for the parameters. You can use an expression or refer to other variables by name in the parameter fields.
- Click OK to accept the distribution.
If the parameters of the distribution are single numbers, a button appears with the name of the distribution, indicating that the variable is defined as a distribution. To edit the parameters, click this button.
If the parameters of the distribution are complex expressions, the distribution displays as an expression. For example:
Normal((Price/Mpy)*Mpg, Mpg/10)
Entering a distribution as an expression
Alternatively, you can directly enter a distribution as an expression:
- Set the cursor in the definition field and type in the distribution name and parameters, for example - Normal(.105, 0.015)
- Press Alt-Enter or click thebutton.
You can also paste a distribution from the Distribution library in the Definition menu (see Using a library).
You can edit a distribution as an expression, whether it was entered as a distribution from the Distribution library or as an expression, by selecting expr from the expr menu.
See Also
Enable comment auto-refresher