 <?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=KMullins</id>
	<title>Analytica Docs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=KMullins"/>
	<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php/Special:Contributions/KMullins"/>
	<updated>2026-06-30T06:58:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DbQuery/Step-by-Step_querying_Microsoft_Access&amp;diff=53987</id>
		<title>DbQuery/Step-by-Step querying Microsoft Access</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DbQuery/Step-by-Step_querying_Microsoft_Access&amp;diff=53987"/>
		<updated>2019-10-18T19:36:24Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added a link to the Northwinds database, since it doesn't seem to come with Office 365&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Database Functions]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This mini-tutorial takes you through a step-by-step process of connecting to and querying data from a Microsoft Access database using [[DbQuery]].&lt;br /&gt;
&lt;br /&gt;
== Find the Database ==&lt;br /&gt;
&lt;br /&gt;
Microsoft Access 2000 and later includes a sample database called ''Northwind'' that we will use for this exercise.  First, locate this database on your computer and view it in Access:&lt;br /&gt;
&lt;br /&gt;
* Start Microsoft Access&lt;br /&gt;
* Select File &amp;amp;rarr; Open..., and find the &amp;lt;code&amp;gt;Northwind.mdb&amp;lt;/code&amp;gt; file, usually at:&lt;br /&gt;
:&amp;lt;code&amp;gt;C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you don't have a local copy, the database can be downloaded from Microsoft Templates at [https://omextemplates.content.office.net/support/templates/en-us/tf01228997.accdt this link]&lt;br /&gt;
* After opening in Access, it may display an introduce dialog.  Click through this and examine the list of Tables.  Open the &amp;lt;code&amp;gt;Customers&amp;lt;/code&amp;gt; table.  We'll query this table from Analytica.&lt;br /&gt;
&lt;br /&gt;
== Set up a Data Source ==&lt;br /&gt;
&lt;br /&gt;
Here you will set up a DSN for the Northwind database, which will allow you to connect to it by name from [[DbQuery]].   To do this, follow these steps:&lt;br /&gt;
* ''Start &amp;amp;rarr; Control Panel &amp;amp;rarr; Administrative Tools &amp;amp;rarr; Data Sources (ODBC)''&lt;br /&gt;
* Click the ''System DSN'' tab.  &lt;br /&gt;
* Press Add..., select ''Microsoft Access Driver (&amp;lt;code&amp;gt;*.mdb&amp;lt;/code&amp;gt;)''&lt;br /&gt;
* Enter:&lt;br /&gt;
:&amp;lt;code&amp;gt;Data Source Name: Northwind&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description: Sample database from Microsoft Access&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press the '''Select...''' button, and navigate to the &amp;lt;code&amp;gt;Northwind.mdb&amp;lt;/code&amp;gt; database file identified earlier.  Select it.&lt;br /&gt;
* Press '''OK''' to complete the Data Sources dialog.&lt;br /&gt;
&lt;br /&gt;
Now we have a data source named &amp;lt;code&amp;gt;Northwind&amp;lt;/code&amp;gt; that we can connect to using [[DbQuery]].  With this datasource, we can query any of the tables in the Northwind database.&lt;br /&gt;
&lt;br /&gt;
== Set up the Analytica model ==&lt;br /&gt;
&lt;br /&gt;
Now you will create the query in an Analytica model.  &lt;br /&gt;
* Start Analytica&lt;br /&gt;
* Drag an index node to the diagram, title it &amp;lt;code&amp;gt;Customer Number&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set its definition to:&lt;br /&gt;
:&amp;lt;code&amp;gt;DbQuery(&amp;quot;DSN=Northwind&amp;quot;, sql: &amp;quot;select * from Customers&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Evaluate it.&lt;br /&gt;
&lt;br /&gt;
At this point, if you've done things correctly, you'll see an index from 1 to 91 (or however many records are present in your own Customers table).&lt;br /&gt;
&lt;br /&gt;
* Drag another index node to the diagram, name it &amp;lt;code&amp;gt;Customer Field&amp;lt;/code&amp;gt;, define it as:&lt;br /&gt;
:&amp;lt;code&amp;gt;DbLabels(Customer_Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Drag a variable node to the diagram, name it &amp;lt;code&amp;gt;Customer Table&amp;lt;/code&amp;gt;, and define it as:&lt;br /&gt;
:&amp;lt;code&amp;gt;DbTable(Customer_Number, Customer_Field)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Evaluate &amp;lt;code&amp;gt;Customer_Table&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data is now imported (as shown below).&lt;br /&gt;
&lt;br /&gt;
:[[Image:ODBC_Customer_Table.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Reindexing the Table ==&lt;br /&gt;
&lt;br /&gt;
For convenience, we may want to use the &amp;lt;code&amp;gt;CustomerID&amp;lt;/code&amp;gt; column of the table as the row index.  To do this, we'll re-index the data.&lt;br /&gt;
&lt;br /&gt;
* Create a new index node, name it &amp;lt;code&amp;gt;CustomerID&amp;lt;/code&amp;gt;, defined as:&lt;br /&gt;
*:&amp;lt;code&amp;gt;CopyIndex(DbTable(Customer_Number,&amp;quot;CustomerID&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will now serve as our row index.  &lt;br /&gt;
* Change the definition of &amp;lt;code&amp;gt;Customer_Field&amp;lt;/code&amp;gt; to:&lt;br /&gt;
*:&amp;lt;code&amp;gt;index tmp := DbLabels(Customer_Number) do subset(tmp &amp;lt;&amp;gt; &amp;quot;CustomerID&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Change the definition of &amp;lt;code&amp;gt;Customer_Table&amp;lt;/code&amp;gt; to&lt;br /&gt;
*:&amp;lt;code&amp;gt;DbTable(Customer_Number, Customer_Field) [@Customer_Number = @CustomerID]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Re-evaluate &amp;lt;code&amp;gt;Customer_Table&amp;lt;/code&amp;gt;.  You should see a two-D table having indexes: &amp;lt;code&amp;gt;CustomerID&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Customer_Fields&amp;lt;/code&amp;gt;&lt;br /&gt;
*:[[Image:ODBC_Customer_Table_re-indexed.JPG]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[DbQuery]]&lt;br /&gt;
* [[Querying Access database from Analytica 64]]&lt;br /&gt;
* [[Database functions]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Iterate&amp;diff=53691</id>
		<title>Iterate</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Iterate&amp;diff=53691"/>
		<updated>2019-08-13T21:47:44Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Evaluation Functions]]&lt;br /&gt;
[[category:Top level functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Iterate(initial, expr, until'', maxIter, warn'') ==&lt;br /&gt;
Repeats the computation «expr» until the termination condition «until» becomes true (nonzero), or the number of iterations reaches «maxIter».  The parameters «expr» and «until» may, and usually do, depend on variable(s) that depends on the variable defined with Iterate. This creates a recurrence,  [[Draw arrows#Influence cycle or loop|cycle or loop]] in the influence diagram, something that is not otherwise allowed except in [[Dynamic]] loops.  Analytica iterates the evaluation around the cycle until it reaches the termination condition «until», usually a convergence or equilibrium.&lt;br /&gt;
&lt;br /&gt;
You may use [[Iterate]] only as the main function defining a variable (as with [[Dynamic]]). You may not nest it inside an expression. &lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
* «initial»: the starting value for the iteration&lt;br /&gt;
* «expr»: how the subsequent values are computed from the previous value.  «expr» may, and usually does, depend directly or indirectly upon the variable defined by Iterate, forming a recurrence or cycle in the influence diagram.  &lt;br /&gt;
* «until»: The termination condition.  Iterate continues evaluating «expr» until «until» is true (non-zero) -- if «until» is an array, until all its elements are true (nonzero) -- or until the number of iterations reaches «maxIter», if specif.  &lt;br /&gt;
* ''«maxIter»'': (optional) The maximum number of iterations. If omitted, it will keep iterating until the «until» becomes true. Unless you are absolutely certain the iteration will converge, it is a good idea to specify a value for «maxinter».&lt;br /&gt;
* ''«warn»'': (optional) If true (nonzero), it will give a warning if it terminates due to reaching the maximum number of iterations «maxinter», rather than the termination condition «until».&lt;br /&gt;
&lt;br /&gt;
[[Iterate]] is useful when you want adjust a variable and repeat a calculation over several variables in the model to meet a constraint. If you can perform the iteration within the definition of a single variable or [[User-Defined Functions]], it is usually simpler and clearer to use the [[While..Do]] construct.&lt;br /&gt;
&lt;br /&gt;
For more complex cases, especially when you want to adjust multiple variables to solve constraints and/or find a maximum or minimum, it is simpler and faster to use the [[Analytica Optimizer Guide|Analytica Optimizer]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
:[[Image:Market Equilibrary Diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
This examples models how a market price reaches equilibrium to correct an imbalance between supply and demand.  It forecasts a the supply and demand given an initial price, and modifies the &amp;lt;code&amp;gt;Price&amp;lt;/code&amp;gt; iteratively until the supply exactly matches the demand reaching a market equilibrium.  &amp;lt;code&amp;gt;Price&amp;lt;/code&amp;gt; is defined as:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Price := Iterate(Price_Guess, Next_price, Abs(Next_price-price) &amp;lt; 0.01, 50)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It iterates until the change in price between successive iterations is less than 0.01, or reaches 50 iterations.&lt;br /&gt;
&lt;br /&gt;
== Iterating Multiple Variables ==&lt;br /&gt;
You may want to update several variables in each iteration:  For example, both &amp;lt;code&amp;gt;Price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Market_size&amp;lt;/code&amp;gt;.  You should define  only one variable using [[Iterate]]. (If you define both &amp;lt;code&amp;gt;Price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Market_size&amp;lt;/code&amp;gt; using [[Iterate]], it will create two nested iterations, which would not do what you want.) Instead, you can define a new single variable that groups all the variables into a single state, listing them along an index.&lt;br /&gt;
&lt;br /&gt;
:[[Image:Market Equilib Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the above diagram, &amp;lt;code&amp;gt;State_index&amp;lt;/code&amp;gt; is defined as a list of labels:&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! State_index &amp;amp;#9660;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;Price&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;Market Size&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You define the initial state and next state each as a table indexed by &amp;lt;code&amp;gt;State_index&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Initial_state := Table(State_index)(Price_Guess, Market_size_guess)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Next_State := Table(State_Index)(Price_Guess, Market_size_guess)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and define &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; using Iterate:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable State := Iterate(Initial_state, Next_State, abs(state-next_state) &amp;lt; 0.01, 50)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For convenience in the rest of the model, it is useful to define &amp;lt;code&amp;gt;Price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Market_Size&amp;lt;/code&amp;gt; as the elements of &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;: &lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Price := State[State_Index = 'Price']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Market_Size := State[State_Index = 'Market Size']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, we assume that &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Market_size&amp;lt;/code&amp;gt; have the same dimensions -- both are scalars, or both are arrays with the same indexes.  If you want them to have different dimensions, you can include their values using [[Using References|references]]:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Initial_state := &amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Table(State_index)(\Price_guess, \Market_size_guess)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Next_state := &amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Table(State_Index)(\Price_Guess, \Market_size_guess)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Price := &amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;#State[State_index = 'Price']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Market_size :=&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;#State[State_index = 'Market Size']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable State :=&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Iterate(Initial_state, Next_State, &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt;Abs(Price-next_price) &amp;lt; 0.01 AND Abs(Market_size - Next_market_size) &amp;lt; 1, &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt;50)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that '[[Using References|\]]' and '[[#]]' are the reference and de-reference operators. Gathering references to values into an array is a flexible method that generalizes to any number of variables. &lt;br /&gt;
&lt;br /&gt;
== Iterate with Dynamic ==&lt;br /&gt;
Iterate can be used in conjunction with [[Dynamic]].  Depending on the model structure, this can either result in an iteration within a dynamic loop, where the iteration to convergence occurs at each point in time, or it can result in a dynamic loop within an iteration, in which case the entire dynamic loop is computed to completion within each iteration.&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is a variable defined with Iterate, and &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; is a variable defined with [[Dynamic]].  Then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; might depend directly or indirectly on &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; might depend directly or indirectly on &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;.  This creates four distinct dependency structures.  When neither &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; nor &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; depends on the other, then there is no interaction.  Similarly, when &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; depends on &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, but &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is not downstream of &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is not within &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;'s dynamic loop, so again there is no interaction.  In this case, &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is iterated to completion once, independent of the dynamic loop, then the dynamic loop performs its looping using this value.  &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; depends on &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;, but &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; does not depend on &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, then the dynamic loop is completely inside the Iteration for &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, so that the dynamic loop is computed to completion within each iteration.  &lt;br /&gt;
&lt;br /&gt;
The most difficult case is when &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; both depend on the other.  When this happens, the iterate expression could, in principle, be interpreted as being inside the dynamic or around the dynamic.  Analytica resolves this ambiguity by assuming that the iterate is inside the dynamic, so that as the dynamic loop is evaluated at each time period, the iteration in &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is run to completion for that time period.  Variables inside &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;'s definition are implicitly assumed to be sliced by the current dynamic time (as occurs with any variable appearing inside a dynamic loop).&lt;br /&gt;
&lt;br /&gt;
You may encounter situations where you want to compute one or more variables using Iterate, which in turn are utilized within a dynamic loop, but where you desire the iteration to occur around the dynamic loop.  For example, you may have completed an entire [[Dynamic]] model, and now you want to wrap [[Iterate]] around the full model to adjust an input parameter.  In the future, we may introduce a new variation on the iterate function that would make it possible to specify that [[Iterate]] is wrapped around a given dynamic loop.  Until then, one way to cause Iterate to wrap around a dynamic loop is by using a [[WhatIf]] to compute the value of the input parameter.  To demonstrate, suppose you have an input parameter, &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;, used by a dynamic model having some output &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.  We want to define &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; using [[Iterate]] where the update expression and termination expressions depend on &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.  To do this, we introduce two variables:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Y2 := WhatIf(Y, K, K2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable K2 := Iterate(K, f(K2, Y2), g(K2, Y2))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;f()&amp;lt;/code&amp;gt; is the update expression and &amp;lt;code&amp;gt;g()&amp;lt;/code&amp;gt; is the termination expression.  When &amp;lt;code&amp;gt;K2&amp;lt;/code&amp;gt; is evaluated, the iteration re-evaluates the full model repeatedly, with &amp;lt;code&amp;gt;K2&amp;lt;/code&amp;gt; eventually being set to the &amp;quot;converged&amp;quot; value for the parameter &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;.  As a final step, we may want to set &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; to be this computed value for &amp;lt;code&amp;gt;K2&amp;lt;/code&amp;gt;.  For this last step, we would need to use a button:&lt;br /&gt;
:&amp;lt;code&amp;gt;Button Update_K := (K := K2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pressing the button causes the entire evaluation to take place.  &lt;br /&gt;
&lt;br /&gt;
(To do: provide some examples)&lt;br /&gt;
&lt;br /&gt;
== Interacting Iterate Functions ==&lt;br /&gt;
If you have two (or more) variables defined using the [[Iterate]] function, they should not be mutually dependent on each other.  This case creates an ambiguity (for example, the result would depend on which was evaluated first), and results in an error message.&lt;br /&gt;
&lt;br /&gt;
It is okay for one to be nested within the other, in which case the inner iteration runs to convergence during each iteration of the outer iterate. However, the need for nested iterations like this are rare. You should make sure that you don't intend to have a single iteration with multiple variables updated in the same iteration (see the earlier section on this page).&lt;br /&gt;
&lt;br /&gt;
If you have two interacting Iterate loops that are not clearly nested, you will see this error message:&lt;br /&gt;
&lt;br /&gt;
:''A disallowed cyclic dependency involving the Iterate function in ''ident'' detected.  You may have two nodes  defined with Iterate functions, with each depending on the other.  If you use two Iterate functions, one needs  to be clearly nested inside the other.  If you intend to have a single iteration involving two or more nodes,  the Iterate function should appear only once.''&lt;br /&gt;
&lt;br /&gt;
=== Iterate with Change in Evaluation Mode ===&lt;br /&gt;
Suppose &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is defined using [[Iterate]], and the update expression depends on [[Sample]](X) -- for example, it may use a statistical function like [[Mean]](X).  If &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is evaluated in [[Mid]] mode, it appears as if there are two interacting Iterate loops, and the above error message, ''A disallowed cyclic dependency involving Iterate....'' occurs.&lt;br /&gt;
&lt;br /&gt;
== Iterate vs. While..Do ==&lt;br /&gt;
[[Iterate]] and [[While..Do]] are closely related, and both are often used for implementing convergence algorithms.  When implementing an iterative algorithm in a [[User-Defined Functions|User-Defined Function]], you would normally use [[While..Do]].  However, in some situations you may develop a fairly sizable influence diagram model, where you wish to iterate over the entire model.  In that case, Iterate is very convenient, and may require only small modifications.&lt;br /&gt;
&lt;br /&gt;
The [[While..Do]] construct requires its parameter, which determines when the loop terminates, to be atomic, while [[Iterate]] allows array-valued termination conditions, but continues until all cells are true.  &lt;br /&gt;
&lt;br /&gt;
There are a few other approaches to implementing iterations within Analytica.  [[NlpDefine]] performs a full optimization search.  The [[Solve]] and [[GoalSeek]] functions are similar, although scaled down somewhat in their sophistication.  [[User-Defined Functions]] can be recursive, although the [[recursion]] depth is usually limited to 255, which can be a limiting factor.  And to iterate over an existing model structure, [[While..Do]] can be used with [[WhatIf]], or from a button script, [[While..Do]] can be used with assignment (often a useful way to iterate in very large scale sampling applications that exceed memory required for built-in Monte Carlo sampling).  And of course, there is [[Dynamic]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Analytica_User_Group/Past_Topics#The_Iterate_Function|Webinar on the Iterate Function]]&lt;br /&gt;
* [[Dynamic]]&lt;br /&gt;
* [[ComputedBy]]&lt;br /&gt;
* [[While..Do]]&lt;br /&gt;
* [[Using References]]&lt;br /&gt;
* [[DefineOptimization]]&lt;br /&gt;
* [[WhatIf]]&lt;br /&gt;
* [[Recursion]]&lt;br /&gt;
* &amp;lt;code&amp;gt;Newton Raphson Method.ana&amp;lt;/code&amp;gt; example model in the &amp;lt;code&amp;gt;Example Models/Decision Analysis folder&amp;lt;/code&amp;gt; installed with Analytica&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=User_Input_nodes&amp;diff=53684</id>
		<title>User Input nodes</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=User_Input_nodes&amp;diff=53684"/>
		<updated>2019-08-12T21:23:25Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Update to match User Output updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category:Nodes]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; User Interfaces for End Users &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
An '''''input node '''''lets you, or your end user, see and easily change the value of a variable directly in the diagram, without opening an ''Attribute ''view or [[Object window]] (see [[Browsing with input and output nodes]]). In browse mode you can change only the values and definitions of input nodes.&lt;br /&gt;
&lt;br /&gt;
An input node is an alias of a variable that you want to treat as an input to the model (see [[Alias nodes]]).&lt;br /&gt;
&lt;br /&gt;
The type of definition of the original variable determines the appearance of the input node. If you want your users to be able to change the type of definition, instruct them on how to open an ''Attribute ''view or [[Object window]] and use the [[The Expression popup menu|expr menu]].&lt;br /&gt;
&lt;br /&gt;
'''Input field'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Chapter9 2.png]] A single number or text value (scalar) displays as an input field. You can have Analytica check if the input value is acceptable by using the [[Checking for valid values|Check attribute]]; the check is performed on input of a new value. {{Release|5.0||After creating the input field, you should select '''Number only''', '''Text only''' or '''Number or text only''' from the Definition type pulldown in the [[Attribute panel]] or [[Object Window]] if you want to disallow the entry of general expressions.}}&lt;br /&gt;
&lt;br /&gt;
'''Checkbox'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Checkbox.png]] A true/false or yes/no selection. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Input_popup_menu&amp;quot;&amp;gt;'''Input popup menu'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Chapter9 3.png]] A choice displays as an input popup menu. To create an input menu for an input node, see [[Creating a choice menu]].&lt;br /&gt;
&lt;br /&gt;
'''List'''&lt;br /&gt;
&lt;br /&gt;
[[File:Chapter9 4.png]] A list or list of labels displays as a '''List '''button. See [[Creating an index]].&lt;br /&gt;
&lt;br /&gt;
'''Edit table'''&lt;br /&gt;
&lt;br /&gt;
[[File:Chapter9 5.png]] An edit table displays as an '''Edit Table '''button. See [[Defining a variable as an edit table]].&lt;br /&gt;
&lt;br /&gt;
'''Probability distribution'''&lt;br /&gt;
&lt;br /&gt;
[[File:Chapter9 6.png]] A probability distribution displays a button with the name of the distribution. See [[Defining a variable as a distribution]].&lt;br /&gt;
&lt;br /&gt;
'''Creating an input node''': To create an input node from a variable:&lt;br /&gt;
&lt;br /&gt;
# Make sure you are in [[edit mode]].&lt;br /&gt;
# Select the variable.&lt;br /&gt;
# There are three options once you have selected the node:&lt;br /&gt;
#* Select '''Make Input Node '''from the [[Object menu]]&lt;br /&gt;
#* Right click the node and select '''Make User Input Node'''&lt;br /&gt;
#* Use the keyboard shortcut ''Ctrl+Alt+I'' &lt;br /&gt;
# Move the input node to the location you want.&lt;br /&gt;
# Adjust the size of the node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;To make several input nodes at once, select the nodes and then choose '''Make Input Node'''.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[User output nodes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;User interfaces / {{PAGENAME}} / Choice menu user input&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=User_output_nodes&amp;diff=53683</id>
		<title>User output nodes</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=User_output_nodes&amp;diff=53683"/>
		<updated>2019-08-12T21:07:43Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added three options to create User Output Node&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category:Nodes]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; User Interfaces for End Users &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
An '''''output node '''''gives you, or your end user, rapid access to a selected result in the model. You can use output nodes to focus attention on particular outputs of interest.&lt;br /&gt;
&lt;br /&gt;
An output node displays a result value in the view style — i.e., whether table or graph, the indexes displayed, and the uncertainty view — last selected for display and saved with the model. {{Release||4.6|It also shows}}{{Release|5.0||Optionally, you can also show}} the uncertainty view icon (see [[Uncertainty views]]){{Release|5.0||&amp;amp;nbsp;by turning on the '''Show result mode icons''' [[Preferences|preference setting]]}}.&lt;br /&gt;
&lt;br /&gt;
:[[Image:Chapter9 9.png]] If the result is a single value (mid value or mean), it displays directly in the output field. {{Release|5.0||The &amp;lt;code&amp;gt;mid&amp;lt;/code&amp;gt; seen here is the optional uncertainty view icon.}}&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[Image:Chapter9 10.png]]}}{{Release|5.0||[[Image:ResultButton.png]]}} If the result is a table, the output node displays a '''Result '''button. Click the button to display the table or graph. After you display the table or graph, you can use the result toolbar to change the view.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[Image:Chapter9 11.png]]}}{{Release|5.0||[[Image:CalcButton.png]]}} If the value of an output has not yet been computed, the '''Calc '''button appears in the node. Click the '''Calc '''button to compute and display the value.&lt;br /&gt;
&lt;br /&gt;
'''Creating an output node''': To create an output node from a variable:&lt;br /&gt;
# Make sure you are in [[edit mode]].&lt;br /&gt;
# In a [[Diagram window]], select the node of the variable for which you wish to create an output node.&lt;br /&gt;
# There are three options once you have selected the node:&lt;br /&gt;
#* Select '''Make Output Node '''from the [[Object menu]]&lt;br /&gt;
#* Right click the node and select Make User Output Node&lt;br /&gt;
#* Use the keyboard shortcut Ctrl+Alt+O &lt;br /&gt;
# Move the output node, which appears in the diagram next to the selected node, to the location you want.&lt;br /&gt;
# Adjust the size of the node.&lt;br /&gt;
&lt;br /&gt;
The view style of the output result (table or graph) is the format you last set for it (see [[Number and table formats]] and [[Graphs]]).&lt;br /&gt;
&lt;br /&gt;
'''Resizing controls''': &lt;br /&gt;
&lt;br /&gt;
{{Release||4.6|&lt;br /&gt;
:[[image:Chapter9 12.png]]}}&lt;br /&gt;
{{Release|5.0||&lt;br /&gt;
:{{CalloutAnnotationBlock|&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[image:Output node with resizing handles.png]]|&lt;br /&gt;
{{CalloutAnnotation|Drag left edge of control to resize|Type=Bare|v=0|pt=165,20|path=rmD10|style=width:300px}}&lt;br /&gt;
{{CalloutAnnotation|Drag handles to resize node|Type=Bare|v=120|pt=235,32|path=r(235,8)mr(22,8)mr(22,32)mr|style=width:200px}}&lt;br /&gt;
}} }}&lt;br /&gt;
&lt;br /&gt;
You can resize input and output nodes by dragging their corner handles, just like other nodes. But for these, its usually most convenient to deselect '''Resize centered '''from the [[Diagram menu]] so you can align them either along their right edges, or both edges.&lt;br /&gt;
&lt;br /&gt;
You can also drag the left edge of the control field, button, or menu left or right to change its width. This is especially useful for choice menus when you want to expand the width to be large enough for the widest menu option.&lt;br /&gt;
&lt;br /&gt;
When using a pull-down menu containing long text values, you might want to adjust the pull-down control as necessary to accommodate your longest text value. Input and output nodes contain text and graphics, in addition to the control itself. The node resizing handles that appear as small black squares at the corners of the node adjust the size of the bounding rectangle that holds all these items, but does not change the width of the control itself. To change the width of a control (a pull-down menu, textedit box, or button), position the mouse over the left edge of the control, depress the mouse button and drag the cursor to the left or right.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[User Input nodes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Checkbox user input / {{PAGENAME}} / User inputs and outputs as aliases&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Objects_and_Their_Attributes_-_Part_2_of_3&amp;diff=53678</id>
		<title>Objects and Their Attributes - Part 2 of 3</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Objects_and_Their_Attributes_-_Part_2_of_3&amp;diff=53678"/>
		<updated>2019-08-07T17:31:50Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica Scripting Guide]]&lt;br /&gt;
[[Category: Objects]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Scripting Guide &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==User-Specified Attributes==&lt;br /&gt;
&lt;br /&gt;
Objects may be described by various attributes.  Some of these attributes may be specified by the user.  These are known as user-specified attributes.  For example, when you create a variable, you usually supply four attributes for it: Title, Units, Description, and Definition.  The user-specified attributes are summarized below:&lt;br /&gt;
&lt;br /&gt;
'''Author'''&amp;lt;br&amp;gt;The author(s) of a model or another object.  By default, this is the computer’s registered user name (on Macintosh, specified in the Sharing Setup control panel). &lt;br /&gt;
&lt;br /&gt;
'''Title'''&amp;lt;br&amp;gt;	&lt;br /&gt;
Brief text used to identify a variable.  Titles can be up to 255 characters; however Analytica often truncates them to fit.&lt;br /&gt;
&lt;br /&gt;
'''Description'''&amp;lt;br&amp;gt;&lt;br /&gt;
One or more lines about what an object represents. Descriptions will help you, and other people who access the model, understand it.&lt;br /&gt;
&lt;br /&gt;
'''Definition'''&amp;lt;br&amp;gt;&lt;br /&gt;
An expression that Analytica uses to compute the value of an object.  A definition may be a simple number, an array, a probability distribution or a mathematical Expression that includes other variables. Definitions may be several lines long.  &lt;br /&gt;
&lt;br /&gt;
'''Units'''&amp;lt;br&amp;gt;&lt;br /&gt;
The units of measurement of a variable, e.g., $/yr. You can leave the Units field blank if the variable is a number or a dimensionless ratio.&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&amp;lt;br&amp;gt;&lt;br /&gt;
When you create a new mathematical Function, you may specify a list of parameters for each Function.  See [[UDF|User-defined functions]] and [[Function Parameter Qualifiers]].&lt;br /&gt;
 &lt;br /&gt;
'''Check'''&amp;lt;br&amp;gt;&lt;br /&gt;
A test that Analytica conducts on the validity of the value of a variable.  A [[Check attribute]] is an Expression that contains the variable to be tested.  If checking evaluates to False (or 0), Analytica warns you that the value of the variable is questionable.  [[Check attribute]]s are described later in this manual.&lt;br /&gt;
&lt;br /&gt;
'''Usecheck'''&amp;lt;br&amp;gt;&lt;br /&gt;
An attribute that controls whether a variable will (or won't) be checked for legality according to its Check attribute whenever it is evaluated.  Usecheck overrides the system variable Checking for the particular variable to which it is attached.&lt;br /&gt;
&lt;br /&gt;
'''Script'''&amp;lt;br&amp;gt;&lt;br /&gt;
An attribute that contains a sequence of commands each separated by carriage returns that are executed when the user clicks on the button containing the script.&lt;br /&gt;
&lt;br /&gt;
'''Balloonhelp'''&amp;lt;br&amp;gt;&lt;br /&gt;
An attribute that contains help that appears when the mouse is over the object's node in a Diagram window.  By default, Analytica uses the Description attribute for an object in Balloon Help.  This attribute is available only on the Macintosh.&lt;br /&gt;
&lt;br /&gt;
'''Indexvals'''&amp;lt;br&amp;gt;&lt;br /&gt;
An attribute that may be defined as a list or list of labels, and function as a Self index for a variable table definition.  This attribute is normally set by Analytica, but can be user-specified.&lt;br /&gt;
&lt;br /&gt;
'''Domain'''&amp;lt;br&amp;gt;&lt;br /&gt;
An attribute that may be defined as a list or list of labels, and function as a Self domain for a variable probtable definition.  This attribute is normally set by Analytica, but can be user-specified.&lt;br /&gt;
&lt;br /&gt;
==Computed Attributes==&lt;br /&gt;
&lt;br /&gt;
In addition to user-specified attributes, there are computed attributes that Analytica adds to objects.  Analytica generates the values of computed attributes. Other computed attributes used internally by Analytica are listed in the Appendix.&lt;br /&gt;
&lt;br /&gt;
'''Date''' (displays as '''Created''')&amp;lt;br&amp;gt;&lt;br /&gt;
The date and time the model was first created.&lt;br /&gt;
&lt;br /&gt;
'''Savedate'''&amp;lt;br&amp;gt;The last time the model was saved.&lt;br /&gt;
&lt;br /&gt;
'''Saveauthor'''&amp;lt;br&amp;gt;The user who last modified a model, if different from the owner of the computer on which the model is created.&lt;br /&gt;
&lt;br /&gt;
'''Inputs'''&amp;lt;br&amp;gt;A list of variables and functions that appear in the definition of the specified variable or function.&lt;br /&gt;
&lt;br /&gt;
'''Outputs'''&amp;lt;br&amp;gt;A list of variables and functions that refer to this object in their Definitions.&lt;br /&gt;
&lt;br /&gt;
'''Value'''&amp;lt;br&amp;gt;The deterministic value of a variable.&lt;br /&gt;
&lt;br /&gt;
'''Probvalue'''&amp;lt;br&amp;gt;The probabilistic value of a variable.&lt;br /&gt;
&lt;br /&gt;
'''Contains'''&amp;lt;br&amp;gt;The list of variables and other objects created within a model.&lt;br /&gt;
&lt;br /&gt;
'''Isin'''&amp;lt;br&amp;gt;The model to which an object belongs.&lt;br /&gt;
&lt;br /&gt;
==User Interface Attributes==&lt;br /&gt;
&lt;br /&gt;
Many computed attributes are set by the graphical user interface in Analytica, and are called User Interface attributes.  User Interface attributes are only represented visually and are usually not examined or modified directly by the user.  These attributes range from window state information, to node location, color and font.&lt;br /&gt;
&lt;br /&gt;
An object's node location and node size can be specified using the following attributes:&lt;br /&gt;
&lt;br /&gt;
'''Nodelocation''' ''h, v'' &amp;lt;br&amp;gt;Horizontal and vertical coordinates (in Diagram space) of the node representing this object.&lt;br /&gt;
&lt;br /&gt;
'''Nodesize''' ''w, h''&amp;lt;br&amp;gt;Half-width and half-height (in Diagram space) of the node representing this object.&lt;br /&gt;
&lt;br /&gt;
An object’s information can be viewed in a number of windows; hence there are several different attributes used to store window state information, depending on the window type needed.  The format of these window state attributes is as follows:&lt;br /&gt;
&lt;br /&gt;
'''attribute''' ''version, left, top, width, height [, attribs]'' &amp;lt;br&amp;gt;&lt;br /&gt;
*''version'' indicates the version of this attribute's format; 1 in the current version of Analytica&lt;br /&gt;
*''left'' and ''top'' are the top-left screen coordinates of the window&lt;br /&gt;
*''width'' and ''height'' are the window’s width and height&lt;br /&gt;
 &lt;br /&gt;
Additional information regarding node style, diagram style, and result state may follow these values, depending on the attribute.&lt;br /&gt;
&lt;br /&gt;
'''[[NodeInfo]]''': Controls display options for a node, including arrows, node border, label and so on. See [[NodeInfo]]&lt;br /&gt;
&lt;br /&gt;
'''DiagramColor'''&amp;lt;br&amp;gt;&lt;br /&gt;
red, green, blue&lt;br /&gt;
&lt;br /&gt;
'''Nodecolor''' ''red, green, blue''&amp;lt;br&amp;gt;&lt;br /&gt;
These are Diagram and Node background color attributes, respectively; light gray by default for diagrams, white by default for nodes.  Color information is stored as RGB (Red, Green, Blue) components.  Each RGB component is an integer value from 0 to 65,535.  RGB color is additive, which means that as the value of a component is increased, the amount of that component in the total color decreases.  An RGB color is black if all three components are set to 0; white if each component is set to 65,535. A negative value (-32767 to -1) is internally transformed by adding 65536.&lt;br /&gt;
 &lt;br /&gt;
'''Fontstyle''' ''fontname, fontsize''&lt;br /&gt;
&lt;br /&gt;
'''Nodefont''' ''fontname, fontsize''&amp;lt;br&amp;gt;&lt;br /&gt;
These are Diagram and Node font attributes, respectively, containing font name and font size. , fontsize is in pixels, not points.  These are the same on a 1/72 dots per inch screen.  VGA screens are usually 1/96 dots per inch, so an n pixel font size is 72/96 * n points.&lt;br /&gt;
&lt;br /&gt;
(Note, the NodeFont attribute is only used when the NodeInfo attribute setting for UseNodeFont is set to 1.)&lt;br /&gt;
&lt;br /&gt;
'''Defaultsize''' ''width, height''&amp;lt;br&amp;gt;&lt;br /&gt;
This is the default half-height and half-width for a node, used when creating new nodes in a diagram.&lt;br /&gt;
&lt;br /&gt;
'''Icon''' ''hexdata'' &amp;lt;br&amp;gt;&lt;br /&gt;
Node icon information is stored as hexadecimal ASCII text.  Analytica automatically &amp;quot;compiles&amp;quot; this information into the icon format when an icon is represented on the screen.&lt;br /&gt;
&lt;br /&gt;
'''Graphsetup''' ''commands''&amp;lt;br&amp;gt;&lt;br /&gt;
Graphsetup contains a sequence of graph system variable assignments separated by carriage returns (and using the &amp;quot;~&amp;quot; continuation character), to be used when creating a graph result of the variable to which it is assigned.&lt;br /&gt;
&lt;br /&gt;
'''ReformDef [''' ''col, row'' ''']'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''[[ReformVal]] [''' ''col, row'' ''']'''&amp;lt;br&amp;gt;These are row/column reform state attributes for [[Edit Table]] and [[Result window]]s, respectively.  col and row, inside brackets specify the index variable for the column and row, respectively.&lt;br /&gt;
 &lt;br /&gt;
'''Numberformat''' ''version, formatcode, digits, zeroes, separators, currency''&lt;br /&gt;
Numberformat specifies how a number (result or output node) should be displayed. &lt;br /&gt;
&lt;br /&gt;
*version is the current format version (1.0)&lt;br /&gt;
*formatcode has the following values:&lt;br /&gt;
:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! code||name||example&lt;br /&gt;
|-&lt;br /&gt;
|D||Suffix||1.235K&lt;br /&gt;
|-&lt;br /&gt;
|E||Expoential||1.235e+4&lt;br /&gt;
|-&lt;br /&gt;
|F||Fixed point||12345.68&lt;br /&gt;
|-&lt;br /&gt;
|I||Integer||12346&lt;br /&gt;
|-&lt;br /&gt;
|%||Percent||1234567.80%&lt;br /&gt;
|-&lt;br /&gt;
|DD	||Date||Tue, Oct 19, 1937&lt;br /&gt;
|-&lt;br /&gt;
|DB	||Boolean||True&lt;br /&gt;
|}&lt;br /&gt;
	&lt;br /&gt;
* ''digits'' specifies the number of digits for suffix and exponent formats.&lt;br /&gt;
&lt;br /&gt;
* ''zeroes'' specifies the number of digits after the decimal point for fixed point, integer and percent formats.&lt;br /&gt;
&lt;br /&gt;
* ''separators'' and ''currency'' only apply to fixed point formats; values are 0 (don’t show) or 1 (show).&lt;br /&gt;
&lt;br /&gt;
'''Xyexpr''' ''expr''&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies an expression to graph against, as an x-y scatter graph.  This is used by the Analytica interface.&lt;br /&gt;
&lt;br /&gt;
==Inspecting Objects==&lt;br /&gt;
&lt;br /&gt;
To see all of the user-specified attributes of an object, you use the Show  Command, as illustrated in the transcript below:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;show mpy&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;variable Mpy&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Title: miles per year&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Units: Miles/year&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description: Annual mileage driven&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition: 12K&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Nodelocation: 208,48&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Nodesize: 52,24&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see the entire contents of a model (i.e., all of the user-defined objects in the model), you use the '''Allshow''' Command.  Note that the output from Allshow may be as large as the model file itself.&lt;br /&gt;
&lt;br /&gt;
To see a particular attribute of an object, you type the attribute and the object's identifier, as illustrated below:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;title mpy&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;miles per year&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see a summary of a variable, including its title, units, and value, you type its identifier.  For example, to see a summary of variable Mpy (the entire variable is shown in the preceding example),&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;mpy&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;mpy     Miles per year     (miles/year)  =       12K&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To display the value of a variable, you ask for the Value attribute, as illustrated below:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;value mpy&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;12K&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Example&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A discussion of possible values for variables is given elsewhere in this manual.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Tutorial: Decision trees#Defining_Party_Location_as_a_list_of_labels|Tutorial: Defining Party Location as a list of labels]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Objects and Their Attributes - Part 1 of 3 / {{PAGENAME}} / Objects and Their Attributes - Part 3 of 3&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=GraphToCanvasCoord&amp;diff=53354</id>
		<title>GraphToCanvasCoord</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=GraphToCanvasCoord&amp;diff=53354"/>
		<updated>2019-07-26T22:05:13Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(''New to [[Analytica 5.2]]'')&lt;br /&gt;
&lt;br /&gt;
This function is only used from within the [[OnGraphDraw]] attribute expression, or from [[User-Defined Functions]] that are called from [[OnGraphDraw]]. Use this function when you need to figure out the pixel coordinates of a data point on the graph when annotating a graph using the [[Drawing images|Canvas Drawing Functions]].&lt;br /&gt;
&lt;br /&gt;
== GraphToCanvasCoord( info, roles, x,y'', cluster, flags'' ) ==&lt;br /&gt;
&lt;br /&gt;
Returns the pixel coordinates, xPx and yPx in a graph with specified info and roles, given the data coordinates, «x» and «y». &lt;br /&gt;
«x» is in units of the variable or index used for the independent axis -- i.e. the horizontal axis unless you have checked '''Swap horizontal and vertical''' in [[Graph Setup]]. «y» is in units of the dependent axis, usually the vertical axis. For example, when viewing a graph of ''Revenue'' vs. ''Time'', this code in the [[OnGraphDraw]] attribute) draws a circle on the graph at Time=2020, Revenue=1M&lt;br /&gt;
&lt;br /&gt;
::[[Local]] (x,y) := [[GraphToCanvasCoord]](info, roles, 2020, 1M );&lt;br /&gt;
::[[CanvasDrawEllipse]](canv, x-5, y-5, 11, 11)&lt;br /&gt;
&lt;br /&gt;
The function returns pixel x and pixel y as separate return values, so you have to capture multiple return values to access y. Hence, in the above example, you must include the parentheses around &amp;lt;code&amp;gt;(x,y)&amp;lt;/code&amp;gt; in the [[Local]] declaration. &lt;br /&gt;
&lt;br /&gt;
Do not use this function when &amp;lt;code&amp;gt;phase=1&amp;lt;/code&amp;gt; -- before layout -- because &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; have not yet been established at that point.&lt;br /&gt;
&lt;br /&gt;
When you have a bar chart with a color index and a cluster index, you can use this to map from (x, y, cluster) to pixel x, pixel y. In this case, both «x» and «y» are categorical values, often text.  When supplying «cluster», named parameter calling syntax is required (at least for «cluster». At present, the function does not handle clustered bar charts that use a value for the Color role (as opposed to an index for the Color role). &lt;br /&gt;
&lt;br /&gt;
Graphs can be pivoted by the end-user, so your code in ''OnGraphDraw'' may need to be cognizant about which value is assigned to which axis.&lt;br /&gt;
&lt;br /&gt;
The function automatically adjusts for linear vs. log axis scaling, continuous vs. categorical axes, Swap horizontal and vertical, and reverse axis order, and manual axis scaling (e.g., zoom) in the current view. As a result, it greatly simplifies the creating of graph annotations.&lt;br /&gt;
&lt;br /&gt;
An end-user can also manually scale an axis, for example to zoom into a part of the graph. In this case, the data point you map to pixels may land outside of the visible plot area. You may want to take this into account in your annotation code. In some cases, you might want to not draw anything for these out-of-range points, for example when annotating points with labels -- otherwise, the label would be dawn outside the plot area. In other cases, you might want to clip the drawing to the plot area (using [[CanvasContext]], for example when drawing lines between points. The 3rd return value is a boolean (or array of booleans when transforming an array of points) that indicates whether the point is within the plot area visible range. Or you can set «flag» to 1 to return null for out-of-range pixel x or pixel y, which will often cause your drawing code to ignore these points automatically without any additional code or your part.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
* «info», «roles»: These are the values for the local variables &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; that are available to [[OnGraphDraw]]. You need to just forward those as-if to this function. These are not available in the 'before layout' phase, i.e., when &amp;lt;code&amp;gt;phase=1&amp;lt;/code&amp;gt;; hence, the function cannot be used in that phase. &lt;br /&gt;
* «x»: A value along the dependent-axis -- i.e., along the horizontal axis when '''Swap horizontal and vertical''' is off, or along the vertical axis when it is on.&lt;br /&gt;
* «y»: A value along the independent-axis -- i.e., along the vertical axis when '''Swap horizontal and vertical''' is off, or along the horizontal axis when it is on.&lt;br /&gt;
* «cluster»: (Optional) A value in the cluster index in a clustered bar chart. Only use this for a clustered bar chart with an index for Color. (At present, the function does not support the case where a value is used for color). This parameter must be specified using a named-parameter syntax, e.g., &amp;lt;code&amp;gt;cluster:someVal&amp;lt;/code&amp;gt;.&lt;br /&gt;
* «flags»: (Optional). A sum of zero or more of the following values:&lt;br /&gt;
** 1 = Return [[Null]] for pixel x or pixel y when the respective «x» or «y» value is not within the current plot area. When a graph is manually scaled (zoomed), some points may land outside of the plot area. Without this flag, it will return pixel coordinates that may land outside that plot area frame.&lt;br /&gt;
** 2 = Return the &amp;quot;far&amp;quot; end of a categorical interval along the y-axis. This would be the &amp;quot;top&amp;quot; of a bar, for example, in a horizontal bar chart with a non-reversed axis. Without this (or flag=4), the center of the category interval is returned. This flag is ignored for non-bar-charts unless the flag=8 bit is set.&lt;br /&gt;
** 4 = Return the &amp;quot;near&amp;quot; end of a categorical interval along the y-axis. Ignored for non-bar-charts except with the flag=8 bit is set.&lt;br /&gt;
** 8 = Apply the flag=2 or flag=4 bit to non-bar charts. Without this, flag=2 or flag=4 apply only to bar charts.&lt;br /&gt;
&lt;br /&gt;
=== Return values ===&lt;br /&gt;
It returns three values:&lt;br /&gt;
# The horizontal coordinate of the point in pixel coordinates.&lt;br /&gt;
# The vertical coordinate of the point in pixel coordinates.&lt;br /&gt;
# True when the point is within the plot area (given the current axis scaling), False if it falls outside the current plot area.&lt;br /&gt;
&lt;br /&gt;
To access the 2nd and 3rd return values, you must use the multiple-return-value capture syntax, which consists of placing parentheses around the local identifiers as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (pixel_x, pixel_y, isVisible) := [[GraphToCanvasCoord]](...)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[OnGraphDraw]]&lt;br /&gt;
* [[Drawing images]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=OnGraphDraw&amp;diff=53353</id>
		<title>OnGraphDraw</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=OnGraphDraw&amp;diff=53353"/>
		<updated>2019-07-26T22:01:53Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Attributes]]&lt;br /&gt;
{{ReleaseBar}} &lt;br /&gt;
&lt;br /&gt;
This attribute lets you annotate a graph with text, lines, areas, and other graphics -- for example, to add labels to points, or point out interesting aspects of a graph. It even lets you show a map or other image under a graph, and display points over it.   The annotations may depend on the values being graphed and so reposition themselves as the data changes. It also provides a hook where you can enhance graphing functionality (or make use of existing functions that do so) when there is something you want that the built-in graphing engine support.&lt;br /&gt;
&lt;br /&gt;
Two libraries are included with [[Analytica 5.2]] that provide functions for use in the [[OnGraphDraw]] with pre-implemented effects:&lt;br /&gt;
* The [[:Category:OnGraphDraw annotations library functions|OnGraphDraw annotations library]] provides functions for plotting [[Plot_error_bars|error bars]], [[Plot_Tukey_bars|Tukey bars]], [[Plot_point_labels|labels on data points]], [[Plot_solid_band|a filled range behind data]] and [[Plot_solid_prob_bands|filled probability bands]].&lt;br /&gt;
* The [[:Category:Google Maps from OnGraphDraw library functions|Google Maps from OnGraphDraw library]] provides functions for [[OnDraw_Google_map|drawing a Google map]] behind your data (or said differently, for plotting data over a Google map). This library requires [[Analytica Enterprise]] or better.&lt;br /&gt;
&lt;br /&gt;
Additional libraries of functions that perform various types of annotations or graphs may become available over time, and may be contributed by other Analytica users.&lt;br /&gt;
&lt;br /&gt;
{{Release|5.1|5.1|''This feature is '''experimental''' until [[Analytica 5.2]] and may be subject to future non-backward-compatible changes.''}}&lt;br /&gt;
{{Release||5.0|''Requires [[Analytica 5.2]] or later.''}}&lt;br /&gt;
{{Release|5.2||''New to [[Analytica 5.2]]}}&lt;br /&gt;
&lt;br /&gt;
== Attribute OnGraphDraw ==&lt;br /&gt;
&lt;br /&gt;
You can specify an expression in the [[OnGraphDraw]] attribute, which is evaluated while a graph is being drawn. The expression uses [[Drawing images|drawing commands on a Canvas]], which lies under or over the standard graph plot. &lt;br /&gt;
&lt;br /&gt;
You can write code in [[OnGraphDraw]] to draw nearly anything you can dream up, but unless you are a power user, you are more likely to make use of libraries of pre-existing [[User-Defined Functions]] that implement specific plots, embellishments or effects.&lt;br /&gt;
&lt;br /&gt;
[[OnGraphDraw/Label Minimum and maximum|Here is an example]] that finds and labels the minimum and maximum points in a data series:&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_min_and_max.png]]&lt;br /&gt;
&lt;br /&gt;
The graphing engine scaled and drew the axes and plotted the points. The code in the [[OnGraphDraw]] attribute found the min and max  points and drew the annotations. ([[OnGraphDraw/Label Minimum and maximum|See how this was done]]).&lt;br /&gt;
&lt;br /&gt;
In this example, [[OnGraphDraw]] gets a map from Google maps and draws it behind the plotted data. Here the X-Y graph has three data points connected by two lines:&lt;br /&gt;
&lt;br /&gt;
[[Image:onGraphDraw_map.png]]&lt;br /&gt;
&lt;br /&gt;
The [[OnGraphDraw]] expression obtains the map from Google maps using [[ReadFromURL]] -- the map is not served by the graphing engine itself.  The library function [[OnDraw_Google_map]] makes it easy to include graph on a map ([[Analytica Enterprise]] required) -- see [[OnDraw_Google_map]] for instructions.&lt;br /&gt;
&lt;br /&gt;
=== Locals ===&lt;br /&gt;
&lt;br /&gt;
These local variables are accessible within an [[OnGraphDraw]] expression, and give information about the graph and the current graphing roles:&lt;br /&gt;
* '''''canv''''': The canvas. This is what you draw to using the [[Drawing images|canvas drawing functions]].&lt;br /&gt;
* '''''info''''': A vector of information about the graph, such as the dimensions of the graph and location of the plot area. The vector is indexed by the system index [[OnGraphDrawItem]] index.&lt;br /&gt;
* '''''phase''''': The drawing phase. This enables you to detect at what stage of the graph rendering the attribute is being evaluated. Possible values are: 1=Before graphing has started, 2=After the graph layout has been calculated, but before anything is drawn, 4=After the background and axes have been drawn, but before the data is plotted, 8=After the graph has been fully rendered (except for your own embellishments).&lt;br /&gt;
* '''''roles''''': Information about the graphing dimensions that fill each graphing role. This is indexed by [[GraphingRole]] and [[GraphFillerInfo]]. &lt;br /&gt;
* '''''continue''''': A boolean that you can set to false if you don't want the graph to be drawn any further beyond this point. This can be used to substitute your own custom drawing code in place of the built-in graphing engine, which might include totally different graphical depictions.&lt;br /&gt;
* '''''roleChanges''''': It is possible to alter axis scaling by changing items in this local. For example, you may need to adjust the axis range in order to register a map image so that data plotted on top appear at the correct latitude and longitude.&lt;br /&gt;
&lt;br /&gt;
=== When OnGraphDraw is evaluated ===&lt;br /&gt;
&lt;br /&gt;
By default, it evaluates the expression in [[OnGraphDraw]] after rendering the graph data. That's useful when you want to draw the annotations on the graph over the data.  You can also set it to evaluate at three earlier phases of drawing. To set this preference, check the appropriate box in the [[OnGraphDraw]] attribute in the [[Object Window]] of the graphed variable:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw-checkboxes.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Release|5.1|5.1|''Note: These checkboxes are not present in [[Analytica 5.1]], so you need to the system variable [[OnGraphDrawFlags]] to a number equal to the sum of the phase values listed next.''}}&lt;br /&gt;
&lt;br /&gt;
''Note: These check boxes appear in the [[Object window]], but not in the [[Attribute pane]].''&lt;br /&gt;
&lt;br /&gt;
It evaluates [[OnGraphDraw]] during each phase of the graph rendering that you check:&lt;br /&gt;
* 1: '''Evaluate before layout''':  Call before graphing has started, including before determining the layout info, such as the plot area. To replace a graph entirely with a custom graphical depiction of your own, enable this, and set &amp;lt;code&amp;gt;continue:=0&amp;lt;/code&amp;gt; in your [[OnGraphDraw]] code.&lt;br /&gt;
* 2: '''Evaluate before drawing''':  Call after determining the layout, but before drawing anything, so annotations will appear behind any background and axes.&lt;br /&gt;
* 4: '''Evaluate after axes, before data''': Draw annotations after the background and axes, but behind data points, lines or bars.&lt;br /&gt;
* 8 '''Evaluate after fully drawn''' (default) Call after the standard graphing has completed to annotate the graph or data with images in front of the data.&lt;br /&gt;
The check boxes in the object window are stored in the '''OnGraphDrawFlags''' attribute of the graphed object, using a value equal to the sum of the values show for phase.&lt;br /&gt;
&lt;br /&gt;
The local variable &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt; contains one of these values and can be used inside an [[OnGraphDraw]] expression to detect which phase it is. When you select more than one of these options, you should usually include an [[If|If-Then]] branch on the local &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== To access OnGraphDraw ===&lt;br /&gt;
{{Release||5.1|The [[OnGraphDraw]] Attribute is currently an experimental feature.  To make it visible, press F12 to open the [[Typescript Window]], and then type: &amp;lt;code&amp;gt;AskAttribute OnGraphDraw, Variable, yes&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Release|5.2||By default, the [[OnGraphDraw]] attribute does not appear in the [[Attribute pane]] or [[Object window]]. To see it, go to the [[Attributes dialog]] on the [[Object menu]] and enable it for ''Variables''.}}&lt;br /&gt;
&lt;br /&gt;
It will now appear in the [[Attribute panel]] and [[Object window]], where you can give it an Analytica expression.&lt;br /&gt;
&lt;br /&gt;
=== Basics of drawing ===&lt;br /&gt;
To draw on the graph surface, use the [[Drawing images|Canvas drawing functions]] to draw to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt; is the name of a local variable available to you in the [[OnGraphDraw]] attribute. For example:&lt;br /&gt;
&lt;br /&gt;
:'''OnGraphDraw:''' &amp;lt;code&amp;gt;[[CanvasDrawRectangle]]( canv, x:100, y:130, width:80, height:50, fillColor:0x440000ff )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_rect1.png]]&lt;br /&gt;
&lt;br /&gt;
This rectangle always appears at the same location, and doesn't adapt when the graph window is resized; therefore, its location does not necessarily coincide with any particular data, unless by chance. The difficult part is writing code that figures out where to draw. The plot area in canvas pixel coordinates is provided in the local variable named &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; as illustrated here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
|'''OnGraphDraw:''' || [[CanvasDrawEllipse]](canv, || x:info[OnGraphDrawItem='PlotAreaLeft'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || y:info[OnGraphDrawItem='PlotAreaTop'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || width: info[OnGraphDrawItem='PlotAreaWidth'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || height: info[OnGraphDrawItem='PlotAreaHeight'],&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || fillColor:0x440000ff )&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_plotArea.png]]&lt;br /&gt;
&lt;br /&gt;
The y-axis scale goes from &amp;lt;code&amp;gt;roles[GraphingRole='Y axis', GraphFillerInfo='Min']&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;roles[GraphingRole='Y axis', GraphFillerInfo='Max']&amp;lt;/code&amp;gt;. So to annotate a threshold at y=1000, you could use this [[OnGraphDraw]] expression&lt;br /&gt;
&lt;br /&gt;
 [[image:OnGraphDraw_afterFullyDrawn.png]]&lt;br /&gt;
 [[Local]] yThresh := 1000;&lt;br /&gt;
 [[Local]] (ignore,y) := [[GraphToCanvasCoord]](info,roles,0,yThresh);&lt;br /&gt;
 [[Local]] x1 := info[OnGraphDrawItem='PlotAreaLeft'];&lt;br /&gt;
 [[Local]] x2 := info[OnGraphDrawItem='PlotAreaWidth'] + x1;&lt;br /&gt;
 [[CanvasDrawLine]]( canv, x1,y, x2, y, color:'Green', width:3);&lt;br /&gt;
 [[CanvasDrawText]](canv, &amp;quot;Threshold&amp;quot;, x1, y, color:'Green', vAlign:'Bottom')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_threshold.png]]&lt;br /&gt;
&lt;br /&gt;
=== Replacing the plot entirely, but using the same axes ===&lt;br /&gt;
A probability bands graph plot is normally draw with lines, such as:&lt;br /&gt;
:[[image:OnGraphDraw_OriginalBandsPlot.png|533px]]&lt;br /&gt;
&lt;br /&gt;
By using [[OnGraphDraw]], we can retain the axes and axes scaling, but replace the plot itself with custom-drawn Tukey bars:&lt;br /&gt;
:[[image:OnGraphDraw TukeyBands.png|533px]]&lt;br /&gt;
&lt;br /&gt;
In this case, the [[OnGraphDraw]] will be set as follows&lt;br /&gt;
:[[image:OnGraphDraw_TukeyBandsCall.png]]&lt;br /&gt;
Two key things are happening here. First, it is evaluated after the axes are drawn but before the data is drawn, and second, it sets the local &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; to false if it draws the Tukey bars. The pre-existing [[UDF]] &amp;lt;code&amp;gt;Tukey_bars&amp;lt;/code&amp;gt; returns true when it draws the bars, false otherwise. The function has a line that checks whether you are viewing the Bands view, so that other uncertainty views continue to render in their default fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::[[If]] info[OnGraphDrawItem='ViewMode']&amp;lt;&amp;gt;'Bands' [[Then]] ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The key is also turned off in graph setup, since the colors shown in the key no longer apply.&lt;br /&gt;
&lt;br /&gt;
=== Clipping to the plot area ===&lt;br /&gt;
&lt;br /&gt;
When you draw to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;, you can draw on any part of the graph. So if you aren't careful, annotations that you expect to draw on the data may extend outside of the plot area (the area bounded by the axes). In some cases this may be what you want, but in other cases you may want to clip to the plot area.&lt;br /&gt;
&lt;br /&gt;
In this example, error bars are draw around the mean value points without any clipping. It does not look natural for these bars to extend outside of the plot area.&lt;br /&gt;
&lt;br /&gt;
 '''OnGraphDraw:'''  { simplistic version }&lt;br /&gt;
   [[Local]] spread := SDeviation(Self);&lt;br /&gt;
   [[Local]] xPt := #roles[GraphingRole='X axis', GraphFillerInfo='Value'];&lt;br /&gt;
   [[Local]] yPt := #roles[GraphingRole='Y axis', GraphFillerInfo='Value'];&lt;br /&gt;
   [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
   [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xUp,yUp,xDn,yDn);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsNoClip.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this, you can draw to a [[CanvasContext|canvas context]] that has been clipped to the plot area, rather than drawing directly to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;. The above code is modified as follows, where &amp;lt;code&amp;gt;clip&amp;lt;/code&amp;gt; is a clipped canvas context:&lt;br /&gt;
&lt;br /&gt;
 '''OnGraphDraw:'''  { still simplistic, but with clipping }&lt;br /&gt;
   [[Local]] spread := SDeviation(Self);&lt;br /&gt;
   [[Local]] xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
   [[Local]] yPt := #roles[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
   [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
   [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   &amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;[[Local]] clip := Clip_to_PlotArea(canv, info);&amp;lt;/span&amp;gt;&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xUp,yUp,xDn,yDn);&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsWithClip.png]]&lt;br /&gt;
&lt;br /&gt;
where the Clip_to_plotArea is a [[User-Defined Function]] that returns a canvas context clipped to the plot area. It is implemented as follows:&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;code&amp;gt;Clip_to_plotArea(canv,info) :=&lt;br /&gt;
:[[Local]] (x,y,w,h) := _(...info[ [[OnGraphDrawItem]]='PlotArea'&amp;amp;['Left','Top','Width','Height'] ]);&lt;br /&gt;
:[[CanvasContext]](canv, clip:x,y,w,h)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the axis scale ===&lt;br /&gt;
&lt;br /&gt;
The graphing engine selects the axis scale based on the data, and it does not know about stuff that you draw. In same cases you may need to adjust the axis scales so that the range includes your annotations. This section will illustrate one example where this comes up -- when drawing error bars around a point, the range of the error bars around mean-value points extend outside of the range of the plotted mean points. At least when the axis is auto-scaled, you need to extend the min and max data points. Another example occurs when rendering a Google map behind the data. You need to adjust the actual min and max latitude and longitude to the map actually returned by the Google server, even when your axes are manually scaled.&lt;br /&gt;
&lt;br /&gt;
Changes to the scale must occur in the &amp;quot;before drawing&amp;quot; phase, so you need to enable evaluation of [[OnGraphDraw]] before drawing (as well as in the phase when you will actually render your annotations). During the before drawing phase, phase=2, your code needs to make modifications to the local variable &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;, which the rendering engine will then use while drawing the axes in the next phase.&lt;br /&gt;
&lt;br /&gt;
The relevant addition for rescaling is highlighted. This part occurs during phase=2, whereas the remaining previous code is not in the else (not phase 2). The key point is that in phase=2, it modifies the min and max to include the extrema of the error bars.&lt;br /&gt;
&lt;br /&gt;
 [[image:OnGraphDraw_PhaseBeforeAxes_and_after.png]]&lt;br /&gt;
 [[Local]] spread := [[SDeviation]](Self);&lt;br /&gt;
 [[Local]] yRole := roles[ [[GraphingRole]]='Y axis' ];&lt;br /&gt;
 [[Local]] yPt := #yRole[ [[GraphFillerInfo]]='Value' ];&lt;br /&gt;
 &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;[[If]] phase = 2 and yRole[ [[GraphFillerInfo]]='Autoscale'] [[Then]] (&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Max' ] := MaxAll(yPt+spread);&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Min' ] := MinAll(yPt-spread);&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt; Else (&lt;br /&gt;
      [[Local[[ xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value' ];&lt;br /&gt;
      [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
      [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
      [[Local]] clip := Clip_to_plotArea(canv,info);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xUp,yUp,xDn,yDn);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
 )&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsWithAdjustedYScale.png]]&lt;br /&gt;
&lt;br /&gt;
=== Adapting to Swap XY ===&lt;br /&gt;
&lt;br /&gt;
The error bar example so far has a problem when you Swap XY. Can you spot it:&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsSwapXY_bad.png]]&lt;br /&gt;
The problem has to do with the way we draw the caps at the end of each error bar. They are still being drawn horizontally, but now need to be drawn vertically. Here the code that draws one of those ticks:&lt;br /&gt;
:&amp;lt;code&amp;gt;[[CanvasDrawLine]](clip,xDn-4,yDn,xDn+4,yDn)&amp;lt;/code&amp;gt;&lt;br /&gt;
It draws a line from 4 pixels left of the bar end to 4 pixels right of the bar end. When we've swapped XY, we effectively want instead&lt;br /&gt;
:&amp;lt;code&amp;gt;[[CanvasDrawLine]](clip,xDn,yDn-4,xDn,yDn+4)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following addition accomplishes this (unchanged lines not shown):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[Local]] ticW:=4, ticH:=0;&lt;br /&gt;
:[[If]] info[ [[OnGraphDrawItem]]='SwapXY'] [[Then]] ( ticW:=0; ticH:=4 );&lt;br /&gt;
:...&lt;br /&gt;
:[[CanvasDrawLine]](clip,xUp-ticW,yUp-ticH,xUp+ticW,yUp+ticH);&lt;br /&gt;
:[[CanvasDrawLine]](clip,xDn-ticW,yDn-ticH,xDn+ticW,yDn+ticH);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsSwapXY.png]]&lt;br /&gt;
&lt;br /&gt;
=== Encapsulating drawing code === &lt;br /&gt;
You may want to show error bars for a different variable. You don't want to repeat all this code every time, and of course, if you later make a bug fix or improvement, you'll want all your plots to inherit that fix. Hence, you should encapsulate this code as a [[User-Defined Function]]. Once you do this, when new variables want error bars, you'll just need to call your UDF from [[OnGraphDraw]] AND you'll need make sure to check the correct check boxes to specify when it is evaluated. &lt;br /&gt;
&lt;br /&gt;
Encapsulating tends to be easy. You're function parameters are whichever of the special local variables (including possibly Self) that your code used. You have some choices about how you want to encapsulate it. For example, do you want your error bar function to only operate from Mean result view? Or do you want to let your caller decide? Do you want to always depict one standard deviation, or do you want your caller to specify the spread? &lt;br /&gt;
&lt;br /&gt;
When your logic changes the &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt; variable, then your function will need to return the new value, and the caller needs to set it. In the error bar example, it makes modifications to &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;, so this needs to be returned. So the call in [[OnGraphDraw]] will be:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;roleChanges := Plot_error_bars( canv, info, roles, phase, [[SDeviation]](Self) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you make changes to both, your function will need to return two return values, and your caller will use:&lt;br /&gt;
:&amp;lt;code&amp;gt;(continue, roleChanges) := My_annotation_function(....)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wrapping it all up, the Plot_error_bars function becomes:&lt;br /&gt;
 Function Plot_error_bars( canv, info, roles, phase, spread ) :=&lt;br /&gt;
 [[Local]] yRole := roles[ [[GraphingRole]]='Y axis'];&lt;br /&gt;
 [[Local]] yPt := #yRole[ [[GraphFillerInfo]]='Value'];&lt;br /&gt;
 [[Local]] roleChanges := null;&lt;br /&gt;
 &amp;amp;nbsp;&lt;br /&gt;
 [[If]] phase = 2 and yRole[ [[GraphFillerInfo]]='Autoscale' ] [[Then]] (&lt;br /&gt;
 	roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Max'] := MaxAll(yPt+spread);&lt;br /&gt;
 	roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Min'] := MinAll(yPt-spread);&lt;br /&gt;
 ) else if phase=8 then (&lt;br /&gt;
 	[[Local]] ticW:=4, ticH:=0;&lt;br /&gt;
 	[[If]] info[ [[OnGraphDrawItem]]='SwapXY'] [[Then]] ( ticW:=0; ticH:=4 );&lt;br /&gt;
 	[[Local]] xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
 	[[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
 	[[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   	[[Local]] clip := Clip_to_plotArea(canv,info);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xUp,yUp,xDn,yDn);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xUp-ticW,yUp-ticH,xUp+ticW,yUp+ticH);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xDn-ticW,yDn-ticH,xDn+ticW,yDn+ticH);&lt;br /&gt;
 );&lt;br /&gt;
 roleChanges&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Drawing images]]&lt;br /&gt;
* [[:Category:OnGraphDraw annotations library functions|OnGraphDraw annotations library]]&lt;br /&gt;
** [[Plot_error_bars]]&lt;br /&gt;
** [[Plot_point_labels]]&lt;br /&gt;
** [[Plot_Tukey_bars]]&lt;br /&gt;
** [[Plot_solid_prob_bands]]&lt;br /&gt;
** [[Plot_solid_band]]&lt;br /&gt;
* [[:Category:Google Maps from OnGraphDraw library functions|Google Maps from OnGraphDraw library]]&lt;br /&gt;
** [[OnDraw_Google_map]]&lt;br /&gt;
* [[OnGraphDraw/Label Minimum and maximum]] example&lt;br /&gt;
* Index of «info»: [[OnGraphDrawItem]]&lt;br /&gt;
* Indexes of «roles»:  [[GraphingRole]] and [[GraphFillerInfo]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=OnGraphDraw&amp;diff=53352</id>
		<title>OnGraphDraw</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=OnGraphDraw&amp;diff=53352"/>
		<updated>2019-07-26T21:54:50Z</updated>

		<summary type="html">&lt;p&gt;KMullins: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Attributes]]&lt;br /&gt;
{{ReleaseBar}} &lt;br /&gt;
&lt;br /&gt;
This attribute lets you annotate a graph with text, lines, areas, and other graphics -- for example, to add labels to points, or point out interesting aspects of a graph. It even lets you show a map or other image under a graph, and display points over it.   The annotations may depend on the values being graphed and so reposition themselves as the data changes. It also provides a hook where you can enhance graphing functionality (or make use of existing functions that do so) when there is something you want that the built-in graphing engine support.&lt;br /&gt;
&lt;br /&gt;
Two libraries are included with [[Analytica 5.2]] that provide functions for use in the [[OnGraphDraw]] with pre-implemented effects:&lt;br /&gt;
* The [[:Category:OnGraphDraw annotations library functions|OnGraphDraw annotations library]] provides functions for plotting [[Plot_error_bars|error bars]], [[Plot_Tukey_bars|Tukey bars]], [[Plot_point_labels|labels on data points]], [[Plot_solid_band|a filled range behind data]] and [[Plot_solid_prob_bands|filled probability bands]].&lt;br /&gt;
* The [[:Category:Google Maps from OnGraphDraw library functions|Google Maps from OnGraphDraw library]] provides functions for [[OnDraw_Google_map|drawing a Google map]] behind your data (or said differently, for plotting data over a Google map). This library requires [[Analytica Enterprise]] or better.&lt;br /&gt;
&lt;br /&gt;
Additional libraries of functions that perform various types of annotations or graphs may become available over time, and may be contributed by other Analytica users.&lt;br /&gt;
&lt;br /&gt;
{{Release|5.1|5.1|''This feature is '''experimental''' until [[Analytica 5.2]] and may be subject to future non-backward-compatible changes.''}}&lt;br /&gt;
{{Release||5.0|''Requires [[Analytica 5.2]] or later.''}}&lt;br /&gt;
{{Release|5.2||''New to [[Analytica 5.2]]}}&lt;br /&gt;
&lt;br /&gt;
== Attribute OnGraphDraw ==&lt;br /&gt;
&lt;br /&gt;
You can specify an expression in the [[OnGraphDraw]] attribute, which is evaluated while a graph is being drawn. The expression uses [[Drawing images|drawing commands on a Canvas]], which lies under or over the standard graph plot. &lt;br /&gt;
&lt;br /&gt;
You can write code in [[OnGraphDraw]] to draw nearly anything you can dream up, but unless you are a power user, you are more likely to make use of libraries of pre-existing [[User-Defined Functions]] that implement specific plots, embellishments or effects.&lt;br /&gt;
&lt;br /&gt;
[[OnGraphDraw/Label Minimum and maximum|Here is an example]] that finds and labels the minimum and maximum points in a data series:&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_min_and_max.png]]&lt;br /&gt;
&lt;br /&gt;
The graphing engine scaled and drew the axes and plotted the points. The code in the [[OnGraphDraw]] attribute found the min and max  points and drew the annotations. ([[OnGraphDraw/Label Minimum and maximum|See how this was done]]).&lt;br /&gt;
&lt;br /&gt;
In this example, [[OnGraphDraw]] gets a map from Google maps and draws it behind the plotted data. Here the X-Y graph has three data points connected by two lines:&lt;br /&gt;
&lt;br /&gt;
[[Image:onGraphDraw_map.png]]&lt;br /&gt;
&lt;br /&gt;
The [[OnGraphDraw]] expression obtains the map from Google maps using [[ReadFromURL]] -- the map is not served by the graphing engine itself.  The library function [[OnDraw_Google_map]] makes it easy to include graph on a map ([[Analytica Enterprise]] required) -- see [[OnDraw_Google_map]] for instructions.&lt;br /&gt;
&lt;br /&gt;
=== Locals ===&lt;br /&gt;
&lt;br /&gt;
These local variables are accessible within an [[OnGraphDraw]] expression, and give information about the graph and the current graphing roles:&lt;br /&gt;
* '''''canv''''': The canvas. This is what you draw to using the [[Drawing images|canvas drawing functions]].&lt;br /&gt;
* '''''info''''': A vector of information about the graph, such as the dimensions of the graph and location of the plot area. The vector is indexed by the system index [[OnGraphDrawItem]] index.&lt;br /&gt;
* '''''phase''''': The drawing phase. This enables you to detect at what stage of the graph rendering the attribute is being evaluated. Possible values are: 1=Before graphing has started, 2=After the graph layout has been calculated, but before anything is drawn, 4=After the background and axes have been drawn, but before the data is plotted, 8=After the graph has been fully rendered (except for your own embellishments).&lt;br /&gt;
* '''''roles''''': Information about the graphing dimensions that fill each graphing role. This is indexed by [[GraphingRole]] and [[GraphFillerInfo]]. &lt;br /&gt;
* '''''continue''''': A boolean that you can set to false if you don't want the graph to be drawn any further beyond this point. This can be used to substitute your own custom drawing code in place of the built-in graphing engine, which might include totally different graphical depictions.&lt;br /&gt;
* '''''roleChanges''''': It is possible to alter axis scaling by changing items in this local. For example, you may need to adjust the axis range in order to register a map image so that data plotted on top appear at the correct latitude and longitude.&lt;br /&gt;
&lt;br /&gt;
=== When OnGraphDraw is evaluated ===&lt;br /&gt;
&lt;br /&gt;
By default, it evaluates the expression in [[OnGraphDraw]] after rendering the graph data. That's useful when you want to draw the annotations on the graph over the data.  You can also set it to evaluate at three earlier phases of drawing. To set this preference, check the appropriate box in the [[OnGraphDraw]] attribute in the [[Object Window]] of the graphed variable:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw-checkboxes.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Release|5.1|5.1|''Note: These checkboxes are not present in [[Analytica 5.1]], so you need to the system variable [[OnGraphDrawFlags]] to a number equal to the sum of the phase values listed next.''}}&lt;br /&gt;
&lt;br /&gt;
''Note: These check boxes appear in the [[Object window]], but not in the [[Attribute pane]].''&lt;br /&gt;
&lt;br /&gt;
It evaluates [[OnGraphDraw]] during each phase of the graph rendering that you check:&lt;br /&gt;
* 1: '''Evaluate before layout''':  Call before graphing has started, including before determining the layout info, such as the plot area. To replace a graph entirely with a custom graphical depiction of your own, enable this, and set &amp;lt;code&amp;gt;continue:=0&amp;lt;/code&amp;gt; in your [[OnGraphDraw]] code.&lt;br /&gt;
* 2: '''Evaluate before drawing''':  Call after determining the layout, but before drawing anything, so annotations will appear behind any background and axes.&lt;br /&gt;
* 4: '''Evaluate after axes, before data''': Draw annotations after the background and axes, but behind data points, lines or bars.&lt;br /&gt;
* 8 '''Evaluate after fully drawn''' (default) Call after the standard graphing has completed to annotate the graph or data with images in front of the data.&lt;br /&gt;
The check boxes in the object window are stored in the '''OnGraphDrawFlags''' attribute of the graphed object, using a value equal to the sum of the values show for phase.&lt;br /&gt;
&lt;br /&gt;
The local variable &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt; contains one of these values and can be used inside an [[OnGraphDraw]] expression to detect which phase it is. When you select more than one of these options, you should usually include an [[If|If-Then]] branch on the local &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== To access OnGraphDraw ===&lt;br /&gt;
{{Release||5.1|The [[OnGraphDraw]] Attribute is currently an experimental feature.  To make it visible, press F12 to open the [[Typescript Window]], and then type: &amp;lt;code&amp;gt;AskAttribute OnGraphDraw, Variable, yes&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Release|5.2||By default, the [[OnGraphDraw]] attribute does not appear in the [[Attribute pane]] or [[Object window]]. To see it, go to the [[Attributes dialog]] on the [[Object menu]] and enable it for ''Variables''.}}&lt;br /&gt;
&lt;br /&gt;
It will now appear in the [[Attribute panel]] and [[Object window]], where you can give it an Analytica expression.&lt;br /&gt;
&lt;br /&gt;
=== Basics of drawing ===&lt;br /&gt;
To draw on the graph surface, use the [[Drawing images|Canvas drawing functions]] to draw to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt; is the name of a local variable available to you in the [[OnGraphDraw]] attribute. For example:&lt;br /&gt;
&lt;br /&gt;
:'''OnGraphDraw:''' &amp;lt;code&amp;gt;[[CanvasDrawRectangle]]( canv, x:100, y:130, width:80, height:50, fillColor:0x440000ff )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_rect1.png]]&lt;br /&gt;
&lt;br /&gt;
This rectangle always appears at the same location, and doesn't adapt when the graph window is resized; therefore, its location does not necessarily coincide with any particular data, unless by chance. The difficult part is writing code that figures out where to draw. The plot area in canvas pixel coordinates is provided in the local variable named &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; as illustrated here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
|'''OnGraphDraw:''' || [[CanvasDrawEllipse]](canv, || x:info[OnGraphDrawItem='PlotAreaLeft'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || y:info[OnGraphDrawItem='PlotAreaTop'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || width: info[OnGraphDrawItem='PlotAreaWidth'], &lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || height: info[OnGraphDrawItem='PlotAreaHeight'],&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp; || &amp;amp;nbsp; || fillColor:0x440000ff )&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_plotArea.png]]&lt;br /&gt;
&lt;br /&gt;
The y-axis scale goes from &amp;lt;code&amp;gt;roles[GraphingRole='Y axis', GraphFillerInfo='Min']&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;roles[GraphingRole='Y axis', GraphFillerInfo='Max']&amp;lt;/code&amp;gt;. So to annotate a threshold at y=1000, you could use this [[OnGraphDraw]] expression&lt;br /&gt;
&lt;br /&gt;
 [[image:OnGraphDraw_afterFullyDrawn.png]]&lt;br /&gt;
 [[Local]] yThresh := 1000;&lt;br /&gt;
 [[Local]] (ignore,y) := [[GraphToCanvasCoord]](info,roles,0,yThresh);&lt;br /&gt;
 [[Local]] x1 := info[OnGraphDrawItem='PlotAreaLeft'];&lt;br /&gt;
 [[Local]] x2 := info[OnGraphDrawItem='PlotAreaWidth'] + x1;&lt;br /&gt;
 [[CanvasDrawLine]]( canv, x1,y, x2, y, color:'Green', width:3);&lt;br /&gt;
 [[CanvasDrawText]](canv, &amp;quot;Threshold&amp;quot;, x1, y, color:'Green', vAlign:'Bottom')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:onGraphDraw_threshold.png]]&lt;br /&gt;
&lt;br /&gt;
=== Replacing the plot entirely, but using the same axes ===&lt;br /&gt;
A probability bands graph plot is normally draw with lines, such as:&lt;br /&gt;
:[[image:OnGraphDraw_OriginalBandsPlot.png|533px]]&lt;br /&gt;
&lt;br /&gt;
By using [[OnGraphDraw]], we can retain the axes and axes scaling, but replace the plot itself with custom-drawn Tukey bars:&lt;br /&gt;
:[[image:OnGraphDraw TukeyBands.png|533px]]&lt;br /&gt;
&lt;br /&gt;
In this case, the [[OnGraphDraw]] will be set as follows&lt;br /&gt;
:[[image:OnGraphDraw_TukeyBandsCall.png]]&lt;br /&gt;
Two key things are happening here. First, it is evaluated after the axes are drawn but before the data is drawn, and second, it sets the local &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; to false if it draws the Tukey bars. The pre-existing [[UDF]] &amp;lt;code&amp;gt;Tukey_bars&amp;lt;/code&amp;gt; returns true when it draws the bars, false otherwise. The function has a line that checks whether you are viewing the Bands view, so that other uncertainty views continue to render in their default fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::[[If]] info[OnGraphDrawItem='ViewMode']&amp;lt;&amp;gt;'Bands' [[Then]] ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The key is also turned off in graph setup, since the colors shown in the key no longer apply.&lt;br /&gt;
&lt;br /&gt;
=== Clipping to the plot area ===&lt;br /&gt;
&lt;br /&gt;
When you draw to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;, you can draw on any part of the graph. So if you aren't careful, annotations that you expect to draw on the data may extend outside of the plot area (the area bounded by the axes). In some cases this may be what you want, but in other cases you may want to clip to the plot area.&lt;br /&gt;
&lt;br /&gt;
In this example, error bars are draw around the mean value points without any clipping. It does not look natural for these bars to extend outside of the plot area.&lt;br /&gt;
&lt;br /&gt;
 '''OnGraphDraw:'''  { simplistic version }&lt;br /&gt;
   [[Local]] spread := SDeviation(Self);&lt;br /&gt;
   [[Local]] xPt := #roles[GraphingRole='X axis', GraphFillerInfo='Value'];&lt;br /&gt;
   [[Local]] yPt := #roles[GraphingRole='Y axis', GraphFillerInfo='Value'];&lt;br /&gt;
   [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
   [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xUp,yUp,xDn,yDn);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
   [[CanvasDrawLine]](canv,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsNoClip.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this, you can draw to a [[CanvasContext|canvas context]] that has been clipped to the plot area, rather than drawing directly to &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;. The above code is modified as follows, where &amp;lt;code&amp;gt;clip&amp;lt;/code&amp;gt; is a clipped canvas context:&lt;br /&gt;
&lt;br /&gt;
 '''OnGraphDraw:'''  { still simplistic, but with clipping }&lt;br /&gt;
   [[Local]] spread := SDeviation(Self);&lt;br /&gt;
   [[Local]] xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
   [[Local]] yPt := #roles[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
   [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
   [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   &amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;[[Local]] clip := Clip_to_PlotArea(canv, info);&amp;lt;/span&amp;gt;&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xUp,yUp,xDn,yDn);&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
   [[CanvasDrawLine]](&amp;lt;span style=&amp;quot;background:yellow&amp;quot;&amp;gt;clip&amp;lt;/span&amp;gt;,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsWithClip.png]]&lt;br /&gt;
&lt;br /&gt;
where the Clip_to_plotArea is a [[User-Defined Function]] that returns a canvas context clipped to the plot area. It is implemented as follows:&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;code&amp;gt;Clip_to_plotArea(canv,info) :=&lt;br /&gt;
:[[Local]] (x,y,w,h) := _(...info[ [[OnGraphDrawItem]]='PlotArea'&amp;amp;['Left','Top','Width','Height'] ]);&lt;br /&gt;
:[[CanvasContext]](canv, clip:x,y,w,h)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the axis scale ===&lt;br /&gt;
&lt;br /&gt;
The graphing engine selects the axis scale based on the data, and it does not know about stuff that you draw. In same cases you may need to adjust the axis scales so that the range includes your annotations. This section will illustrate one example where this comes up -- when drawing error bars around a point, the range of the error bars around mean-value points extend outside of the range of the plotted mean points. At least when the axis is auto-scaled, you need to extend the min and max data points. Another example occurs when rendering a Google map behind the data. You need to adjust the actual min and max latitude and longitude to the map actually returned by the Google server, even when your axes are manually scaled.&lt;br /&gt;
&lt;br /&gt;
Changes to the scale must occur in the &amp;quot;before drawing&amp;quot; phase, so you need to enable evaluation of [[OnGraphDraw]] before drawing (as well as in the phase when you will actually render your annotations). During the before drawing phase, phase=2, your code needs to make modifications to the local variable &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;, which the rendering engine will then use while drawing the axes in the next phase.&lt;br /&gt;
&lt;br /&gt;
The relevant addition for rescaling is highlighted. This part occurs during phase=2, whereas the remaining previous code is not in the else (not phase 2). The key point is that in phase=2, it modifies the min and max to include the extrema of the error bars.&lt;br /&gt;
&lt;br /&gt;
 [[image:OnGraphDraw_PhaseBeforeAxes_and_after.png]]&lt;br /&gt;
 [[Local]] spread := [[SDeviation]](Self);&lt;br /&gt;
 [[Local]] yRole := roles[ [[GraphingRole]]='Y axis' ];&lt;br /&gt;
 [[Local]] yPt := #yRole[ [[GraphFillerInfo]]='Value' ];&lt;br /&gt;
 &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;[[If]] phase = 2 and yRole[ [[GraphFillerInfo]]='Autoscale'] [[Then]] (&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Max' ] := MaxAll(yPt+spread);&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Min' ] := MinAll(yPt-spread);&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;background:lightyellow&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt; Else (&lt;br /&gt;
      [[Local[[ xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value' ];&lt;br /&gt;
      [[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
      [[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
      [[Local]] clip := Clip_to_plotArea(canv,info);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xUp,yUp,xDn,yDn);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xUp-4,yUp,xUp+4,yUp);&lt;br /&gt;
      [[CanvasDrawLine]](clip,xDn-4,yDn,xDn+4,yDn)&lt;br /&gt;
 )&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsWithAdjustedYScale.png]]&lt;br /&gt;
&lt;br /&gt;
=== Adapting to Swap XY ===&lt;br /&gt;
&lt;br /&gt;
The error bar example so far has a problem when you Swap XY. Can you spot it:&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsSwapXY_bad.png]]&lt;br /&gt;
The problem has to do with the way we draw the caps at the end of each error bar. They are still being drawn horizontally, but now need to be drawn vertically. Here the code that draws one of those ticks:&lt;br /&gt;
:&amp;lt;code&amp;gt;[[CanvasDrawLine]](clip,xDn-4,yDn,xDn+4,yDn)&amp;lt;/code&amp;gt;&lt;br /&gt;
It draws a line from 4 pixels left of the bar end to 4 pixels right of the bar end. When we've swapped XY, we effectively want instead&lt;br /&gt;
:&amp;lt;code&amp;gt;[[CanvasDrawLine]](clip,xDn,yDn-4,xDn,yDn+4)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following addition accomplishes this (unchanged lines not shown):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[Local]] ticW:=4, ticH:=0;&lt;br /&gt;
:[[If]] info[ [[OnGraphDrawItem]]='SwapXY'] [[Then]] ( ticW:=0; ticH:=4 );&lt;br /&gt;
:...&lt;br /&gt;
:[[CanvasDrawLine]](clip,xUp-ticW,yUp-ticH,xUp+ticW,yUp+ticH);&lt;br /&gt;
:[[CanvasDrawLine]](clip,xDn-ticW,yDn-ticH,xDn+ticW,yDn+ticH);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:OnGraphDraw_ErrorBarsSwapXY.png]]&lt;br /&gt;
&lt;br /&gt;
=== Encapsulating drawing code === &lt;br /&gt;
You may want to show error bars for a different variable. You don't want to repeat all this code every time, and of course, if you later make a bug fix or improvement, you'll want all your plots to inherit that fix. Hence, you should encapsulate this code as a [[User-Defined Function]]. Once you do this, when new variables want error bars, you'll just need to call your UDF from [[OnGraphDraw]] AND you'll need make sure to check the correct check boxes to specify when it is evaluated. &lt;br /&gt;
&lt;br /&gt;
Encapsulating tends to be easy. You're function parameters are whichever of the special local variables (including possibly Self) that your code used. You have some choices about how you want to encapsulate it. For example, do you want your error bar function to only operate from Mean result view? Or do you want to let your caller decide? Do you want to always depict one standard deviation, or do you want your caller to specify the spread? &lt;br /&gt;
&lt;br /&gt;
When your logic changes the &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt; variable, then your function will need to return the new value, and the caller needs to set it. In the error bar example, it makes modifications to &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;, so this needs to be returned. So the call in [[OnGraphDraw]] will be:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;roleChanges := Plot_error_bars( canv, info, roles, phase, [[SDeviation]](Self) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you make changes to both, your function will need to return two return values, and your caller will use:&lt;br /&gt;
:&amp;lt;code&amp;gt;(continue, roleChanges) := My_annotation_function(....)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wrapping it all up, the Plot_error_bars function becomes:&lt;br /&gt;
 Function Plot_error_bars( canv, info, roles, phase, spread ) :=&lt;br /&gt;
 [[Local]] yRole := roles[ [[GraphingRole]]='Y axis'];&lt;br /&gt;
 [[Local]] yPt := #yRole[ [[GraphFillerInfo]]='Value'];&lt;br /&gt;
 [[Local]] roleChanges := null;&lt;br /&gt;
 &amp;amp;nbsp;&lt;br /&gt;
 [[If]] phase = 2 and yRole[ [[GraphFillerInfo]]='Autoscale' ] [[Then]] (&lt;br /&gt;
 	roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Max'] := MaxAll(yPt+spread);&lt;br /&gt;
 	roleChanges[ [[GraphingRole]]='Y axis', [[GraphFillerInfo]]='Min'] := MinAll(yPt-spread);&lt;br /&gt;
 ) else if phase=8 then (&lt;br /&gt;
 	[[Local]] ticW:=4, ticH:=0;&lt;br /&gt;
 	[[If]] info[ [[OnGraphDrawItem]]='SwapXY'] [[Then]] ( ticW:=0; ticH:=4 );&lt;br /&gt;
 	[[Local]] xPt := #roles[ [[GraphingRole]]='X axis', [[GraphFillerInfo]]='Value'];&lt;br /&gt;
 	[[Local]] (xUp,yUp) := [[GraphToCanvasCoord]](info,roles,xPt,yPt+spread); &lt;br /&gt;
 	[[Local]] (xDn,yDn) := [[GraphToCanvasCoord]](info,roles,xPt,yPt-spread);&lt;br /&gt;
   	[[Local]] clip := Clip_to_plotArea(canv,info);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xUp,yUp,xDn,yDn);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xUp-ticW,yUp-ticH,xUp+ticW,yUp+ticH);&lt;br /&gt;
 	[[CanvasDrawLine]](clip,xDn-ticW,yDn-ticH,xDn+ticW,yDn+ticH);&lt;br /&gt;
 );&lt;br /&gt;
 roleChanges&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Drawing images]]&lt;br /&gt;
* [[:Category:OnGraphDraw annotations library functions|OnGraphDraw annotations library]]&lt;br /&gt;
** [[Plot_error_bars]]&lt;br /&gt;
** &amp;lt;nowiki&amp;gt;[[Plot_point_labels]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** [[Plot_Tukey_bars]]&lt;br /&gt;
** [[Plot_solid_prob_bands]]&lt;br /&gt;
** [[Plot_solid_band]]&lt;br /&gt;
* [[:Category:Google Maps from OnGraphDraw library functions|Google Maps from OnGraphDraw library]]&lt;br /&gt;
** [[OnDraw_Google_map]]&lt;br /&gt;
* [[OnGraphDraw/Label Minimum and maximum]] example&lt;br /&gt;
* Index of «info»: [[OnGraphDrawItem]]&lt;br /&gt;
* Indexes of «roles»:  [[GraphingRole]] and [[GraphFillerInfo]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Open_a_model_to_browse&amp;diff=53351</id>
		<title>Tutorial: Open a model to browse</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Open_a_model_to_browse&amp;diff=53351"/>
		<updated>2019-07-26T17:40:53Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category: Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to open and explore an example Analytica model: The '''Rent vs. Buy model''' compares the total cost of renting a house to the cost of buying one.  &lt;br /&gt;
&lt;br /&gt;
You can start by viewing this video, or jump straight into starting up the model in Analytica. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/GQV0dnDN0Q0&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Video:''' [https://youtu.be/GQV0dnDN0Q0 Tutorial: Open a model to browse] (7 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Open the Rent vs. Buy model==&lt;br /&gt;
To begin, follow these steps.&lt;br /&gt;
# You start Analytica like any Windows application: For example, click the '''Start''' button on the Windows taskbar. Click '''All Programs''' &amp;amp;rarr; '''Analytica {{#svarget:anarelease|4.6}}''' &amp;amp;rarr; '''Analytica {{#svarget:anarelease|4.6}}'''. &amp;lt;br&amp;gt;{{Release||4.6|[[File:Chapter 1.1.png|300px]]}}{{Release|5.0||[[File:Launch Ana5.0 from Start Menu.png|300px]]}}&lt;br /&gt;
# After Analytica starts, {{Release||4.6|&lt;br /&gt;
select '''File''' &amp;amp;rarr; '''Open''' from the menu.&lt;br /&gt;
# &amp;lt;br&amp;gt; [[File:Chapter 1.2a.png]]&lt;br /&gt;
# Open the Rent vs. Buy model. &amp;lt;br&amp;gt; [[File:Chapter 1.2b.png]] &amp;lt;br&amp;gt; Analytica reads in the Rent vs. Buy model.&lt;br /&gt;
}}{{Release|5.0||&lt;br /&gt;
select the ''Rent vs. Buy Example'' on the [[Intro screen]].&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Open Buy vs Rent Example.png]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Diagram window==&lt;br /&gt;
When you open a model, Analytica first displays a top-level [[Diagram window]]. The ''Rent vs. Buy'' model diagram shows several input variables that affect the trade-offs between renting and buying, '''Normal''' buttons, a '''Calc''' button, and a node labeled Model.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.3.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Normal buttons|Type=Bare|v=130|pt=215,129|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
User input buttons |Type=Bare|v=170|pt=518,175|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Model node|Type=Bare|v=200|pt=246,210|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Calc button to see results|Type=Bare|v=268|pt=412,262|path=r-}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This top-level diagram is an end-user interface to the model itself, which is contained in the Model node. In this chapter, you use only the interface in this top level diagram; in the following chapters you will explore the model in more depth.&lt;br /&gt;
&lt;br /&gt;
Across the top of the screen is a [[toolbar|horizontal palette of buttons]]. This is called the '''''tools palette'''''.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 1.4.png]]}}&lt;br /&gt;
{{Release|5.0||&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:BrowseToolOnToolbar5.0.png]]|&lt;br /&gt;
{{CalloutAnnotation|The browse tool|Type=Bare|v=10|pt=267,33|path=bD20-}}}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When you first open the ''Rent vs. Buy'' model, the '''browse tool''' is highlighted on the palette. With the browse tool selected, the cursor looks like a hand [[File:Chapter 1.5.png]]	when it is over the diagram. The browse tool allows you to calculate the model, change input values, and examine — but not change — the structure of the model. In this chapter, you only use the browse tool.&lt;br /&gt;
&lt;br /&gt;
==Access Help Resources==&lt;br /&gt;
&lt;br /&gt;
At any time, you can press the ''F1'' key on the keyboard or use the '''Help'''  menu to access Analytica’s help resources online. This menu includes links to  this [[Analytica Tutorial|Tutorial], the [[Analytica User Guide|User Guide]] and much more tips and reference material on this [[Analytica Wiki]].  &lt;br /&gt;
&lt;br /&gt;
==Compute output values==&lt;br /&gt;
&lt;br /&gt;
In the ''Rent vs. Buy'' model, the output value of interest is at the bottom, ''Present value of buying and renting''.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.3.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compare the present value of buying and renting.|v=200|pt=413,265|path=bD20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The output value displays in a [[Result window]]. This '''Result''' window shows a graph of two '''''probability density''''' curves, one for buying and one for renting. In a probability density graph, the units of the vertical scale are chosen so that the total area under each curve is 1 (100%). 25μ corresponds to 25 x 10-6 or 0.000025.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;Numerical suffixes like μ and K are used extensively throughout Analytica. A quick reference for these suffixes is given in [[Number formats]] .&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.7.png]]&lt;br /&gt;
&lt;br /&gt;
Since the graph is of probability densities, both buying and renting have probabilistic, or uncertain, inputs. The probability density graph for each appear to be bell-shaped curves ([[normal]] distribution), although they appear a bit “noisy.”&lt;br /&gt;
&lt;br /&gt;
The graphs show that the cost of renting, given the model’s inputs, are between about $105,000 and $155,000 (the negative numbers mean cost — cash flowing out), while the cost of buying is between $115,000 and a gain of $75,000.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.8.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Diagram''' window to bring it to the front.|v=20|pt=60,220|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''''Note''': Your results can vary slightly, since the model is generating random inputs based on a normal distribution for the uncertainty of the rate of inflation and for the appreciation rate.''&lt;br /&gt;
&lt;br /&gt;
Click the model [[Diagram window]] to bring it to the front. Notice that the button next to ''Costs of buying and renting'' has changed to '''Result'''. The '''Result''' button indicates that the value has been computed; clicking the '''Result''' button re-displays the computed values.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.9.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
The '''Calc''' button has changed to '''Result'''.|Type=Bare|v=220|pt=413,265|path=bD20-}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Change input values and recompute results==&lt;br /&gt;
&lt;br /&gt;
Now you will change some input values to the model and recompute the rent vs. buy comparison. You will change the values of ''Time horizon'', ''Monthly rent'', and ''Buying price''.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.9.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Time horizon''. Change the value to '''''7''''' and press ''Alt+Enter''.|v=50|pt=220,64|path=tU20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;The main Enter key and the numeric keypad Enter key are not interchangeable. They have different functions in Analytica. Alt+Enter is equivalent to the numeric keypad Enter key.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As soon as you change an input, the '''Result''' button changes to a '''Calc''' button, indicating that ''Present value of buying and renting'' needs to be recomputed.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.10.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Monthly rent''. Change the value to '''''1400''''' and press ''Alt+Enter''.|v=170|pt=220,171|path=r-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.11.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Buying price''. Change the value to '''''180K''''' (or 180000) and press ''Alt+Enter''.|v=130|pt=510,65|path=tU100-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now you are ready to recompute to see the new results. &lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.12.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compute the comparison of the costs of buying to renting.|v=140|pt=413,265|path=bD20-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The graphs show that the cost of renting, given these changed inputs, is between $90,000 and $120,000, while the cost of buying is between $135,000 and a gain of $70,000.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.13.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Diagram''' window to bring it to the front.|v=140|pt=127,386|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Examine and change an uncertain input==&lt;br /&gt;
When an input is defined as a probability distribution, a button with the name of the distribution appears next to the input’s name. Clicking this button opens the [[Object Finder dialog|Object Finder]] window, in which you can see details and change the distribution’s parameters or type of distribution.&lt;br /&gt;
&lt;br /&gt;
''Rate of inflation''’s button says '''Normal''', indicating that it is defined as a normal distribution.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.12.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Normal''' button next to the ''Rate of inflation''.|v=90|pt=218,134|path=bD20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The [[Object Finder dialog|Object Finder]] window appears. It shows that ''Rate of inflation'' is defined as a normal distribution with a '''''mean''''' of 3.5 and a '''''standard deviation''''' of 1.3.&lt;br /&gt;
&lt;br /&gt;
You will now modify the probability distribution that defines ''Rate of inflation''. Rather than using the normal distribution, you will use the uniform distribution, and assume that inflation has an equal probability of being anywhere between 3% and 4% per year.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.15.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Scroll down the list of distributions and select '''Uniform'''|v=80|pt=0,200|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.16.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Change the minimum to '''''3'''''.|v=205|pt=222,248|path=r-|n=+}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Change the maximum to '''''4'''''.|v=290|pt=330,268|path=tU10/|n=+}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click '''OK''' to accept the change.|v=480|pt=537,481|path=r-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.17.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compute the new comparison of the present value of buying to renting.|v=140|pt=413,265|path=bD20-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.18.png]]&lt;br /&gt;
&lt;br /&gt;
The graphs show that the uncertainty in the cost of renting has narrowed to between about $105,000 and $109,000, while the uncertainty in the cost of buying has flattened to between about $125,000 and a gain of $10,000.&lt;br /&gt;
&lt;br /&gt;
==Display alternative uncertainty views==&lt;br /&gt;
&lt;br /&gt;
Analytica offers a variety of views to display uncertain values, including selected statistics, [[Statistical_Functions_and_Importance_Weighting#ProbBands|probability bands]], the [[Uncertainty_Setup_dialog#Probability_density_option|probability density]] function, the [[Uncertainty_Setup_dialog#Cumulative_probability_option|cumulative probability]] distribution function, measures of central tendency, and the table of random numbers from which the uncertain distribution is estimated.&lt;br /&gt;
&lt;br /&gt;
You will now examine several of these views.&lt;br /&gt;
&lt;br /&gt;
In the upper-left corner of the [[Result window]] is the [[Uncertainty view of a result|Uncertainty View]] popup menu.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.19.png]]&lt;br /&gt;
&lt;br /&gt;
The miniature probability distribution [[File:Chapter 1.20.png]] indicates that '''''Probability Density''''' is selected.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.21.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now shows two cumulative probability curves. Along the vertical axis, these curves give the probability that each cost is less than a given value along the horizontal axis.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.22.png]]&lt;br /&gt;
&lt;br /&gt;
There appears to be about a 50% probability that the cost to buy is below $70,000, while the cost to rent has a 50% probability of being below about $110,000.&lt;br /&gt;
&lt;br /&gt;
Sometimes you might want to see an uncertain value expressed as a single number — a measure of central tendency. Analytica computes the [[mid]] value (sometimes called the '''''deterministic value''''') by fixing all input probability distributions at their [[median]] (50% probability) values. The mid value is the only uncertainty view available for nonprobabilistic results.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.23.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now displays bar graphs for the two mid values.&lt;br /&gt;
&lt;br /&gt;
Under the [[Uncertainty view of a result|Uncertainty View]] popup menu are two buttons, [[File:Chapter 1.23.2.png]] and [[File:Chapter 1.23.3.png]]. The [[File:Chapter 1.23.3.png]] is highlighted, indicating that the '''Result''' window is displaying a [[Graph view of a result|graph view]]. The '''Result''' window can also display numeric values in a spreadsheet-like table view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.24.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica also provides the [[mean]] (or average) value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.25.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.25.2.png]]&lt;br /&gt;
&lt;br /&gt;
You can also view a set of [[statistics]], including both the [[median]] and [[mean]], the ranges ([[Functions Min and Max|minimum and maximum]]), and the [[Sdeviation|standard deviation]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.26.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now displays the minimum, median&amp;lt;ref&amp;gt;Note that the median value is slightly different from the mid value. The mid value is composed of non- probabilistic results generated by using the median value for each input. The median value is calculated using probabilistic inputs and taking the median of the resulting distribution.&amp;lt;/ref&amp;gt;, mean, maximum, and standard deviation for ''Costs of buying and renting''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.27.png]]&lt;br /&gt;
&lt;br /&gt;
The statistics might not be exact, because they are estimated from a sample of values from the distribution.&lt;br /&gt;
&lt;br /&gt;
Finally, you see the [[sample]] values.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.28.png]]&lt;br /&gt;
&lt;br /&gt;
The table above lists the 100 sample values that Analytica randomly generated from the probability distribution to estimate the [[statistics]].&lt;br /&gt;
&lt;br /&gt;
A [[SampleSize|sample size]] of 100 is adequate for most applications; however, if you need more precise estimates, you can increase the [[SampleSize|sample size]]. See [[Uncertainty Setup dialog]] in the [[Analytica User Guide]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.29.png]]&lt;br /&gt;
&lt;br /&gt;
==Save your model==  &lt;br /&gt;
If you want to save changes to your model, you can do so at this point. (For instructions on quitting without saving, see the next section.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.30.png]]&lt;br /&gt;
&lt;br /&gt;
If you wish to save your model as a different file, so that you do not change the original model, select '''Save As''' from the [[File menu]].&lt;br /&gt;
&lt;br /&gt;
==Quit Analytica==&lt;br /&gt;
When you have finished using a model, you might want to quit Analytica.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.33.png]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
You have now opened an Analytica model,  calculated and viewed the results, changes input values and probability distributions, and displayed the uncertain results in several ways. These are the basic techniques for using any quantitative model.&lt;br /&gt;
&lt;br /&gt;
After you create your own models, you might want to give them a top-level input and output diagram like the one used in this chapter. For information about customizing a model for end users, see [[Creating Interfaces for End Users]] in the [[Analytica User Guide]]. &lt;br /&gt;
&lt;br /&gt;
The next Tutorial page, shows how to navigate the details of the Rent vs. Buy model, exploring its structure and contents.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]  &lt;br /&gt;
* [https://www.youtube.com/watch?v=GQV0dnDN0Q0 Using the Rent vs. Buy Model] (an explanatory video on YouTube)&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
* [[To open or exit a model]]&lt;br /&gt;
* [[Create and save a model]]&lt;br /&gt;
* [[Tutorial: Create a model]]&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Help menu and documentation]]&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[Expressing Uncertainty]]&lt;br /&gt;
* [[Uncertainty Setup dialog]]&lt;br /&gt;
* [[Uncertainty view of a result]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;About Analytica/ {{PAGENAME}} / Tutorial: Reviewing a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiTable&amp;diff=53350</id>
		<title>MultiTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiTable&amp;diff=53350"/>
		<updated>2019-07-25T23:59:38Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Add link to MultiTable and SubTable tutorial video on YouTube&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:User-interface functions]]&lt;br /&gt;
[[category:Top level functions]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MultiTable(i1,i2,...)(src1, src2, ...) ==&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] lets you mix editable and computed values in a single table. Editable cells are based on other variables, each defined as a [[Table]] or [[SubTable]]. Computed values are based on calculated variables or expressions.  When you change an editable cell, you are actually changing the original cell in the source table, not a copy.&lt;br /&gt;
&lt;br /&gt;
It is best practice in Analytica to keep different editable user inputs and computed results in different variables. But, it is often convenient to define part of a user interface that combines editable and computed values, which the [[MultiTable]] lets you do.&lt;br /&gt;
&lt;br /&gt;
For example, suppose &amp;lt;code&amp;gt;Startup_cost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Prob_success&amp;lt;/code&amp;gt; are both edit tables, indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;.  Then the a variable defined as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Project_inputs := MultiTable(Item)(Startup_cost, Prob_success)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lets you view and edit both Startup_cost and Prob_Success in the same edit table. The [[MultiTable]] is indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;, the index common to both Startup_cost and Prob_success, and by &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt;, which is an additional index that needs to be created. &lt;br /&gt;
&lt;br /&gt;
[[MultiTable]] is the inverse of [[SubTable]] in that it combines multiple sources into one view, where [[SubTable]] selects a particular slice or subset of data to edit.&lt;br /&gt;
&lt;br /&gt;
== Creating a MultiTable ==&lt;br /&gt;
&lt;br /&gt;
Before you create a [[MultiTable]], you need to create or identify one or more indexes that your data sources will vary over. For example, if you want a different data source to appear in each column of your table, then you'll need a column index, and you'll need to fill in the labels for each column as you define the index.&lt;br /&gt;
&lt;br /&gt;
Next, create a variable to hold your [[MultiTable]] and press ''Ctrl+E'' to place your cursor in the definition field.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create1.png]]&lt;br /&gt;
&lt;br /&gt;
In the '''Object Finder''', select the '''Array''' library and scroll down to find and select [[MultiTable]]. Then, press the '''Indexes''' button.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create2.png]]&lt;br /&gt;
&lt;br /&gt;
Select the indexes that your [[MultiTable]] data sources will vary along. These are not the indexes of your data sources themselves.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create3.png]]&lt;br /&gt;
&lt;br /&gt;
The table initially displays the &amp;quot;Meta expressions&amp;quot; view so that you can specify the data sources for the table. The ''meta-expression selector'' controls which view you are in. &lt;br /&gt;
&lt;br /&gt;
== Specifying Data Sources ==&lt;br /&gt;
&lt;br /&gt;
Whenever you need to specify or change which data source should appear in a [[MultiTable]], use the ''meta-expressions selector'' to change to '''meta-expressions view'''. &lt;br /&gt;
&lt;br /&gt;
Here is an example of meta-expressions.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create4.png]]&lt;br /&gt;
&lt;br /&gt;
In the above meta-expressions view, &amp;lt;code&amp;gt;Option_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Stock_symbol&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Strike_price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Expiration_date&amp;lt;/code&amp;gt; are identifiers of other edit tables. These will be editable columns. &amp;lt;code&amp;gt;Stock_price_lookup(Stock_Symbol)&amp;lt;/code&amp;gt; is a call to a [[User-Defined Function]], and its computed value will appear in this column. The last cell contains &amp;lt;code&amp;gt;Mid(Contract_valuation)&amp;lt;/code&amp;gt;, so that the computed mid-value of &amp;lt;code&amp;gt;Contract_valuation&amp;lt;/code&amp;gt; will be displayed. When you want the computed value of a variable, you must surround its identifier with [[Mid]] in this fashion, otherwise its definition will appear in the cell and will be editable.&lt;br /&gt;
&lt;br /&gt;
=== Editable sources ===&lt;br /&gt;
&lt;br /&gt;
An editable source reflects the contents of another edit table in your model, a [[slice]] of an edit table, or the [[definition]] of another variable. When a user edits these cells in the multitable, they are actually changing the data in the specified source definition or table. In meta-expression view, an editable source is specified in one of the following ways.&lt;br /&gt;
* &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; : An identifier. The definition of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, or the [[Table|edit table]] (or [[SubTable]] or [[MultiTable]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;) is depicted.&lt;br /&gt;
* &amp;lt;code&amp;gt;X[I=v]&amp;lt;/code&amp;gt; : A [[Slice]] or [[Subscript]] of another table. That slice is depicted in an editable form.&lt;br /&gt;
&lt;br /&gt;
The source can be a scalar variable, an [[Table|edit table]], a [[SubTable]] or another [[MultiTable]]. Rather arbitrary transformations that be accomplished by nesting SubTables and MultiTables.&lt;br /&gt;
&lt;br /&gt;
=== Computed sources ===&lt;br /&gt;
&lt;br /&gt;
The following are computed expressions, which are evaluated and the resulting value displayed in a non-editable form with a gray background.&lt;br /&gt;
* &amp;lt;code&amp;gt;31.4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;Text&amp;quot;&amp;lt;/code&amp;gt;: Literal values (numbers, quoted text)&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;: Displays the computed mid-value of the variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;F(...)&amp;lt;/code&amp;gt;: Any function call other than [[Slice]] or [[Subscript]], including calls to [[User-Defined Function]]s, are evaluated.&lt;br /&gt;
* &amp;lt;code&amp;gt;x + y&amp;lt;/code&amp;gt; : An expression, such as one involving arithmetic operations, is evaluated.&lt;br /&gt;
&lt;br /&gt;
Here are a few additional examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;  : ''computes and displays the [[mid]]-value of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Abs(X)&amp;lt;/code&amp;gt; : ''displays the [[Abs|absolute value]] of the (mid-value) of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Mean(X)&amp;lt;/code&amp;gt; : ''computes and displays the [[mean]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;1.2&amp;lt;/code&amp;gt; : ''displays the number, 1.2, in a non-editable cell''&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;Some text&amp;quot;&amp;lt;/code&amp;gt; : ''displays the text, without quotes, in a non-editable cell&lt;br /&gt;
&lt;br /&gt;
A computed expression or computed variable CAN depend on the values of other data sources that appear in the same [[MultiTable]]. When you do this, the computed value will change when the user changes the input cells and presses the green check button.&lt;br /&gt;
&lt;br /&gt;
== Viewing the Data ==&lt;br /&gt;
&lt;br /&gt;
After you have specified the data sources in meta-expression view, change the '''meta-expression selector''' to '''Show Cells''' to see the actual data.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create5.png]]&lt;br /&gt;
&lt;br /&gt;
=== When cells can be edited ===&lt;br /&gt;
&lt;br /&gt;
You can never edit computed values in a [[MultiTable]] &lt;br /&gt;
&lt;br /&gt;
In [[Browse mode]], you can edit data in a variable only if the variable has a [[user input node]].  This means that if your [[MultiTable]] variable has a user input node, users in [[Browse mode]] (including [[Analytica Cloud Player]] or [[Free Edition|Analytica Free 101]]) can edit all table sources.  Otherwise, if one source has a user input node and another does not, users in [[Browse mode]] can edit only those cells from the source(s) with the user in.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of an editable value and computed value in the same table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background:white; border:white; margin-left: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
 Index Base := [&amp;quot;Decimal&amp;quot;, &amp;quot;Hex&amp;quot;]&lt;br /&gt;
 Variable x := 123&lt;br /&gt;
 Variable HexConverter := MultiTable(Base)(x, NumberToText(x, &amp;quot;Hexadecimal&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The edit table displays like this:&lt;br /&gt;
&lt;br /&gt;
:[[image:HexConverter.png]]&lt;br /&gt;
&lt;br /&gt;
The first cell can be edited, and when you change it and press the green check, the [[Binary and hexadecimal integer formats|hexadecimal]] value is computed and displayed.&lt;br /&gt;
&lt;br /&gt;
== Dimensionality ==&lt;br /&gt;
&lt;br /&gt;
The dimensions of the [[MultiTable]] content are the union of the indexes from all sources and of the [[MultiTable]] index(es).&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] works best when your sources all have the same dimensionality.  When one source does not have an index present in another source, a single cell in the source will map to multiple cells in the [[MultiTable]]; hence, you'll see the same value multiple places, and when you change it, multiple cells will change.  The source retains its original dimensionality, so if the value doesn't vary along an index in the source, it won't vary along that index is the [[MultiTable]].  You may temporarily see a difference in these cells after you first enter a value, but they will become consistent as soon as you press the Green check.&lt;br /&gt;
&lt;br /&gt;
== Number Formats ==&lt;br /&gt;
&lt;br /&gt;
When number formats are set for the source tables, those formats are used in the corresponding column of the MultiTable.&lt;br /&gt;
&lt;br /&gt;
When a meta-expression is of the form &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;'s number format is used. For arbitrary expressions, the number format of the [[MultiTable]]'s own variable is used.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Introduced in [[Analytica 4.6]].  Present in experimental form in [[Analytica 4.5]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* MultiTable and SubTable [https://www.youtube.com/watch?v=q2zqbgsPPBk video tutorial]&lt;br /&gt;
* [[Tutorial: Arrays]]&lt;br /&gt;
* [[Arrays and Indexes]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[Mid]], [[Mean]], [[Sample]] -- used for specifying computed results.&lt;br /&gt;
* [[Subscript]], [[Slice]], [[Subscript/Slice Operator]]&lt;br /&gt;
* [[Objects and Values]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=EvaluateScript&amp;diff=53295</id>
		<title>EvaluateScript</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=EvaluateScript&amp;diff=53295"/>
		<updated>2019-06-22T00:27:48Z</updated>

		<summary type="html">&lt;p&gt;KMullins: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Evaluation Functions]]&lt;br /&gt;
[[Category: Typescript Commands]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== EvaluateScript(typescript) ==&lt;br /&gt;
&lt;br /&gt;
Evaluates a [[typescript]] command.  Returns the typescript output as a string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Warning&amp;quot;&amp;gt; There are some dangerous aspects to this function.  It is not a function most users will want to make use of.  However, because it provides access to typescript from expressions, it does open up some doors, making something things possible that would not otherwise be.  But, if you use [[EvaluateScript]], Analytica does not prevent you from &amp;quot;shooting yourself in the foot&amp;quot;.&lt;br /&gt;
&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Despite the warning, there are many legitimate uses.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
The following creates a list of all keywords in Analytica:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index kw:= Split(EvaluateScript(&amp;quot;Command List|list]] keyword&amp;quot;),&amp;quot; &amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;subset(kw&amp;lt;&amp;gt;&amp;quot;&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Error Handling ==&lt;br /&gt;
&lt;br /&gt;
When an error occurs while processing the typescript, the error message is returned in the text of the result.  In Analytica 4.2 and later, the optional «showErr» parameter can be specified as true to halt execution and display the error:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;EvaluateScript(&amp;quot;show nothing&amp;quot;) &amp;amp;rarr; &amp;quot;Syntax error at line 1: Undefined name.&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;EvaluateScript(&amp;quot;show nothing&amp;quot;, showError: true) &amp;amp;rarr; { Evaluation stops, error dialog appears }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When «showError» is true, the error can also be caught using the [[Try]](..) function. ([[Analytica 4.6]] or later).&lt;br /&gt;
&lt;br /&gt;
== Dangers ==&lt;br /&gt;
&lt;br /&gt;
[[EvaluateScript]] makes it possible to go around Analytica's referential transparency rule that prohibits side-effects while a variable is being evaluated. If you choose to do so, you do so at your own risk. In particular, unpredictable things may occur, including the potential for a crash, or for incorrect computations, if you alter something that a pending computation depends on. For example, if &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is in the process of being computed, and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is upstream from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;. If you use [[EvaluateScript]] to change &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, which you might do from some variable far removed from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, the computation of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; may experience serious problems. Since it is in the process of being evaluated, it may have already computed intermediate results that are no longer valid given the change in &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. It won't know this, and will plow ahead with the remainder of the computation, possibly producing a nonsense answer, and possibly even crashing. &lt;br /&gt;
&lt;br /&gt;
One situation that is particularly nefarious is the case where a [[Dynamic]] evaluation is in progress. A dynamic evaluation bases its computation of the model's global loop structure. Previously computed information on the model's loop structure is invalidated when a definition in the model changes. Hence, you should never use [[EvaluateScript]] to alter a variable's definition if there is a possibility that a variable in a dynamic loop is in the process of being evaluated. This case if extremely hard to debug to figure out what is happening, and the symptom may simply be that numeric results aren't correct.&lt;br /&gt;
&lt;br /&gt;
Another mistake to avoid is assigning to [[RandomSeed]] while a variable evaluation is in-progress, since this causes all uncertain quantities to be invalidated. You can assign to [[RandomSeed]] using the [[Assignment Operator :=]], even when a computation is in progress, so if you want a &amp;quot;deterministic pseudo-random sample&amp;quot; use assignment, not [[EvaluateScript]], e.g., from an expression, &amp;lt;code&amp;gt;[[RandomSeed]]:=5; [[Uniform]](0,1)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With [[EvaluateScript]], you are given the ability to shoot yourself in the foot, but in rare cases, the fact that it is not limited can make it possible to work around core limitations.&lt;br /&gt;
&lt;br /&gt;
In general, side-effects created by [[EvaluateScript]] are not particularly dangerous from [[UDF]]s called from button scripts, [[OnClick]] or [[OnChange]] handlers.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Typescript Commands|Typescript Commands]]&lt;br /&gt;
* [[Command List]]&lt;br /&gt;
* [[Evaluate]]&lt;br /&gt;
* [[Attrib of Obj]]&lt;br /&gt;
* [[Try]]&lt;br /&gt;
* [[OnClick]]&lt;br /&gt;
* [[OnChange]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Plot_solid_prob_band&amp;diff=52723</id>
		<title>Plot solid prob band</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Plot_solid_prob_band&amp;diff=52723"/>
		<updated>2019-04-08T22:02:30Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added example image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New to [[Analytica 5.2]]''&lt;br /&gt;
&lt;br /&gt;
Use this function from [[OnGraphDraw]] to plot a filled color band between symmetric percentiles in a probability bands result view. &lt;br /&gt;
&lt;br /&gt;
== Plot_solid_prob_band( canv, info, roles ) ==&lt;br /&gt;
Fills in a solid band behind a probability bands view. To be used from the OnGraphDraw attribute. Usage:&lt;br /&gt;
&lt;br /&gt;
# Set &amp;quot;Evaluate before drawing&amp;quot; AND &amp;quot;Evaluate after axes, before data&amp;quot; in [[OnGraphDraw]]&lt;br /&gt;
# Set the [[OnGraphDraw]] expression to: &amp;lt;code&amp;gt; [[Plot_solid_prob_band]]( canv, info, roles ) &amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the bands view for your result.&lt;br /&gt;
# Make sure you have Key=.Probability for the pivot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is an example of how this function can be used. One additional step is to [[Customization of Graph Colors|change the colors]] for the Probability index so that the 5th and 95th percentile values and the 25th and 75th values are the same.&lt;br /&gt;
&lt;br /&gt;
:[[File:Plot_solid_prob_band_example.png]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[OnGraphDraw]]&lt;br /&gt;
* [[Plot_solid_band]]&lt;br /&gt;
* [[Plot_Tukey_bars]]&lt;br /&gt;
* [[Plot_error_bars]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Plot_solid_prob_band_example.png&amp;diff=52722</id>
		<title>File:Plot solid prob band example.png</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Plot_solid_prob_band_example.png&amp;diff=52722"/>
		<updated>2019-04-08T21:56:09Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Example of function use, using the car cost demo model&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of function use, using the car cost demo model&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Plot_solid_prob_band&amp;diff=52721</id>
		<title>Plot solid prob band</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Plot_solid_prob_band&amp;diff=52721"/>
		<updated>2019-04-08T21:17:59Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Changed to ordered list so people see usage notes as a list of steps (so they're less likely to just look at the definition, which I just did...)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New to [[Analytica 5.2]]''&lt;br /&gt;
&lt;br /&gt;
Use this function from [[OnGraphDraw]] to plot a filled color band between symmetric percentiles in a probability bands result view. &lt;br /&gt;
&lt;br /&gt;
== Plot_solid_prob_band( canv, info, roles ) ==&lt;br /&gt;
Fills in a solid band behind a probability bands view. To be used from the OnGraphDraw attribute. Usage:&lt;br /&gt;
&lt;br /&gt;
# Set &amp;quot;Evaluate before drawing&amp;quot; AND &amp;quot;Evaluate after axes, before data&amp;quot; in [[OnGraphDraw]]&lt;br /&gt;
# Set the [[OnGraphDraw]] expression to: &amp;lt;code&amp;gt; [[Plot_solid_prob_band]]( canv, info, roles ) &amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the bands view for your result.&lt;br /&gt;
# Make sure you have Color=.Probability for the pivot.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[OnGraphDraw]]&lt;br /&gt;
* [[Plot_solid_band]]&lt;br /&gt;
* [[Plot_Tukey_bars]]&lt;br /&gt;
* [[Plot_error_bars]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Time-series-reindexing.ana&amp;diff=52715</id>
		<title>File:Time-series-reindexing.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Time-series-reindexing.ana&amp;diff=52715"/>
		<updated>2019-03-28T17:43:37Z</updated>

		<summary type="html">&lt;p&gt;KMullins: KMullins uploaded a new version of File:Time-series-reindexing.ana&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An example model demonstrating some simple stuff.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Weekly_data_graph_ex.png&amp;diff=52714</id>
		<title>File:Weekly data graph ex.png</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Weekly_data_graph_ex.png&amp;diff=52714"/>
		<updated>2019-03-28T17:41:37Z</updated>

		<summary type="html">&lt;p&gt;KMullins: KMullins uploaded a new version of File:Weekly data graph ex.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Graph from an example model&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52627</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52627"/>
		<updated>2019-03-14T17:46:55Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
=== PM2.5 Concentration in Beijing ===&lt;br /&gt;
&lt;br /&gt;
Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014. Available at: [http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data UCI Machine Learning Repository].&lt;br /&gt;
&lt;br /&gt;
Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. ''Proceedings of the Royal Society A'', 471, 20150257.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Beijing air quality data.ana|Beijing air quality module]]&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52626</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52626"/>
		<updated>2019-03-14T17:46:00Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
=== PM2.5 Concentration in Beijing ===&lt;br /&gt;
&lt;br /&gt;
Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014.&lt;br /&gt;
&lt;br /&gt;
Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. ''Proceedings of the Royal Society A'', 471, 20150257.&lt;br /&gt;
&lt;br /&gt;
Available at: [http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data UCI Machine Learning Repository].&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Beijing air quality data.ana|Beijing air quality module]]&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52625</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52625"/>
		<updated>2019-03-14T16:43:07Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
=== PM 2.5 Concentration in Beijing ===&lt;br /&gt;
&lt;br /&gt;
Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014.&lt;br /&gt;
&lt;br /&gt;
Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. ''Proceedings of the Royal Society A'', 471, 20150257.&lt;br /&gt;
&lt;br /&gt;
Available at: [http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data UCI Machine Learning Repository].&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Beijing air quality data.ana|Beijing air quality module]]&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52624</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52624"/>
		<updated>2019-03-14T16:42:18Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added data module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
=== PM 2.5 Concentration in Beijing ===&lt;br /&gt;
&lt;br /&gt;
Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014.&lt;br /&gt;
&lt;br /&gt;
Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. Proceedings of the Royal Society A, 471, 20150257.&lt;br /&gt;
&lt;br /&gt;
Available at: [http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data UCI Machine Learning Repository].&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Beijing air quality data.ana|Beijing air quality module]]&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Beijing_air_quality_data.ana&amp;diff=52623</id>
		<title>File:Beijing air quality data.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Beijing_air_quality_data.ana&amp;diff=52623"/>
		<updated>2019-03-14T16:40:32Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014.

Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hourly PM2.5 from the US Embassy in Beijing, China with relvant hourly meteorological data. The data cover 2010 through 2014.&lt;br /&gt;
&lt;br /&gt;
Citation: Liang, X., Zou, T., Guo, B., Li, S., Zhang, H., Zhang, S., Huang, H. and Chen, S. X. (2015). Assessing Beijing's PM2.5 pollution: severity, weather impact, APEC and winter heating. Proceedings of the Royal Society A, 471, 20150257.&lt;br /&gt;
&lt;br /&gt;
Available at: http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52622</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52622"/>
		<updated>2019-03-14T00:49:20Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
=== PM 2.5 Concentration in Beijing ===&lt;br /&gt;
&lt;br /&gt;
Multivariate air quality data from Beijing (PM 2.5) from 2010 to 2014. Data provided by [http://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data UCI Machine Learning Repository].&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:WAGE1.ana&amp;diff=52621</id>
		<title>File:WAGE1.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:WAGE1.ana&amp;diff=52621"/>
		<updated>2019-03-14T00:35:25Z</updated>

		<summary type="html">&lt;p&gt;KMullins: KMullins uploaded a new version of File:WAGE1.ana&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cross-sectional data set from 1976 for 526 workers. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52620</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52620"/>
		<updated>2019-03-13T17:46:43Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added oil price data&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Time Series ==&lt;br /&gt;
&lt;br /&gt;
=== Oil Price ===&lt;br /&gt;
&lt;br /&gt;
Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Oil prices module.ana|Oil price module]]&lt;br /&gt;
&lt;br /&gt;
== Econometric ==&lt;br /&gt;
&lt;br /&gt;
=== Wages ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Oil_prices_module.ana&amp;diff=52619</id>
		<title>File:Oil prices module.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Oil_prices_module.ana&amp;diff=52619"/>
		<updated>2019-03-13T17:45:11Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monthly oil price data from 1987 to 2018. Includes Brent and WTI prices.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52617</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52617"/>
		<updated>2019-03-08T00:13:15Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. For instructions on how to add a data module to your model, see [[Import a module or library]].&lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Econometric Data ==&lt;br /&gt;
&lt;br /&gt;
=== Wage data ===&lt;br /&gt;
&lt;br /&gt;
Cross-sectional data set surrounding wages from 1976 for 526 workers. Variables cover demographics, industry, and geography. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:WAGE1.ana|Wage data module]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:WAGE1.ana&amp;diff=52614</id>
		<title>File:WAGE1.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:WAGE1.ana&amp;diff=52614"/>
		<updated>2019-03-08T00:06:59Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Cross-sectional data set from 1976 for 526 workers. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cross-sectional data set from 1976 for 526 workers. Taken from &amp;quot;Introductory Econometrics: A Modern Approach, 6e&amp;quot; by Jeffrey M. Wooldridge, via https://rdrr.io/cran/wooldridge/f/&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52610</id>
		<title>Data Sets</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Data_Sets&amp;diff=52610"/>
		<updated>2019-03-07T23:37:23Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Created page with &amp;quot;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a mode...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You may find these sample data set modules useful as you explore what Analytica can do, and as inspiration or a starting point for your own models. They can be added to a model in [[Editions of Analytica|any edition]] of Analytica, and cover a wide variety of topic areas. &lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own well organized and complete data sets as sources for the Analytica community to use. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Econometric Data ==&lt;br /&gt;
&lt;br /&gt;
=== Wage data ===&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Example_Models&amp;diff=52609</id>
		<title>Example Models</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Example_Models&amp;diff=52609"/>
		<updated>2019-03-07T23:32:14Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Models]]&lt;br /&gt;
[[Category: Examples]]&lt;br /&gt;
[[category:Doc Status D]]&lt;br /&gt;
&lt;br /&gt;
You may find these example Analytica models useful to see what Analytica can do, and as inspiration or a starting point for your own models. They cover a wide variety of topics and techniques.  &lt;br /&gt;
&lt;br /&gt;
These examples supplement the example models that are [[Example Models and Libraries |installed with Analytica]] into the Examples folder. &lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own models as examples. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Business Examples==&lt;br /&gt;
&lt;br /&gt;
=== Marginal Abatement Graph ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Marginal abatement heating energy.png]]&lt;br /&gt;
&lt;br /&gt;
This model, along with [http://blog.lumina.com/2015/marginal-abatement/ the accompanying blog article], show how to set up a Marginal Abatement graph in Analytica.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Graph methods, carbon price, energy efficiency, climate policy, optimal allocation, budget constraint.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Marginal abatement home heating.ana|Marginal abatement home heating.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Solar Panel Analysis ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Solar Panel Analysis.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Would it be cost effective to install solar panels on the roof of my house? This model explores this question for my situation in San Jose, California. [https://www.youtube.com/watch?v=vhSor_fPIsI An accompanying video] documents the building of this model, and is a good example of the process one goes through when building any decision model.&lt;br /&gt;
&lt;br /&gt;
The model explores how many panels I should install, and what the payoff is in terms of [[NPV|net present value]], [[IRR|Internal rate of return]] and time to recoup cost. It also looks at whether I should postpone the start of the installation to take advantage of rapidly falling PV prices, or cash in on tax credits.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''':  Renewable energy, photovoltaics, net present value, internal rate of return, tax credits, agile modeling.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Solar Panel Analysis.ana|Solar Panel Analysis.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Items within Budget function ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Given a set of items, with a priority and a cost for each, the function Items_within_budget function selects out the highest priority items that fit within the fixed budget. &lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Items_within_budget.ana|Items within budget.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Grant Exclusion Model ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model tests a hypothesis about the distribution of an attribute of the marginal rejectee of a grant program, given the relevance of that attribute to award of the grant.  It could be used by an organization to make decisions as to whether to fiscally-sponsor another organization that will use that fiscal sponsorship to apply for grants, by looking at the effect on the pool of grant recipients overall.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Business analysis&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Grant_exclusion.ANA|Grant exclusion.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Project Planner ===&lt;br /&gt;
&lt;br /&gt;
:[[Image: Project planner model.png |500px]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This is a demo model that shows how to:&lt;br /&gt;
* Evaluate a set of R&amp;amp;D projects, including uncertain R&amp;amp;D costs, and uncertain revenues if it leads to release of a commercial product.&lt;br /&gt;
* Use multiattribute analysis to compare projects, including a hard attribute -- expected net present value -- and soft attributes -- strategic fit, staff development, and public good will.&lt;br /&gt;
* Compare cost, [[NPV]], and multiattribute value for a selected portfolio of projects.&lt;br /&gt;
* Generate the best portfolio (ratio of NPV or multiattribute merit to cost) given a R&amp;amp;D budget.&lt;br /&gt;
&lt;br /&gt;
The model linked here is only a test, and to an older version: [[File:Project_priorities_2007_4.0.ANA]]&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Business models, cost analysis, net present value (NPV), uncertainty analysis&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Project Priorities 5 0.ana|Project Priorities 5 0.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Steel and Aluminum import tariff impact on US trade deficit ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Steel and aluminum tariff model diagram.png|400px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' On 2-March-2018, President Trump proposed new import tariffs on steel and aluminum. It seems as if the projected net impacts of these tariffs on the total US trade deficit and US economy depends largely on which news outlets you get your news from. We thought it would be helpful to put together a simple and easy to understand model to estimate of the net impact of these tariffs on the US trade deficit, assuming that no other factors change (e.g., no retaliatory tariffs are enacted by other countries). We wanted something that allows you to understand how its estimates are being derived, with assumptions that can be easily replaced with your own, so that the model itself would be impartial to any particular viewpoint. We want the uncertainties that are inherent in such a simple model to be explicit, so you can see the range of possibilities and not just a single guess. Finally, we wanted the model to be easy to understand fully for non-economists (a group to which we belong, too).&lt;br /&gt;
&lt;br /&gt;
This model accompanied a current event blog post on the Lumina blog: [http://lumina.com/blog/impact-of-trumps-proposed-steel-aluminum-tariffs-on-us-trade-deficit Impact of Trump’s proposed Steel &amp;amp; Aluminum tariffs on US trade deficit]&lt;br /&gt;
&lt;br /&gt;
'''Authors:''' Kimberley Mullins and Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Steel and aluminum tariff model.ana|Steel and aluminum tariff model.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Tax bracket interpolation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Tax bracket interpolation.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Computes amount of tax due from taxable income for a 2017 US Federal tax return. To match the IRS's numbers exactly, it is necessary to process tax brackets correctly as well as implementation a complex mix of rounding rules that reproduce the 12 pages of table lookups from the Form 1040 instructions. This model is showcased in a blog article, [http://Lumina.com/blog/how-to-simplify-the-irs-tax-tables How to simplify the IRS Tax Tables].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media: Tax bracket interpolation.ana|Tax bracket interpolation.ana]]&lt;br /&gt;
&lt;br /&gt;
==Data Analysis==&lt;br /&gt;
&lt;br /&gt;
=== Sampling from only feasible points ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' You have a bunch of chance variables, each with a probability distribution. Their joint sample, however, contains some combinations of points that are (for one reason or another) physically impossible. We'll call those infeasible points. You'd like to eliminate those points from the sample and keep only the feasible points. &lt;br /&gt;
&lt;br /&gt;
This module implements a button that will sample a collection of chance variables, then reset the sample size and keep only those sample points that are &amp;quot;feasible&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Obviously, this approach will work best when most of your samples are feasible. If you can handle the &amp;quot;infeasible&amp;quot; points in your model directly, by conditioning certain chance variables on others, that is far preferable. But there are some cases where this solution (although a bit of a kludge) is more convenient. &lt;br /&gt;
&lt;br /&gt;
The instructions for how to use this are in the module description field.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Statistics, sampling, Importance sampling, feasibility, Monte Carlo simulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download''':  [[Media:Feasible_Sampler.ana|Feasible Sampler.ana]] &lt;br /&gt;
&lt;br /&gt;
=== Cross-Validation / Fitting Kernel Functions to Data ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Cross-validated data fit.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' When fitting a function to data, if you have too many free parameters relative to the number of points in your data set, you may &amp;quot;overfit&amp;quot; the data.  When this happens, the fit to your training data may be very good, but the fit to new data points (beyond those used for training) may be very poor.&lt;br /&gt;
&lt;br /&gt;
Cross-validation is a common technique to deal with this problem: We set aside a fraction of the available data as a cross-validation set.  Then we begin by fitting very simple functions to the data (with few free parameters), successively increasing the number of free parameters, and seeing how the predictive performance changes on the cross-validation set.  It is typical to see improvement on the cross-validation set for a while, followed by a deterioration of predictive performance on the cross-validation set once overfitting starts occurring.  &lt;br /&gt;
&lt;br /&gt;
This example model successively fits a non-linear kernel function to the residual error, and uses cross-validation to determine how many kernel functions should be used.&lt;br /&gt;
&lt;br /&gt;
Requires Analytica Optimizer: The kernel fitting function (Kern_Fit) uses [[NlpDefine]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''  Cross-validation, overfitting, non-linear kernel functions&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Cross-validation example.ana|Cross-validation example.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Statistical Bootstrapping ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Bootstrapping is a technique from statistics for estimating the sampling error present in a statistical estimator.  The simplest version estimates sampling error by resampling the original data.  This model demonstrates how to do this in Analytica.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Bootstrapping, sampling error, re-sampling&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Bootstrapping.ana|Bootstrapping.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Smooth PDF plots using Kernel Density Estimation ===&lt;br /&gt;
&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| [[image:Dens_Est_builtin_pdf.png|frame|Analytica's built-in PDF plot with default settings]] &lt;br /&gt;
|&lt;br /&gt;
[[image:Dens_Est_Kernel_pdf.png|frame|PDF computed from Kernel Density estimation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This example demonstrates a very simple fixed-width kernel density estimator to estimate a &amp;quot;smooth&amp;quot; probability density.   The built-in PDF function in Analytica often has a choppy appearance due to the nature of histogramming -- it sets up a set of bins and counts how many points land in each bin.  A kernel density estimator smooths this out, producing a less choppy PDF plot.&lt;br /&gt;
&lt;br /&gt;
This smoothing is built into [[Analytica 4.4]].  You can select [[Kernel Density Smoothing|smoothing]] from the [[Uncertainty Setup dialog]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Kernel density estimation, kernel density smoothing&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Kernel_Density_Estimation.ana|Kernel Density Estimation.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Output and Input Columns in Same Table ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Output and input columns.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Presents an input table to a user, where one column is populated with computed output data, the other column with checkboxes for the user to select.  Although the '''Output Data''' column isn't read only, as would be desired, a [[Check Attribute]] has been configured to complain if he does try to change values in that column.  The model that uses these inputs would ignore any changes he makes to data in the '''Output Data''' column.&lt;br /&gt;
&lt;br /&gt;
Populating the '''Output Data''' column requires the user to press a button, which runs a button script to populate that column.  This button is presented on the top-level panel.  If you change the input value, the output data will change, and then the button needs to be pressed to refresh the output data column.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Data analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Output and input columns.ana|Output and input columns.ana]]&lt;br /&gt;
&lt;br /&gt;
==Decision Analysis==&lt;br /&gt;
&lt;br /&gt;
=== From Controversy to Consensus: California's offshore oil platforms ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:oilplatform_1.jpg|300px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Too many environmental issues cause bitter public controversy. The question of how to decommission California's 27 offshore oil platforms started out as a typical example. But remarkably, after careful analysis a single option, &amp;quot;[http://lumina.com/case-studies/energy-and-power/a-win-win-solution-for-californias-offshore-oil-rigs rigs to reefs]&amp;quot;, obtained the support of almost all stakeholders, including oil companies and environmentalists. A law to enable this option was passed by the California State house almost unanimously, and signed by Governor Arnold Schwarzenegger.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' decision analysis, multi-attribute, offshore platforms, oil and gas, stakeholders, rigs to reefs, decision support, sensitivity analysis &lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Platform 2018b.ana|Platform2018b.ana]].&lt;br /&gt;
&lt;br /&gt;
=== Retirement plan type comparison ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Comparing retirement account types.png|500px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Will you end up with a bigger nest egg at retirement with a 401(k), traditional IRA, Roth IRA or a normal non-tax-advantaged brokerage account? For example, comparing a Roth IRA to a normal brokerage, intermediate capital gains compound in the Roth, but eventually you pay taxes on those gains at your income tax rate at retirement, whereas in the brokerage you pay capital gains taxes on the gains, which is likely a lower tax rate. So does the compounding outweigh the tax rate difference? What effect do the higher account maintenance fees in a 401(k) account have? How sensitive are these conclusions to the various input estimates? The answers to all these questions depend on your own situation, and may different for someone else. Explore these questions with this model.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' 401(k), IRA, retirement account, decision analysis, uncertainty, sensitivity analysis, [[MultiTable]]s.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Comparing retirement account types.ana|Comparing retirement account types.ana]]. &lt;br /&gt;
::For a version without the sensitivity analysis part, which has fewer than 100 objects and can thus be modified using [http://lumina.com/products/free101/ Analytica Free 101], you can use this one: [[media:Comparing retirement account types without sensitivity.ana|Comparing retirement account types without sensitivity.ana]].&lt;br /&gt;
&lt;br /&gt;
=== Plane Catching Decision with Expected Value of Including Uncertainty ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A simple model to assess what time I should leave my home to catch a plane, with uncertain driving time, walking from parking to gate (including security), and how long I need to be at the gate ahead of scheduled departure time. It uses a loss model based on minutes, assuming I value each extra minute snoozing in bed and set the loss if I miss the plane to 400 of those minutes.&lt;br /&gt;
&lt;br /&gt;
It illustrates the EVIU (expected value of including uncertainty) i.e. the difference in expected value if I make a decision to minimize expected loss instead of decision to minimize time ignoring uncertainty (assuming each distribution is fixed at its mid value). For more details see &amp;quot;The  Value of Knowing How Little You Know&amp;quot;, Max Henrion, PhD Dissertation, Carnegie Mellon University, 1982.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Decision theory, decision analysis, uncertainty, Monte Carlo simulation, value of information, EVPI, EVIU.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Plane catching decision with EVIU.ana|Plane catching decision with EVIU.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Marginal Analysis for Control of SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; emissions ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Acid rain in eastern US and Canada caused by sulfur dioxide is emitted primarily by coal-burning electric-generating plants in the Midwestern U.S.  This model demonstrates a marginal analysis a.k.a. benefit/cost analysis to determine the policy alternative that leads us to the most economically efficient level of cleanup.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Environmental engineering, cost-benefit analysis, marginal analysis &lt;br /&gt;
&lt;br /&gt;
'''Author:''' Surya Swamy&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Marginal Analysis for Control of SO2 Emissions.ana|Marginal Analysis for Control of SO2 Emissions.ana]]&lt;br /&gt;
&lt;br /&gt;
==Dynamic Models==&lt;br /&gt;
&lt;br /&gt;
=== Donor/Presenter Dashboard ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model implements a continuous-time Markov chain in Analytica's discrete-time dynamic simulation environment.  It supports immigration to, and emigration from, every node.&lt;br /&gt;
&lt;br /&gt;
It can be used by an arts organization to probabilistically forecast future audience evolution, in both the short and the long (steady state) term.  It also allows for uncertainty in the input parameters.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dynamic models, Markov processes&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Donor_Presenter_Dashboard_II.ANA|Donor-Presenter Dashboard.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Regulation of Photosynthesis ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Photosynthesis fluorescence.jpg]]&lt;br /&gt;
&lt;br /&gt;
A model of how photosynthesis is regulated inside a cyanobacteria.  As light exposure varies over time (and you can experiment with various light intensity waveforms), it simulates the concentration levels of key transport molecules along the chain, through the PSII complex, plasto-quinone pool, PSI complex, down to metabolic oxidation.  The dynamic response to light levels, or changes in light levels, over time becomes evident, and the impact of changes to metabolic demand can also be observed.  In the graph of fluorescence above, we can see an indicator of how much energy is being absorbed, in three different cases (different light intensities).  In the two higher intensity cases, photoinhibition is observed -- a protective mechanism of the cell that engages when more energy is coming in than can be utilized by the cell.  Excess incoming energy, in the absence of photoinhibition, causes damage, particularly to the PSII complex.&lt;br /&gt;
&lt;br /&gt;
This model uses node shapes for a different purpose than is normally seen in decision analysis models.  In this model, ovals, instead of depicting chance variables, depict chemical reactions, where the value depicts the reaction rate, and rounded rectangles depict chemical concentrations.&lt;br /&gt;
&lt;br /&gt;
Two models are attached.  The first is a bit cleaner, and focused on the core transport chain, as described above.  The second is less developed, but is focused more on genetic regulation processes.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''  Photosynthesis, dynamic models&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:'''&lt;br /&gt;
* [[media:Photosynthesis regulation.ANA|Photosynthesis Regulation.ana]] - main regulation pathways&lt;br /&gt;
* [[media:Photosystem.ana | Photosystem.ana]] - rough sketch of genetic regulation.&lt;br /&gt;
&lt;br /&gt;
=== Time-series re-indexing ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Weekly_data_graph_ex.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model contains some examples of time-series re-indexing.  It is intended to demonstrate some of these basic techniques.&lt;br /&gt;
&lt;br /&gt;
In this example, actual measurements were collected at non-uniform time increments.  Before analyzing these, we map these to a uniformly spaced time index (&amp;lt;code&amp;gt;Week&amp;lt;/code&amp;gt;), occurring on Monday of each week.  The mapping is done using an interpolation.  The evenly-spaced data is then used to forecast future behavior.  We first forecast over an index containing only future time points (&amp;lt;code&amp;gt;Future_weeks&amp;lt;/code&amp;gt;), using a log-normal process model based on the historical weekly change.  We then combine the historical data with the forecast on a common index (&amp;lt;code&amp;gt;Week&amp;lt;/code&amp;gt;).  A prob-bands graph of the weekly_data result shows the range of uncertainty projected by the process model (you'll notice the uncertainty exists only for future forecasted values, not historical ones).&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dynamic models, forecasting, time-series re-indexing&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Time-series-reindexing.ana|Time-series-reindexing.ana]]&lt;br /&gt;
&lt;br /&gt;
==Engineering Examples==&lt;br /&gt;
&lt;br /&gt;
=== Timber Post Compression Load Capacity ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Here is a calculator for computing the maximum load that can be handled by a Douglas Fir - Larch post of a given size, grade, and composition in a construction setting.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:PostCompression.ana|Post Compression Model]]&lt;br /&gt;
&lt;br /&gt;
=== Compression Post Load Calculator ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Computes the load that a Douglas-Fir Larch post can support in compression.  Works for different timber types and grades and post sizes.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Compression analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Compression_Post_Load_Capacity.ana|Compression Post Load Capacity.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Daylighting Options in Building Design ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter_9.7-updated.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A demonstration showing how to analyze lifecycle costs and savings from daylighting options in building design.&lt;br /&gt;
&lt;br /&gt;
Analysis based on Nomograph Cost/Benefit Tool for Daylighting. adapted from S.E. Selkowitz and M. Gabel. 1984. &amp;quot;LBL Daylighting Nomographs,&amp;quot; LBL-13534, Lawrence Berkeley Laboratory, Berkeley CA, 94704. (510) 486-6845.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Engineering, cost-benefits analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Daylighting analyzer.ana|Daylighting analyzer.ana]]&lt;br /&gt;
&lt;br /&gt;
=== California Power Plants ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' An example showing how to use Choice menus and Checkbox inside an Edit table. It also shows how to use the Cell default attribute to specify default values (including Choice menu and Checkbox with default selections) specified in &amp;quot;Default Plant Data&amp;quot; to be used when user creates a new row in the Edit table.  This model shows how to demonstrates the use of [[Choice|choice pulldowns]] in edit tables.  The model is created during a mini-tutorial on [[Inserting Choice Controls in Edit Table Cells]] elsewhere on this Wiki.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Edit table, Choice menu, pulldown menu, checkbox, Power plants.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:California_Power_Plants.ANA|California Power Plants.ana ]]&lt;br /&gt;
&lt;br /&gt;
=== Electrical Generation and Transmission ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model of an electrical network minimizes total cost of generation and transmission.  Each node in the network has power generators and consumers (demand).  Nodes are connected by transmission links. Each link has a maximum capacity in Watts and an admittance (the real part of impedance is assumed to be zero).  Each generator has a min and max power and a marginal cost in $/KWh.  The model uses a linear program to determine how much power each generator should produce so as to minimize total cost of generation and transmission, while satisfying demand and remaining within link constraints.&lt;br /&gt;
&lt;br /&gt;
''Requires Analytica Optimizer''&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Electrical engineering, power generation and transmission&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Electrical Transmission.ana|Electrical Transmission.ana]]&lt;br /&gt;
&lt;br /&gt;
==Fun and Games==&lt;br /&gt;
&lt;br /&gt;
=== Color Map ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Color_map.gif]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A model which highlights [[Cell Format Expression|Cell Formatting]] and [[Computed cell formats|Computed Cell Formats]]. Model result is a 'color map' wherein the cell fill color is computed based on three input variables (R, G, and B), the computed color is displayed in hexadecimal, and the font color of the hexadecimal color is determined by the cell fill color.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Computed cell formatting&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Kimberley Mullins, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:color_map.ana|Color map.ana]]&lt;br /&gt;
&lt;br /&gt;
=== 2018 World Cup Soccer final ===&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:World cup.ana|World cup.ana]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' On July 15, 2018, France beat Croatia 4-2 in the final game of the World Cup to become world champions. But how much of that is can be attributed to France being the better team versus to the random chance? This model accompanies my blog article, [http://lumina.com/blog/world-cup-soccer.-how-much-does-randomness-determine-the-winner World Cup Soccer. How much does randomness determine the winner?], where I explore this question and use the example to demonstrate the [[Poisson|Poisson distribution]].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
=== Image recognition ===&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [http://AnalyticaOnline.com/Lonnie/resnet18.zip resnet18.zip]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Show it an image, and it tries to recognize what it is an image of, classifying it among 1000 possible categories. It uses an 18-layer residual network. This model is described and demonstrated in a video in the blog article [http://lumina.com/blog/an-analytica-model-that-recognizes-images An Analytica model that recognizes images].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems.  (Analytica implementation). Residual network developed by&lt;br /&gt;
* Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, &amp;quot;Deep Residual Learning for Image Recognition&amp;quot;, https://arxiv.org/abs/1512.03385 rXiv:1512.03385]&lt;br /&gt;
&lt;br /&gt;
==Function Examples==&lt;br /&gt;
&lt;br /&gt;
=== Transforming Dimensions by transform matrix, month to quarter ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The model shows how to transform an array from a finer-grain index (e.g., Month) onto a coarser index (e.g., Quarter).  We generally refer to this as [[Aggregate|aggregation]].   The model illustrates the direct use of [[Aggregate]], as well as a method to do this used before Aggregate was added to Analytica in release 4.2.&lt;br /&gt;
&lt;br /&gt;
'''Webinar:''' [[Analytica_User_Group/Past_Topics#The_Aggregate_Function|the Aggregate function]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Aggregation, level of detail, days, weeks, months, quarters, years.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Month to quarter.ana|Month to quarter.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Convolution ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Convolution is used mostly for signal and systems analysis. It is a way to combine two time series.  This model contains function Convolve(Y, Z, T, I), that computes the convolution of two time series.  The model contains several examples of convolved functions.&lt;br /&gt;
&lt;br /&gt;
A time series is a set of points, &amp;lt;code&amp;gt;(Y, T)&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; is the ascending X-axis, and the set of points is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. The values of &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; do not have to be equally spaced. The function treats &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt; as being equal to 0 outside the range of &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt;. The two time series here are the set of points &amp;lt;code&amp;gt;(Y, T)&amp;lt;/code&amp;gt; and the set of points &amp;lt;code&amp;gt;(Z, T)&amp;lt;/code&amp;gt;, where both sets of points are indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The mathematical definition of the convolution of two time series is the function given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;h(t) = \int y(u) z(t-u) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Signal analysis, systems analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Convolution.ana|Convolution.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Dependency Tracker Module ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Dependency tracker.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This module tracks dependencies through your model, updating the visual appearance of nodes so that you can quickly visualize the paths by which one variable influences another.  You can also use it to provide a visual indication of which nodes are downstream (or upstream) from an indicated variable.&lt;br /&gt;
&lt;br /&gt;
The module contains button scripts that change the bevel appearance of nodes in your model.  To see how Variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; influences Variable &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;, the script will bevel the nodes for all variables that are influenced by &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; and influence &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.  Alternatively, you can bevel all nodes that are influenced by &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, or you can bevel all nodes that influence &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the image above, the path from &amp;lt;code&amp;gt;dp_ex_2&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;dp_ex_4&amp;lt;/code&amp;gt; has been highlighted using the bevel style of the nodes.  (The result of pressing the &amp;quot;Bevel all from Ancestor to Descendant&amp;quot; button)&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dependency analysis&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Dependency_Tracker.ANA | Dependency Tracker.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Multi-lingual Influence Diagram ===&lt;br /&gt;
&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| [[Image:English-view.png]]&lt;br /&gt;
| [[Image:French-view.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Maintains a single influence diagram with Title and Description attributes in both English and French.  With the change of a pull-down, the influence diagram and all object descriptions are instantly reflected in the language of choice.&lt;br /&gt;
&lt;br /&gt;
If you change a title or description while viewing English, and then change to French, the change you made will become the English-language version of the description.  Similarly if you make a change while viewing French.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Multi-lingual models&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:French-English.ana|French-English.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Extracting Data from an XML file ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Suppose you receive data in an XML format that you want to read into your model. This example demonstrates two methods for extracting data: Using a full XML DOM parser, or using regular expressions. The first method fully parses the XML structure, the second simply finds the data of interest by matching patterns, which can be easier for very simple data structures (as is often the case).&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Data extraction, xml, DOM parsing &lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Parsing XML example.ana|Parsing XML example.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Vector Math ===&lt;br /&gt;
&lt;br /&gt;
'''Description:'''&lt;br /&gt;
Functions used for computing geospatial coordinates and distances. Includes:&lt;br /&gt;
* A cross product of vectors function&lt;br /&gt;
* Functions to conversion between spherical and Cartesian coordinates in 3-D&lt;br /&gt;
* Functions to compute bearings from one latitude-longitude point to another&lt;br /&gt;
* Functions for finding distance between two latitude-longitude points along the great circle.&lt;br /&gt;
* Functions for finding the intersection of two great circles&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Geospatial analysis, GIS, vector analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Robert D. Brown III, Incite Decision Technologies, LLC&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Vector Math.ana|Vector Math.ana]]&lt;br /&gt;
&lt;br /&gt;
==Optimizer Examples==&lt;br /&gt;
&lt;br /&gt;
=== Total Allowable Harvest  ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The problem applies to any population of fish or animal whose dynamics are poorly known but can be summarized in a simple model:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;N_t + 1 = N_t*Lambda - landed catch*(1 + loss rate)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where «N_t» is the population size (number of individuals) at time ''t'', «N_t+1» is the population size at time ''t + 1'', «Lambda» is the intrinsic rate of increase and the «loss rate» is the percentage of fish or animals killed but not retrieved relative to the «landed catch», or catch secured.&lt;br /&gt;
&lt;br /&gt;
The question here is to determine how many fish or animals can be caught (landed) annually so that the probability of the population declining X%  in Y years (decline threshold) is less than Z% (risk tolerance).  &lt;br /&gt;
&lt;br /&gt;
Two models are available for download.  One uses the Optimizer ([[NlpDefine]]) to find the maximum landed catch at the risk tolerance level for the given decline threshold. The other (for those using a version of Analytica without Optimizer) uses [[StepInterp]] in an iterative way to get that maximum landed catch.    &lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Population analysis, dynamic models, optimization analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Models contributed by Pierre Richard&lt;br /&gt;
&lt;br /&gt;
'''Download:'''&lt;br /&gt;
* [[media:Total Allowable Removal model with Optimizer.ana | Total Allowable w Optimizer.ana]]&lt;br /&gt;
* [[media:Total Allowable Removal model w StepInterp.ana|Total Allowable w StepInterp.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Linearizing a discrete NSP ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A cereal formulation model&lt;br /&gt;
&lt;br /&gt;
A discrete mixed integer model that chooses product formulations to minimize total ingredient costs.  This could be an NSP but it uses two methods to linearize:&lt;br /&gt;
1) Decision variable is constructed as a constrained Boolean array&lt;br /&gt;
2) Prices are defined as piecewise linear curves&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' product formulation, cereal formulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' P. Sanford, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Cereal Formulation1.ana|Cereal Formulation1.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Neural Network ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A feed-forward neural network can be trained (fit to training data) using the Analytica Optimizer.  This is essentially an example of non-linear regression.  This model contains four sample data sets, and is set up to train a 2-layer feedforward sigmoid network to &amp;quot;learn&amp;quot; the concept represented by the data set(s), and then test how well it does across examples not appearing in the training set.&lt;br /&gt;
&lt;br /&gt;
Developed during the Analytica User Group Webinar of 21-Apr-2011 -- see the [[Analytica_User_Group/Past_Topics#Neural_Networks|webinar recording]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Feed-forward neural networks, optimization analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Neural-Network.ana|Neural Network.ana]]&lt;br /&gt;
&lt;br /&gt;
==Risk Analysis==&lt;br /&gt;
&lt;br /&gt;
=== Earthquake Expenses ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' An example of risk analysis with time-dependence and costs shifted over time.&lt;br /&gt;
&lt;br /&gt;
Certain organizations (insurance companies, large companies, governments) incur expenses following earthquakes.  This simplified demo model can be used to answer questions such as:&lt;br /&gt;
* What is the probability of more than one quake in a specific 10 year period.&lt;br /&gt;
* What is the probability that in my time window my costs exceed $X?&lt;br /&gt;
&lt;br /&gt;
Assumptions in this model:  &lt;br /&gt;
* Earthquakes are Poisson events with mean rate of once every 10 years.&lt;br /&gt;
* Damage caused by such quake is lognormally distributed, with mean $10M adn stddev of $6M.&lt;br /&gt;
* Cost of damage gets incurred over the period of a year from the date of the quake as equipment is replaced and buildings are repaired over time:  20% in 1st quarter after quake, 50% in 2nd quarter, 20% in 3rd quarter, 10% in 4th quarter.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Risk analysis, cost analysis&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[media:Earthquake expenses.ana|Earthquake expenses.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Loan Policy Selection ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A lender has a large pool of money to loan, but needs to decide what credit rating threshold to require and what interest rate (above prime) to charge.  The optimal value is determined by market forces (competing lenders) and by the probability that the borrower defaults on the loan, which is a function of the economy and borrower's credit rating.  The model can be used without the Analytica optimizer, in which case you can explore the decision space manually or use a parametric analysis to find the near optimal solution.  Those with Analytica Optimizer can find the optimal solution (more quickly) using an [[NlpDefine|NLP]] search.&lt;br /&gt;
&lt;br /&gt;
'''Best used with Analytica Optimizer'''&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Creditworthiness, credit rating, default risk, risk analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Loan policy selection.ANA|Loan policy selection.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Inherent and Residual Risk Simulation ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Prob of Exceeding Loss.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The model simulates loss exceedance curves for a set of cybersecurity events, the likelihood and probabilistic monetary impact of which have been characterized by system experts. The goal of the model is assess the impact of mitigation measures, by comparing the residual risk curve to the inherent risk curve (defined as risk without any mitigation measures) and to the risk tolerance curve. This is a translation of a model built by Douglas Hubbard and Richard Seiersen which they describe in their book [https://www.howtomeasureanything.com/cybersecurity/about-the-book/ How to Measure Anything in Cybersecurity Risk], and which they make available [https://www.howtomeasureanything.com/cybersecurity/ here].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Cybersecurity risk, loss exceedance curve, simulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Kim Mullins&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Hubbard and Seiersen cyberrisk.ana|Hubbard_and_Seiersen_cyberrisk.ana]]&lt;br /&gt;
&lt;br /&gt;
== Graphing examples ==&lt;br /&gt;
=== Red or blue state ===&lt;br /&gt;
[[image:Red_or_blue_state.png|600px]]&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Red State Blue State plot.ana]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This example contains the shape outlines for each of the 50 US states, along with a graph that uses color to depict something that varies by state (historical political party leaning). You may find the shape data useful for your own plots. In addition, it demonstrates the polygon fill feature that is new in [[Analytica 5.2]].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[New examples]]&lt;br /&gt;
* [[Additional libraries]]&lt;br /&gt;
* [[Uploading Example Models]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Using Add Module... to import a Model file]]&lt;br /&gt;
* [[Import a module or library]]&lt;br /&gt;
* [[Tutorial: Sharing a model with ACP]]&lt;br /&gt;
* [[Obfuscated and Browse-Only Models]]&lt;br /&gt;
* [[Filed modules and libraries]]&lt;br /&gt;
* [[Working with Models, Modules, and Files in ADE]]&lt;br /&gt;
* [[Combining models into an integrated model]]&lt;br /&gt;
* [[Model file formats]]&lt;br /&gt;
* [[Model Licensing]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Function_parameter_qualifiers&amp;diff=52542</id>
		<title>Function parameter qualifiers</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Function_parameter_qualifiers&amp;diff=52542"/>
		<updated>2019-02-15T22:18:06Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Corrected formatting issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Functions]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
Parameter qualifiers are keywords used in the Parameters attribute of a function to specify what kind of value or object the function expects: &lt;br /&gt;
*'''Class Qualifiers''', such as '''Index''' and '''Variable''', specify what class of Object is expected.&lt;br /&gt;
*'''Evaluation mode qualifiers''', such as '''Mid''' and '''Prob''', control whether to evaluate a parameter as deterministic or probabilistic.&lt;br /&gt;
*'''Data type qualifiers''', such as '''Number''', '''Text''', '''Reference''', and '''Handle''', specify the expected data type.&lt;br /&gt;
*'''Dimension qualifiers''', such as '''Atom''', '''List''', '''Array''', and '''[i]''', specify the expected dimensions and indexes to support array abstraction.&lt;br /&gt;
* '''Optional''' (or '''=''' with default) and '''Repeated''' (or ...) specify whether a parameter is optional or may be repeated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why use qualifiers? ==&lt;br /&gt;
&lt;br /&gt;
Parameter qualifiers help make sure that each parameter gets the kind of value or object that the function expects. A Class qualifier specifies the expected class (Index, Variable, or other object class). An Evaluation mode qualifier specifies whether to evaluate the parameters as deterministic (Mid) or probabilistic (Prob).  A Data type qualifier specifies whether the parameter should be a number, text, Boolean, or other data type. A Dimension qualifier specifies whether a parameter should be a single value, e.g. a scalar number, or an array, and how many indexes it should have.  &lt;br /&gt;
&lt;br /&gt;
When the actual parameter does not match what the qualifier(s) specify, Analytica will try to convert it to the expected form. For example. it can reduce a high-dimensional array down to arrays with fewer dimensions or a scalar with no dimensions if that's what the function expects the parameter to be.  If a value contains a number, but parameter expects a text, it may be able to coerce (convert) the number to a text.  When it can't convert it, it flags an error.  In this way, qualifiers are very helpful in avoiding errors in function calls, or at least in detecting and reporting them.  &lt;br /&gt;
&lt;br /&gt;
Built-in functions use qualifiers extensively to avoid or detect mismatches between formal and actual parameters.  See the [[Syntax]] segment, to see what the function expects from its parameters. When you write your own [[User-Defined Functions]],  It's a good idea to use qualifiers for any parameter that the function requires to be of a particular class, data type, or dimensions.&lt;br /&gt;
&lt;br /&gt;
By convention, formal parameters (e.g. «a», «i», «o») start with a lowercase letter, global variables and functions (e.g. &amp;lt;code&amp;gt;F, Y, J&amp;lt;/code&amp;gt;) start with an uppercase letter, and qualifiers also start with an uppercase. Analytica doesn't enforce this convention, but it helps clarity in reading functions and models.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
For example, consider a Function F with Parameters specified as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;Parameters: (a: Array Number; i: Index; o: Optional Boolean = False)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We may call the function in an expression as:&lt;br /&gt;
:&amp;lt;code&amp;gt;F(Y^2, J, True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameters, «a», «i», and «o», in the Parameters attribute are termed the ''formal parameters''.  The parameters, &amp;lt;code&amp;gt;Y^2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; in the call to Function F are termed the ''actual parameters.  ''&lt;br /&gt;
&lt;br /&gt;
The qualifiers, '''Array''' '''Number''', after formal parameter «a», require that the actual parameter &amp;lt;code&amp;gt;Y^2&amp;lt;/code&amp;gt; should evaluate to an array of numbers. Parameter &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; should be an Index variable. And «o» should evaluate to a Boolean (or a number that will be treated as a Boolean, i.e., 0 is False and all other numbers are &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;.) Parameter «o» is optional and defaults to &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;, if the call to the function has no actual parameter.&lt;br /&gt;
&lt;br /&gt;
== Object Class Qualifiers ==&lt;br /&gt;
These Qualifiers, including Index, Variable, and Object, specify that the parameter to be the identifier of an object of that [[class]]. Within the function, the parameter contains a [[Handle]] to the object.  It does not evaluate the parameter during the call. The function can operate on the object, including getting an attribute (or assigning to an attribute if the function is called from a script.)&lt;br /&gt;
&lt;br /&gt;
==== Index ====&lt;br /&gt;
Requires the parameter to be the identifier of an Index. It may be a global or [[Local Indexes|local Index]]. The function does not evaluate the Index when it is called, and can use the parameter as an index in internal expressions, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function NormalizeWeights&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Parameters: (x: Number; i: Index)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition: x/Sum(x, i)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A parameter with Index Qualifier must be the identifier of a Variable, but its [[class]] doesn't have to be Index. It also works for other classes of variables if their [[Domain]] is an Index, Discrete, or defined as a List. It also works for a local Index declared as an Index within the Definition calling the function. And it can accept the syntax &amp;lt;code&amp;gt;A.I&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is an array with a local index &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Variable ===&lt;br /&gt;
&lt;br /&gt;
As you might expect, a parameter qualified as Variable, should be the identifier of a Variable.&lt;br /&gt;
&lt;br /&gt;
'''Typical usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(Z: Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[MH: Should we call this Object, since it can refer to any class of Analytica object, not just a Variable? Or would it be better to offer a several such qualifiers, to specify what Class of Object is acceptable? E.g. Module (any module type, including Model, Module, Library), Variable (any Variable type, including Index, Constant, Chance, Decision, and Variable), or Object, that allows an Object of any class.&lt;br /&gt;
Alternatively, we could add Object &amp;lt;Class&amp;gt;, where &amp;lt;class&amp;gt; can be any Analytica class. Should or could you be able to pass an Attribute, or User-defined Function, or System Function to an Object parameter?]&lt;br /&gt;
&lt;br /&gt;
[MH: Please review changes below]&lt;br /&gt;
&lt;br /&gt;
The actual parameter passed to a Variable parameter must be one of:&lt;br /&gt;
* An identifier of an object in the global namespace.&lt;br /&gt;
* An &amp;lt;code&amp;gt;X.I&amp;lt;/code&amp;gt; expression, where &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; holds an array and &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is the identifier of an index of that array.&lt;br /&gt;
* A local variable identifier that is an alias for an object. A local variable is an alias of an object when:&lt;br /&gt;
** It was declared as a Variable or Index parameter.&lt;br /&gt;
** It was assigned a [[Handle]], such as:  &amp;lt;code&amp;gt;Var X := HandleFromIdentifier(&amp;quot;Va1&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variable parameter won't accept a literal text, or a general expression, even if that expression returns a [[Handle]].  This is because the parameter is not actually evaluated as an expression would normally be as an actual parameter not qualified as an Index, Variable, or Object.  For example, in &amp;lt;code&amp;gt;Fu2(X), X&amp;lt;/code&amp;gt; is the identifier of an object, it is not an expression that evaluates to an object.  If the expression were evaluated, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; would have to hold a [[varTerm]].  If you need to use an expression that evaluates to a varTerm, then you would define a local variable to contain the result of that expression and specify the local variable identifier when you call the function.&lt;br /&gt;
&lt;br /&gt;
Within the Definition of the function, the parameter name &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; serves as an alias for the original object, and can be passed to other functions that expect objects (i.e., Variable parameters), such as &amp;lt;code&amp;gt;WhatIf(y, X, x0)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;lt;attrib&amp;gt; Of X&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;X Of o&amp;lt;/code&amp;gt; if X is the name of an Attribute. &lt;br /&gt;
&lt;br /&gt;
A Function called from a [[Script]] (not called from a Variable) can assign to the parameter, &amp;lt;code&amp;gt;X := &amp;lt;expr&amp;gt;&amp;lt;/code&amp;gt;, hence assigning a new definition to the variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; refers to. In other contexts, if &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is in an expression or a parameter to another function that evaluates its parameters, Analytica evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to return its value.&lt;br /&gt;
&lt;br /&gt;
If the object passed in as the parameter is a valid index, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; can be used within the function in an index context, e.g., &amp;lt;code&amp;gt;Sum(expr, X)&amp;lt;/code&amp;gt;.  The Index and Variable qualifiers differ in their behavior when the local variable is used in a value-context and a self-indexed table is passed in.  In a value context, a Variable parameter will evaluate to the value, while an Index parameter evaluates to its index value.&lt;br /&gt;
&lt;br /&gt;
The Variable qualifier is similar to pass-by-reference in other computer languages.  When called from a script (with no caching variables involved), the underlying variable's Value, [[ProbValue]], or other attributes, can be assigned to.  (However, because of a prohibition on side-effects with dependency maintenance, you can't assign to the object when a function is called from a variable evaluation).&lt;br /&gt;
&lt;br /&gt;
If the Variable Qualifier is followed by a Datatype qualifier, such as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3(X: Variable Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Analytica will evaluate &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; when calling &amp;lt;code&amp;gt;Fu3&amp;lt;/code&amp;gt; to check that its value has the specified Datatype. But, in the Definition of &amp;lt;code&amp;gt;Fu3&amp;lt;/code&amp;gt;, it will treat &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; as an unevaluated Variable, as just above.   The Coerce qualifier has no effect on a Variable parameter.&lt;br /&gt;
&lt;br /&gt;
=== LVarType ===&lt;br /&gt;
This qualifier is for internal use by built-in functions.  It is a variation on the Variable qualifier.&lt;br /&gt;
&lt;br /&gt;
=== Object ===&lt;br /&gt;
A parameter with qualified as Object expects the identifier of any user-defined. This may be a Variable, Function, Module, or other class of Object. It is useful for meta-inference about Objects, for example to find the contents of a module. The Object is not evaluated -- which it could not be anyway if it was not a Variable.&lt;br /&gt;
&lt;br /&gt;
'''Typical declaration''':&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(obj: Object)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Typical usage''':&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(MyIdentifier)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The qualifier Handle is closely related to '''Object'''.  The distinction is that Handle is a data type qualifier, while Object is an evaluation mode qualifier.  If you have an expression that returns a handle when evaluated, and you want to pass the resulting handle to a function, then you would use the Handle qualifier.  You would use the Object qualifier only if you want your function to accept an identifier directly without having to surround it within a call to the [[Handle]] function. Compare:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(obj: Object)&amp;lt;/code&amp;gt;           ---   call using:  &amp;lt;code&amp;gt;Fu1(X)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(obj: Handle)&amp;lt;/code&amp;gt;           ---   call using:  &amp;lt;code&amp;gt;Fu2(Handle(X))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Module ===&lt;br /&gt;
''new in [[Analytica 5.0]]''&lt;br /&gt;
Specifies that a module is expected. The calling expression can be a module identifier, text containing the module identifier, or an expression that evaluates to a module identifier or to a textual module name.  Can be used with or without the [[#Atom|atom]] qualifier or other dimensional qualifiers.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(m : Module)&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(m : Module atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
Call using any of these:&lt;br /&gt;
* Fu1(Mo1)&lt;br /&gt;
* Fu1('Mo1')&lt;br /&gt;
* Fu1([[Handle]](Mo1))&lt;br /&gt;
&lt;br /&gt;
=== Class ===&lt;br /&gt;
''new in [[Analytica 5.0]]''&lt;br /&gt;
Specifies that an object Class is expected. This can be the identifier of a class, the textual name of a class, or a handle to the class object. To see a complete list of classes in Analytica, evaluate &amp;lt;code&amp;gt;#[[FindObjects]](class:Object)&amp;lt;/code&amp;gt;. Can be used with or without the [[#Atom|atom]] qualifier or other dimensional qualifiers.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(c:Class)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(c:Class atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
Call using any of these:&lt;br /&gt;
* Fu1(Button)&lt;br /&gt;
* Fu1('Button')&lt;br /&gt;
* Fu1([[Handle]](Button))&lt;br /&gt;
&lt;br /&gt;
=== VarList ===&lt;br /&gt;
Specifies that a function expects a list of variables -- i.e., a list of pointers to Analytica objects.  An example is the second parameter of built-in function [[WhatIfAll]].&lt;br /&gt;
&lt;br /&gt;
'''Related:''' List of Index&lt;br /&gt;
&lt;br /&gt;
If you really want to pass a variable number of Variables as parameters to a function, it is better to use the ellipsis qualifier:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: ... Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, it passes a list of handles to each variable to parameter vars, without evaluating them. Inside the function, vars contains a list of Handles.&lt;br /&gt;
&lt;br /&gt;
When the VarList parameter is used, as with the declarations:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList[I])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: List[I] of Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or with the related declaration:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: List[] of IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:etc.&lt;br /&gt;
&lt;br /&gt;
Then the argument IS evaluated.  The elements of the evaluated result must then be Handles.  If not, an error results.  In normal Analytica usage, it is pretty unusual for a result to evaluate to [[varTerm]]s.  If you use an identifier within an expression, it will evaluate to the underlying value, so it doesn't work to pass a list of identifiers.  For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fu1(vars: VarList)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fu2(vars: ... Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1([Va1, Va2, Va3])&amp;lt;/code&amp;gt;    -- won't work because the list expression [...] will evaluate the variables inside it.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(GetVariableByName([&amp;quot;Va1&amp;quot;, &amp;quot;Va2&amp;quot;]))&amp;lt;/code&amp;gt; -- Good&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2([Va1, Va2, Va3])&amp;lt;/code&amp;gt;    -- good&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(Va1, Va2, Va3)&amp;lt;/code&amp;gt;       -- good, equiv to previous&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(GetVariableByName([&amp;quot;Va1&amp;quot;,&amp;quot;Va2&amp;quot;]))&amp;lt;/code&amp;gt; -- won't work&lt;br /&gt;
&lt;br /&gt;
== Evaluation Mode Qualifiers ==&lt;br /&gt;
=== Mid===&lt;br /&gt;
&lt;br /&gt;
Forces the parameter to be evaluated in [[Mid]] (deterministic) mode, irrespective of the context evaluation mode.&lt;br /&gt;
&lt;br /&gt;
=== Prob ===&lt;br /&gt;
Forces the parameter to be evaluated in Prob (probabilistic) mode, independent of the context evaluation mode.&lt;br /&gt;
&lt;br /&gt;
If your user-defined function applies [[:category:Statistical Functions|statistical functions]] to a parameter, that parameter usually should be declared as Prob or Sample, otherwise your function may yield non-intuitive results.  To illustrate, consider the following [[User-Defined Functions|UDF]] that uses the statistical function [[Mean]], shown two ways, with and without the Prob qualifier.&lt;br /&gt;
:&amp;lt;code&amp;gt;Function MeanMax1(X: Prob; J: Index) := Mean(Max(X, J))&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function MeanMax2(X: Array; J: Index) := Mean(Max(X, J))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the results of applying these function in the following example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Case := 1..3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Chance Damage := Table(Case)(LogNormal(10, 2), LogNormal(7, 3), LogNormal(12, 1.2))&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable E_worst1 := Meanmax1(Damage, Case)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable E_worst2 := MeanMax2(Damage, Case)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables &amp;lt;code&amp;gt;E_worst&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E_worst2&amp;lt;/code&amp;gt; may be evaluated in either [[Mid]] or [[Sample]] mode.  Let's compare:&lt;br /&gt;
:{| class=wikitable&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Expression &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Evaluation Context&lt;br /&gt;
|-&lt;br /&gt;
! Mid !! Sample&lt;br /&gt;
|-&lt;br /&gt;
! Mean(Max(Damage,&amp;quot;Case)) &lt;br /&gt;
| 20.53 || 20.53&lt;br /&gt;
|-&lt;br /&gt;
! MeanMax1(Damage, Case) &lt;br /&gt;
| 20.53 || 20.53&lt;br /&gt;
|-&lt;br /&gt;
! MeanMax2(Damage, Case) &lt;br /&gt;
| 12 || 20.53 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From this table you can see that without the Prob qualifier, the result of &amp;lt;code&amp;gt;MeanMax2&amp;lt;/code&amp;gt; in [[Evaluation Modes|mid mode]] is not the same as &amp;lt;code&amp;gt;Mean(Max(Damage, Case)&amp;lt;/code&amp;gt;.  The potentially counter-intuitive result for &amp;lt;code&amp;gt;Mid(MeanMax2(Damage, Case))&amp;lt;/code&amp;gt; occurs because the first parameter value is obtained by evaluating &amp;lt;code&amp;gt;Damage&amp;lt;/code&amp;gt; in [[Evaluation Modes|mid mode]], yielding the one-dimensional array &amp;lt;code&amp;gt;[10, 7, 12]&amp;lt;/code&amp;gt; indexed by &amp;lt;code&amp;gt;Case&amp;lt;/code&amp;gt;, rather than an array with the full distribution samples.&lt;br /&gt;
&lt;br /&gt;
=== Sample ===&lt;br /&gt;
Like [[Prob]], it forces the parameter to be evaluated in Prob mode, irrespective of the context mode. The only difference is that it gives an error message if the resulting value is not uncertain -- i.e. it does not contain the [[Run]] index.&lt;br /&gt;
&lt;br /&gt;
=== Context ===&lt;br /&gt;
Evaluates the parameter in [[Mid]] or Prob mode, according to the evaluation mode used to evaluate the function being called. Context is the default evaluation mode, if no qualifier ([[Mid]], Prob, or [[Sample]]) is specified, so there is strictly no reason to use it.&lt;br /&gt;
&lt;br /&gt;
=== Unevaluated ===&lt;br /&gt;
Accepts any expression and does not evaluate it. It leaves it up to the function to evaluate it if needed.  It is rarely used within user-defined functions, but is used in various built-in functions, for example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Whatif(e: Unevaluated; v: Variable; x)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ContextSample ===&lt;br /&gt;
Causes the qualified parameter to be evaluated in Prob mode if any of the other parameters to the function are [[Run]]. If not, it evaluates in Context mode -- i.e. Prob or [[Mid]] following the context in which the function is called. &lt;br /&gt;
&lt;br /&gt;
This qualifier is used for the main parameter of most built-in statistical functions. For example, [[Mean]] has these parameters:&lt;br /&gt;
:&amp;lt;code&amp;gt;Mean(x: ContextSample[i]; i: Index = Run)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, &amp;lt;code&amp;gt;Mean(X, Run)&amp;lt;/code&amp;gt; evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; in Prob mode. So does &amp;lt;code&amp;gt;Mean(X)&amp;lt;/code&amp;gt;, because the index &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; defaults to [[Run]]. But, &amp;lt;code&amp;gt;Mean(X, J)&amp;lt;/code&amp;gt; evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; in [[Mid]] mode, because &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; is not [[Run]].  &lt;br /&gt;
&lt;br /&gt;
When the parameter declaration contains more than one dimension, Prob mode is used if ''any'' of the indexes is [[Run]].&lt;br /&gt;
&lt;br /&gt;
== Dimension qualifiers ==&lt;br /&gt;
&lt;br /&gt;
Dimension qualifiers specify the dimensions -- that is, the indexes -- that the function expects for that parameter.  The qualifier ''Atom'' specifies that the parameter value passed to the function must be a single value, with no indexes. &amp;lt;code&amp;gt;(x : Array[Time, I,  J])&amp;lt;/code&amp;gt; qualifies parameter x as having the three indexes listed.  The main reason to use a Dimension qualifier is when the function will not work with parameters with different, usually more dimensions -- usually because it uses one of the  [[Expressions that don't array-abstract]].  It is also of occasional use to conserve memory in a Function that may use a lot of memory temporarily during calculation. If it specifies few or no dimensions for its parameters, it is less likely to run out of memory during computation.&lt;br /&gt;
&lt;br /&gt;
The key point to understand about dimension qualifiers is that they d ''not'' 'require that the actual value passed to the function has exactly those indexes and number of dimensions. Rather, they specify that the Function expects to work on a parameter with those indexes or number of dimensions.  Analytica automatically resolves any mismatch between the dimensions of the actual value and the dimensional qualifier:&lt;br /&gt;
&lt;br /&gt;
* If the actual value has more indexes than specified by the qualifier, it decomposes the value over the extra indexes into slices each with the expected indexes, and calls the function on each slice. It then reassembles the results from each function call into an array with those extra indexes. This reassembled result may also have additional indexes from the individual result of each function call, if that passes through indexes that it uses, or generates new indexes itself.  &lt;br /&gt;
&lt;br /&gt;
* If the actual value of a parameter is missing any expected index(es) specified in the dimensionality qualifier, the function also works fine. Any operation on a value  &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; over an index  &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; when  &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is not indexed by &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; treats &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; as constant over &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;.  For example, the atomic (scalar) number 4 is not indexed by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt;. Suppose time has 10 steps, so: &lt;br /&gt;
:&amp;lt;code&amp;gt;Size(Time) → 10&amp;lt;/code&amp;gt;. &lt;br /&gt;
Then &lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(4, Time) → 40&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When multiple parameters have dimension qualifiers, Analytica coordinates the iteration over each parameter so that indexes impacting multiple parameters are iterated together.&lt;br /&gt;
&lt;br /&gt;
=== Array ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(x : Array[Time, I,  J]; I: Index; J: Optional Index)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Array qualifier defines what indexes the parameter should have when passed to the Function.  It consists of the word ''Array'', followed by a list of one or more indexes in square brackets.  Actually, the ''Array'' is optional, since the list of indexes in square brackets is sufficient. So, these two declarations are the same:&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Numeric Array[Time])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Numeric[Time])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Array qualifier specifies that the parameter is a multi-dimensional array (of zero or more dimensions), and is most importantly used to declare what those dimensions are.  Inside the body of the function, parameter variable is guaranteed to contain no dimensions other than those declared.  Analytica iterates over the function, calling it repeatedly on successive slices when an argument contains extra dimensions, so that this guarantee is satisifed within the function body -- this is the basis for Array Abstraction.&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is indexed by [[Time]], &amp;lt;code&amp;gt;K1,  K2&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K3&amp;lt;/code&amp;gt; and that a function having the above Typical Usage declaration is called as &amp;lt;code&amp;gt;F(A, K1)&amp;lt;/code&amp;gt;.  Analytica will iterate over all combinations of &amp;lt;code&amp;gt;K2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;K3&amp;lt;/code&amp;gt;, slicing &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; for each combination and calling &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; each time with parameter &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; indexed only by [[Time]] and &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; (where parameter &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is an alias for &amp;lt;code&amp;gt;K1&amp;lt;/code&amp;gt; inside the function Definition).&lt;br /&gt;
&lt;br /&gt;
An array declaration does not add in dimensions, so for example, if in the earlier example, if the function were called using: &amp;lt;code&amp;gt;F(5, In1)&amp;lt;/code&amp;gt;, inside the function body &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; will be the scalar 5 -- the dimensions [[Time]] and &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; are not automatically added to the parameter.  However, since for all [[Array Abstraction|array-abstractable]] functions, 5 is equivalent to an array containing 5 for every element, computations will usually remain equivalent (and sometimes more efficient) even if the argument does not contain the dimension.  The [[All]] keyword (described elsewhere on this page), used in conjunction with a dimensionality declaration.&lt;br /&gt;
&lt;br /&gt;
When you define a function using [[Procedural Programming|procedural programming]] constructs, like [[While]] or or a local index with [[Sequence]]()  that require their parameters to be Atoms, it is a good idea to qualify the dimensions of each function parameter that might affect them.  The function will then array-abstract properly, and continue work if you add dimensions to the model later.&lt;br /&gt;
&lt;br /&gt;
=== Atom ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies that the parameter is atomic -- a single element.  If an array is passed to this parameter, Analytica will iterate over its dimensions so that at each call the parameter value is guaranteed to consist of a single element, typically a number, text string, a reference, or the value [[Null]].  &lt;br /&gt;
&lt;br /&gt;
In esoteric cases, some internal data types can also be passed, which could theoretically include an parsed expression structure, a varset, a data blob (such as an image), a [[Optimization_Characteristics#Parts_of_a_Linear_Program_.28LP.29|LP]], [[Optimization_Characteristics#Parts_of_a_Quadratic_Program_.28QP.29|QP]] or [[Optimization_Characteristics#Parts_of_a_Non-Linear_Program_.28NLP.29|NLP]] problem-specification object.&lt;br /&gt;
&lt;br /&gt;
Because an atom is considered to be a zero-dimensional array, the atomic qualifier is functionally equivalent to the Array qualifier with zero indexes, i.e.:&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Array[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[Objects_and_Values#Values|Atomic values]] and [[Atomic..Do]].&lt;br /&gt;
&lt;br /&gt;
=== Scalar ===&lt;br /&gt;
'''Typical usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Scalar qualifier is an alias for &amp;quot;Number Atom&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Vector ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Vector[I]; I: Optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The vector qualifier specifies that the argument passed must contain at least one dimension, even if that dimension is not explicitly specified.  When there is an explicit index provided, the behavior is the same as the Array qualifier.  The distinguishing behavior occurs when no index is specified, such as when an optional index is omitted in the typical preceding typical usage.  In such a case, array abstraction is applied to a vector parameter until a single dimension remains, while in the case of Array it would be applied until the parameter is scalar.  When the parameter contains multiple dimensions, the default single remaining dimension will be the canonically first dimension.  If no index can be identified, an error results.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1 (X: Vector[I, J]; I, J: optional IndexType)&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2 (X: Array [I, J]; I, J: optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3 (X : Vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := (indexed by In1 and In2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dimensionality of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; within function body:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is atomic. Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A, In2)&amp;lt;/code&amp;gt; =&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A, In1, In2)&amp;lt;/code&amp;gt; =&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1([A, A^2])&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is a null-indexed list of atoms.  Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2([A, A^2])&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is atomic.  Iterates over null-list, &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;[[Media:Array vs Vector.ANA|Download example model]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the example illustrate the difference between Vector and Array qualifiers.&lt;br /&gt;
&lt;br /&gt;
Many built-in Analytica functions that operate on 1-D parameters act as if they are declared in this fashion (internally not all built-in functions use the newer parameter scheme documented here). These include [[Sum]], [[Min]], [[Max]], [[Product]], [[Cumulate]], [[Uncumulate]], [[CumProduct]], etc.&lt;br /&gt;
&lt;br /&gt;
=== List ===&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List All [ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List[I]; I: IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The List parameter qualifier is a variation of the Array qualifier that is used when a null-indexed dimension is expected, and the function does not want array abstraction it iterate over and remove that dimension before evaluating the function.&lt;br /&gt;
&lt;br /&gt;
The array qualifier has no syntactic variation that allows you to the [[Null]]-dimension within the list of dimensions.  The so-called Null-dimension does not really correspond to an actual Analytica object, but rather is a term that refers to a list.  But, essentially, a declaration &amp;lt;code&amp;gt;List[I, J]&amp;lt;/code&amp;gt; would be the conceptual equivalent of &amp;lt;code&amp;gt;Array[NullDim, I, J]&amp;lt;/code&amp;gt;.  It declares that the parameter may be indexed by the null-dimension, &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.  Without the All qualifier, none of these dimensions are required, but they are the only ones allowed.&lt;br /&gt;
&lt;br /&gt;
As is the case with the [[Array]] qualifier, a [[List]] declaration with no brackets is allowed but not particularly useful, since it doesn't restrict the dimensionality of the parameter.&lt;br /&gt;
&lt;br /&gt;
The declaration &amp;lt;code&amp;gt;(L : List[ ])&amp;lt;/code&amp;gt; specifies that only the null-dimension is allowed.  If the argument is not a list, then L will be atomic at each function invocation.  If the argument has a null-dimension, then all other dimensions are iterated, with only the null-dimension passed to the function.&lt;br /&gt;
&lt;br /&gt;
When the [[All]] qualifier is included, as in &amp;lt;code&amp;gt;(L: List All[I])&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;(L : List All[ ])&amp;lt;/code&amp;gt;, then both the specified index(es) and the null-index are required.  When a null-index is added, Analytica has no reference index object to determine its length, so a null-list of length one is added.&lt;br /&gt;
&lt;br /&gt;
When the list qualifier is used in conjunction with the Variable or Index qualifiers, a somewhat different treatment results.  For these cases, see the [[VarList]] qualifier.  &amp;quot;Variable List&amp;quot; or &amp;quot;List of Variable&amp;quot; is synonymous with VarList.&lt;br /&gt;
&lt;br /&gt;
=== All ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array All[I, J])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The All qualifier is used with Array, Vector, or List to specify that the function requires all listed indexes to be present.  Without All, it allows, but does not require that the parameter has these dimensions.  With All , the function body is guaranteed that the parameter has all and exactly the listed dimensions.&lt;br /&gt;
&lt;br /&gt;
If an argument to an array parameter has extra indexes not listed, they are iterated, whether or not the [[All]] qualifier is present.  If any named index(es) is (are) not an index of the actual parameter, it adds the index(es) as a dimension, repeating the value of the parameter across the added dimension(s).  Internally, it represents them as ''sparse dimensions'', so that there is little memory or time penalty involved in passing the extra dimensions; however, if the function operates over that dimension, intermediate or final results may require more memory, because for example, intermediate values may no longer be constant over those dimensions.&lt;br /&gt;
&lt;br /&gt;
=== Reduced ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A, B: Array[I]; C:Array[J]; D: Reduced)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a parameter is declared with the Reduced keyword, it is sliced along any dimensions that are iterated as a result of dimensionality declarations on other parameters.  For example, with the preceding declaration, suppose that the function is called with &amp;lt;code&amp;gt;A[I, J], B[I, K], C[J, K]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;D[I, J, K]&amp;lt;/code&amp;gt;.  Then Analytica will iterate over &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; (for parameter &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;) and over &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; (for parameters &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt;).  &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt; will thus be reduced by dimensions &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;, so that within the function body, &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt; will be remain dimensioned only by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a parameter is declared as Reduced, no index dimensions can be declared.  In other words, &amp;lt;code&amp;gt;D : Reduced[I]&amp;lt;/code&amp;gt; would result in an error.&lt;br /&gt;
&lt;br /&gt;
An example situation where the Reduced qualifier is useful is the following.  Suppose a function can compute multiple related results.  A parameter, computation, indicates which result is desired, e.g.:&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Process(A: Numeric[I]; I: Index; computation: Reduced)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the function, Process can examine the computation parameter to determine exactly which computations need to be done.  If the same computation is requested several times (for the same iteration along A), work does not need to be repeated, and if two computations share 90% of a computation, the function can leverage this fact, which it would not be able to do if these were done on separate iterations.&lt;br /&gt;
&lt;br /&gt;
== Data type qualifiers ==&lt;br /&gt;
A Data Type, such as Number, Positive Negative, Text, or Reference, is a qualifier to specify the expected type of value of a parameter.  If the parameter doesn't have the specified type when the function is called, it gives an evaluation error. If the parameter is an array, it checks that every cell of the array is of the expected type. You can combine a Data type qualifier with an Array type qualifier, such as Vector, Array, or [I], or with object qualifier, such as Index.  The qualifier Coerce requests that, if the parameter has a different type, Analytica should try to convert it to the desired type if possible -- e.g. convert a number to a text. The data type is optional.  A small performance penalty is incurred at the time of a function call when the data type is specified.&lt;br /&gt;
&lt;br /&gt;
=== Number ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a number (which includes [[INF]], -[[INF]], or [[NaN]]), or an array of numbers.&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(s: Text)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a text value (which includes empty text ''), or an array of text values.&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(r: Reference)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a Reference, or an array of references. &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; must be a reference, or an array of references. Each reference may refer to any type of value or object without restriction.&lt;br /&gt;
&lt;br /&gt;
=== Positive ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Positive)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A positive number, which could include [[INF]], but not [[NaN]].&lt;br /&gt;
&lt;br /&gt;
=== NonNegative ===&lt;br /&gt;
Zero or a positive number, which could include [[INF]], but not [[NaN]].&lt;br /&gt;
&lt;br /&gt;
=== Handle ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(v: Handle)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects a handle to an object or an array of handles.  These functions [[Handle]], [[HandleFromIdentifier]], [[IndexesOf]] return handles. You can also get a handle from the [[Contains]] or [[IsIn]] Attributes of an object, or an Array of Handles from the Inputs, Outputs, or Contains Attributes of an Object.  Handles are used in [[Meta-Inference]].  The [[Handle]] qualifier is a different from the Variable, Index or Object qualifiers in that its parameter is typically evaluated.  The Handle qualifier specifies the expected the data type, not the evaluation mode.&lt;br /&gt;
&lt;br /&gt;
=== Color ===&lt;br /&gt;
(''new to ''[[Analytica 5.0]]'')&lt;br /&gt;
&lt;br /&gt;
A color can be either a color integer or a textual color name.  A color integer is most conveniently written in hex notation as 0xaarrggbb or 0xrrggbb, where ''aa'' is the alpha value, rr the red value, ''gg'' the green value, and ''bb'' the blue value. For example, &amp;lt;code&amp;gt;0x80c0257d&amp;lt;/code&amp;gt; has an alpha of 0x80, a red of 0xc0, a green of 0x25 and a blue of 0x7d. A color name is a color name in English, such as 'Red', 'Yellow', 'Green', or 'Brown'. See [[Color parameters]] for a full list of color names.&lt;br /&gt;
&lt;br /&gt;
=== Coerce &amp;lt;type&amp;gt; ===&lt;br /&gt;
If possible, it converts the value of the parameter into the desired type, Text or Number, as specified. &lt;br /&gt;
&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(t : Coerce Text; x: Coerce Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When coercing a number to Text, it uses the number format of the Variable or Function that calls the function which coerces its parameter(s)-- not the number format of the called function. &lt;br /&gt;
:&amp;lt;code&amp;gt;Function Result_text(x: Coerce Text) := 'The result is ' &amp;amp; x&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Y := Result_text(12345.678)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; uses Analytica's default Number Format, which is suffix format with 4 significant digits, it gives&lt;br /&gt;
:&amp;lt;code&amp;gt;Y -&amp;gt; 'The result is 12.35K'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But if the Number format of Y was set to Fixed point with 2 decimal digits and commas, it gives&lt;br /&gt;
:&amp;lt;code&amp;gt;Y &amp;amp;rarr; 'The result is 12,345.68'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When coercing from Text to Number, it tries to parse text containing numbers using the number format. &lt;br /&gt;
&lt;br /&gt;
Coercion to a reference returns a reference to an atomic value (text or number) that is not already a reference. &lt;br /&gt;
Coercing an array to a reference returns an array of references to the elements of the array.&lt;br /&gt;
&lt;br /&gt;
In all cases, if a coercion is not possible (including when a text does not contain a valid number), it flags an evaluation error.&lt;br /&gt;
&lt;br /&gt;
== Ordering Qualifiers ==&lt;br /&gt;
&lt;br /&gt;
=== Ascending ===&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A : Ascending[I])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L : Ascending List[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(I : Ascending IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ascending qualifier specifies that the values of a list, vector, array, or index must be in non-strictly ascending order.  Use of this qualifier requires that the declaration specifies a one-dimensional parameter.   Without one dimension, the index over which it must be ascending is ambiguous, and hence an error is issued.&lt;br /&gt;
&lt;br /&gt;
The test triggers an error if any element is less than the value that precedes it. The test is non-strict, so that a constant array, or an element equal to its predecessor, does not trigger an error.  There is no parameter qualifier variation that tests for strict ascending order.&lt;br /&gt;
&lt;br /&gt;
=== Descending ===&lt;br /&gt;
The descending qualifier specifies that the values of a list, vector, array, or index must be in non-strictly descending order.  It is the exact dual of the Ascending parameter qualifier -- see the description above for Ascending for details.&lt;br /&gt;
&lt;br /&gt;
== Optional and repeated parameters ==&lt;br /&gt;
=== Optional qualifier ===&lt;br /&gt;
'''Typical uses:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F1(x: optional)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F2(a: Array[I]; i: optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F3(a: Optional = 0; b := 99)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''Optional'' qualifier specifies that a parameter is optional.  If the function is called with no value, the parameter has the value Undefined inside the function. You can test if the value is undefined with functions [[Data_Type_Functions#IsNotSpecified|IsNotSpecified]](...) or IsUndef(...). &lt;br /&gt;
&lt;br /&gt;
You can provide a different default using an equal sign,  as in the example, &amp;lt;code&amp;gt;a: = 0&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;F3&amp;lt;/code&amp;gt; above.  In that case, the parameter gets the specified default if none is provided when you call it.&lt;br /&gt;
&lt;br /&gt;
The function, you can pass a parameter declared as optional as a argument to another function having an optional parameter.  If the parameter is not specified to the first function, it will appear to the second function as if it is not specified as well.  Within the body, should the parameter variable itself be used, it contains the special system value Undefined.&lt;br /&gt;
&lt;br /&gt;
Optional can be applied to values or indexes.  Using the optional qualifier on index parameters causes array parameters using that index to be of variable dimensionality.&lt;br /&gt;
&lt;br /&gt;
Note: Use of the ellipsis qualifier, or the inclusion of a default value, are alternative means to specify optional or variable-length parameter lists.&lt;br /&gt;
&lt;br /&gt;
=== Default values ===&lt;br /&gt;
'''Syntax:''' &amp;lt;code&amp;gt;ident: qualifiers = defaultValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Typical Usages''':&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Optional Number = 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Number = 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: ContextSample[R]; R: Index = Run)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify a default value to be used for an optional parameter when the parameter is omitted when calling the function. In the parameters, you simply include &amp;lt;code&amp;gt; = &amp;lt;defaultVal&amp;gt;&amp;lt;/code&amp;gt; in the qualifier.  If you specify a default in this way, you don't need to include the &amp;quot;Optional&amp;quot; qualifier since it is implied.  For a value parameter, the optional value should usually be a literal, a number or text. You may use an expression, but we don't recommend it.   For an Index or Variable parameter, the optional value must identify an index or variable.  For one of these Unevaluated parameter types, the default could be another parameter of that type declared earlier in the parameters list.&lt;br /&gt;
&lt;br /&gt;
For an index parameter you may specify the default as code&amp;gt;Common&amp;lt;/code&amp;gt;, meaning that the default  the index common to all array parameters using that index.  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;(P, R: Array[I]; I: Index = Common)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the parameters passed for &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; must share exactly one index if &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is not specified.&lt;br /&gt;
&lt;br /&gt;
=== Repeated parameters (...) ===&lt;br /&gt;
'''Typical Usages''':&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: ... Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I] ; I : ... IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Three dots &amp;quot;...&amp;quot; qualifies a parameter as repeated: The function accepts one or more actual parameters of the given type.  If you combine &amp;quot;...&amp;quot; with Optional, it accepts ''zero'' or more parameters -- instead of requiring at least one parameter. Within the function, an repeated parameter is a list (with [[Null]] index) containing the actual parameters given. For example,&lt;br /&gt;
:&amp;lt;code&amp;gt;Function ValMax(x: ... Number) := Max(X)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ValMax(3, 6,-2, 4) &amp;amp;rarr; 6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ValMax()&amp;lt;/code&amp;gt; returns the maximum value of its repeated parameter. Unlike the built-in [[Max]] function, it doesn't need square brackets around its parameters. During evaluation of &amp;lt;code&amp;gt;ValMax&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is the null-indexed list &amp;lt;code&amp;gt;[3, 6,- 2, 4]&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;ValMax&amp;lt;/code&amp;gt; could also be applied to array arguments, such as &lt;br /&gt;
:&amp;lt;code&amp;gt;ValMax(Sqrt(X), X^2, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Total(a: Array[I]; i: ... IndexType)&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
sums its parameter, a, over one or more dimensions -- a generalization of Sum(A,I).  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Total(A, I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is equivalent to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Sum(A, I), J), K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Actually, the built-in Function [[Sum]], and other [[array-reducing functions]], including [[Product]], [[Min]], [[Max]], [[Average]], already allow you to provide a list of indexes to work over.)&lt;br /&gt;
&lt;br /&gt;
Inside the body of &amp;lt;code&amp;gt;Total&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; would be an array containing the [[Null]]-index, along with all dimensions listed in the &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
You can specify an array parameter with a variable number of explicit indexes, by using the ellipsis on an index parameter, e.g:&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I]; I: ... Optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A parameter passed to an repeated parameter may NOT be indexed by [[Null]].  (However, an explicit bracket syntax can be used to group a variable number of arguments in the call, see examples below).&lt;br /&gt;
&lt;br /&gt;
Several syntaxes may be used when calling a function containing an repeated parameter.  When the parameter is named in the call, then all arguments that follow are considered to be instances of that parameter up until another parameter name is indicated.  For example, in the declaration&lt;br /&gt;
You may use several methods to specify the actual parameters to a function with repeated parameters. For this function:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fxy(X: ... scalar; Y: ... Optional Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you may give the repeated parameter by name:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy(X: 1, 2, 3, 4, Y: 5, 6, 7)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use position and naming only the second parameter Y:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy(1, 2, 3, 4, Y: 5, 6, 7)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the first four are treated as parameters to X. You needed to specify parameter Y by name, to make clear that the second four are elements of Y.&lt;br /&gt;
&lt;br /&gt;
You may also use square brackets with pure positional syntax:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy([1, 2, 3, 4], [5, 6, 7])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The brackets prevent any ambiguity.&lt;br /&gt;
&lt;br /&gt;
Repeated parameters for indexes are useful to enable a variable number of dimensions for an array parameter. However, you cannot (currently) use the individual indexes explicitly from within the user-defined function.  You could implement the &amp;lt;code&amp;gt;Total&amp;lt;/code&amp;gt; function above as:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(A)))))))))))))))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which would work up to 15 dimensions (the maximum # of dimensions allowed in Analytica anyway), but note that the indexes are not specified explicitly.  It would be difficult currently to use the I parameter in the function itself.&lt;br /&gt;
&lt;br /&gt;
Note that Repeated indexes can be mixed with non-Repeated indexes in array declarations, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I, J]; I: IndexType; J: ... IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function requires two or more indexes: &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; and one or more instances of &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== '''Using Index with Optional and Repeated Qualifiers''' ===&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index&amp;lt;/code&amp;gt; -- The function requires an index parameter&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Optional Index&amp;lt;/code&amp;gt; -- the function can accept an Index parameter, but it is optional.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index = J&amp;lt;/code&amp;gt; -- the function can accept an Index parameter. If omitted it defaults to &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.  Using &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; to specify a default value implies the parameter is optional, even if the keyword &amp;lt;code&amp;gt;Optional&amp;lt;/code&amp;gt; is omitted.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index = Run&amp;lt;/code&amp;gt; -- the function can accept an Index parameter. If omitted it defaults to [[Run]]].&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Repeat Index&amp;lt;/code&amp;gt; -- the function expects a list of one or more Index parameters.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: ... Optional Index&amp;lt;/code&amp;gt; -- the function expects a list of zero or more Index parameters. Ellipsis &amp;quot;...&amp;quot; is a synonym for&amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use a local variable that refers to an Index:&lt;br /&gt;
:&amp;lt;code&amp;gt;VAR v := GetVariableByName(&amp;quot;In1&amp;quot;) DO Fu1(v)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is equivalent to &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(In1)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You cannot specify a general expression where an Index is required, so you could not compose the above to: &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(GetVariableByName(&amp;quot;In1&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Qualifiers ==&lt;br /&gt;
=== Hidden ===&lt;br /&gt;
When marked as hidden, a parameter does not appear in the object finder dialog, or when pasting the definition via the definition menu.  The parameter, however, is there and can be specified in a function call.&lt;br /&gt;
&lt;br /&gt;
Internally Analytica makes use of hidden parameters in the following construct:&lt;br /&gt;
:&amp;lt;code&amp;gt;(A; exprA: hidden unevaluated = A)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows the underlying implementation access to the expression for &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, while still receiving the evaluated parameter &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; (suitably iterated and typechecked if other qualifiers are attached to &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Of ===&lt;br /&gt;
The [[Of]] qualifier is ignored by the parameter qualifier parser, but can be included within qualifier list for stylistic preference, such as:&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Ascending Array[I, J] of Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L : List of Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as equivalent alternatives to &lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Ascending Number Array[I,J])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Number List)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so on.  Note that qualifiers can appear in any order, and contain various aliases (such as Numeric or Numbers) to make either stylistic variation sensible, depending on user preference.&lt;br /&gt;
&lt;br /&gt;
=== Deprecated Synonyms for Parameter Qualifiers ===&lt;br /&gt;
&lt;br /&gt;
We originally defined synonyms for some parameter qualifiers, thinking it would let you specify parameter lists more flexibly. In practice, users found it harder to recognize and remember so many terms, so we have chosen one preferred term for each qualifier and deprecate the others -- i.e. we advise you not to use them. Please use the preferred terms, since the deprecated ones may not be supported in future releases.&lt;br /&gt;
&lt;br /&gt;
For the benefit of those looking at old Analytica code, here are the synonyms, after the recommended term for each qualifier:&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Recommended term&lt;br /&gt;
!Synonyms&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt;&lt;br /&gt;
|ArrayType, Arr&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|IndexType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Prob&amp;lt;/code&amp;gt;&lt;br /&gt;
|Probabilistic, ProbType,  Uncertain&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Sample&amp;lt;/code&amp;gt;&lt;br /&gt;
|Samp, SampType, SampleType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Mid&amp;lt;/code&amp;gt;&lt;br /&gt;
|Determ, DetermType, DetermMode, MidMode&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Context&amp;lt;/code&amp;gt;&lt;br /&gt;
|Expr, ContextType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Unevaluated&amp;lt;/code&amp;gt;&lt;br /&gt;
|Expression&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;ContextSample&amp;lt;/code&amp;gt;&lt;br /&gt;
|ContextSamp, MaybeSamp, MaybeSample&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Variable&amp;lt;/code&amp;gt;&lt;br /&gt;
|VariableType, Var, VarType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;VariableList&amp;lt;/code&amp;gt;&lt;br /&gt;
|VarList, Variable List, List of Variable&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Atom&amp;lt;/code&amp;gt;&lt;br /&gt;
|Atomic, AtomicType, AtomType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Scalar&amp;lt;/code&amp;gt;&lt;br /&gt;
|ScalarType, Scalars&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Vector&amp;lt;/code&amp;gt;&lt;br /&gt;
|VectorType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;List&amp;lt;/code&amp;gt;&lt;br /&gt;
|ListType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Number&amp;lt;/code&amp;gt;&lt;br /&gt;
|Numeric, Numbers, NumberType, NumericType, Num, Real, Boolean&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|Textual, TexType, TextType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Reference&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ref, RefType, ReferenceType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;NonNegative&amp;lt;/code&amp;gt;&lt;br /&gt;
|PositiveOrZero, NotNegative&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Coerce&amp;lt;/code&amp;gt;&lt;br /&gt;
|Coerced&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Optional&amp;lt;/code&amp;gt;&lt;br /&gt;
|opt&lt;br /&gt;
|}&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Parameter qualifiers]]&lt;br /&gt;
* [[ParameterEnumeration]]&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Repeated Parameter Forwarding]]&lt;br /&gt;
* [[User-Defined Functions]]&lt;br /&gt;
* [[User-defined Functions and Libraries]]&lt;br /&gt;
* [[Class]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Valentine%27s_Date.ana&amp;diff=52541</id>
		<title>File:Valentine's Date.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Valentine%27s_Date.ana&amp;diff=52541"/>
		<updated>2019-02-14T01:11:46Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Optimal stopping theory applied to a Valentine's Date problem, simulating expected results and time spent. Corresponds to Feb 14, 2019 blog post.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Optimal stopping theory applied to a Valentine's Date problem, simulating expected results and time spent. Corresponds to Feb 14, 2019 blog post.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Repeated_Parameter_Forwarding&amp;diff=52539</id>
		<title>Repeated Parameter Forwarding</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Repeated_Parameter_Forwarding&amp;diff=52539"/>
		<updated>2019-02-13T18:48:29Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Corrected typo.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Functions]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Repeated parameter forwarding lets you pass a list of items to a repeated function parameter. A repeated function parameter, with qualifier &amp;quot;...&amp;quot; accepts one or more parameters of the specified type. If you don't know about [[Repeated parameters|repeated parameters]], you may want to first read [[Function_Parameter_Qualifiers#Repeated_parameters_.28....29|Repeated parameters]] section of [[Function Parameter Qualifiers]].&lt;br /&gt;
&lt;br /&gt;
== Basic idea ==&lt;br /&gt;
Consider this [[User-Defined Function]]:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function TreeNode(x; children:...)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition: Array(TreeNodeIdx, [x, \children])&amp;lt;/code&amp;gt;&lt;br /&gt;
where &lt;br /&gt;
:&amp;lt;code&amp;gt;Index TreeNodeIdx := ['value', 'children']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;code&amp;gt;TreeNode(1, 2, 3, 4)&amp;lt;/code&amp;gt; creates this data structure:&lt;br /&gt;
&lt;br /&gt;
:[[image:SmallTree.png]]&lt;br /&gt;
&lt;br /&gt;
The repeated parameter, «children», allows you to list as many children as you'd like, without having to make use of square brackets in the syntax.  Hence, we could built a multi-level tree using:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;TreeNode(1, TreeNode(2, 5, 6), TreeNode(3, 7, 8, 9, TreeNode(10, 11, 12, 13)), 4)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[image:MultiLayerTree.png]]&lt;br /&gt;
&lt;br /&gt;
Now suppose you have some expression -- say, &amp;lt;code&amp;gt;F()&amp;lt;/code&amp;gt; -- that computes and returns a list of &amp;quot;nodes&amp;quot;, and you want to create a tree node having this set of nodes as the children, with 7 as the root. Your expression doesn't know what &amp;lt;code&amp;gt;F()&amp;lt;/code&amp;gt; will return, or even how many children it will return, but for illustration let's pretend it returns &amp;lt;code&amp;gt;[1, 2, 3]&amp;lt;/code&amp;gt;.  Your first attempt might be&lt;br /&gt;
:&amp;lt;code&amp;gt;TreeNode(a, F())&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This produces an error, because you cannot pass a list value to a repeated parameter; however, logically what you are actually doing here is producing the wrong tree, which would actually be&lt;br /&gt;
&lt;br /&gt;
:[[image:OneChildTree.png]]&lt;br /&gt;
&lt;br /&gt;
The call is providing one instance of the repeated parameter, hence one child node.  The value of that child node is the list of values. What we really want is to be able to pass three instances of the «children» parameter to the function, basically&lt;br /&gt;
:&amp;lt;code&amp;gt;TreeNode(7, Slice(F(),1), Slice(F(),2), Slice(F(),3))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would work if we knew that &amp;lt;code&amp;gt;F()&amp;lt;/code&amp;gt; would return 3 values -- but [[Repeated_Parameter_Forwarding|Repeated parameter forwarding]] lets us handle this when we don't know how many items &amp;lt;code&amp;gt;F()&amp;lt;/code&amp;gt; will to return. To ''forward'' the result of &amp;lt;code&amp;gt;F()&amp;lt;/code&amp;gt; to the repeated parameter, we preface it with three dots&lt;br /&gt;
:&amp;lt;code&amp;gt;TreeNode(7, ...F())&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three dots (or ellipsis, which matches the three dots used when declaring a repeated parameter) indicate that we want each item in the computed result to be passed as one instance of the repeated parameter.  When you use this syntax, the expression following the three dots must produce a list or a 1-D array.&lt;br /&gt;
&lt;br /&gt;
Be aware that &amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt; is part of the expression -- not that we've omitted something!&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
=== Operating over all indexes of an array ===&lt;br /&gt;
&lt;br /&gt;
Several built-in functions accept a repeated index parameter, so that you can apply them over multiple dimensions, such as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(X, I, j, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
Other such functions, besides [[Sum]], include [[Max]], [[Min]], [[ArgMax]], [[ArgMin]], [[CondMax]], [[CondMin]], [[Average]], [[Product]], and [[Array]]. &lt;br /&gt;
&lt;br /&gt;
Sometimes you'd like to apply these functions over every index of an array.  Parameter forwarding makes it easy, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(A,...IndexesOf(A))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this sometimes violates the [[Expressions_that_don%27t_array-abstract#Principle_of_Array_Abstraction|principle of array abstraction]], which could limit the flexibility of your model.  So you should be careful with this.&lt;br /&gt;
&lt;br /&gt;
=== Creating a constant array over computed dimensions ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is useful to create a constant array over a set of indexes. You can do this using, e.g, &amp;lt;code&amp;gt;Array(I, J, 0)&amp;lt;/code&amp;gt;, to create an array on indexes I and J having the value 0 everywhere.  But what if the set of indexes is computed?  Here is an example&lt;br /&gt;
:&amp;lt;code&amp;gt;Array( ...#SetDifference(\IndexesOf(A), \IndexesOf(B)), 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates an array containing all the indexes of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; that are not also indexes of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, with all values 0.&lt;br /&gt;
&lt;br /&gt;
=== Forwarding a repeated parameter in a user-defined function===&lt;br /&gt;
&lt;br /&gt;
Sometimes it's useful to wrap an existing function with a [[User-Defined Function]] that you create.  For example, if an existing function does most of what you want, but doesn't treat [[Null]] values the way you like, has a bug you need to work around, or for some other reason you might create your own variation.  The original function might have a bunch of parameters that you just simply want to forward to the original function. When the parameter being forwarded is a repeated parameter, you need to use the repeated parameter forwarding syntax.&lt;br /&gt;
&lt;br /&gt;
The [[User-Defined Function]] &amp;lt;code&amp;gt;AbsMax&amp;lt;/code&amp;gt; here accepts the same parameters as [[Max]], but returns the maximum of the absolute value. It is essentially a wrapper of the [[Max]] function -- we copy the parameter declaration for Max:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background:white; border:white; margin-left: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
Function AbsMax(X; I: ... recommended Index WarnDynamic; IgnoreNonNumbers, IgnoreNaN: optional named atomic boolean; caseInsensitive: optional atomic boolean)&lt;br /&gt;
Definition: Max(Abs(X),...I, IgnoreNonNumbers, IgnoreNaN, caseInsensitive)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To forward the repeated parameter, we need the ... in front of I, otherwise it would look like one parameter instance.&lt;br /&gt;
&lt;br /&gt;
=== Computing a set of decisions or constraints for DefineOptimization ===&lt;br /&gt;
&lt;br /&gt;
The [[DefineOptimization]] function accepts a list of decision and constraint nodes as repeated parameters. If you decide to get fancy, you might decide to create an interface, or some logic, that computes which constraints or decisions should be active.  [[Repeated Parameter Forwarding|Repeated parameter forwarding]] allows you to provide a computed list of decisions or [[DefineOptimization#Constraints|constraints]] to the optimization declaration, e.g.&lt;br /&gt;
&amp;lt;code&amp;gt;[[DefineOptimization]](decisions: ...ActiveDecisions, constraints: ...ActiveConstraints, maximize: myObjective )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that although the two parameters normally look for object identifiers, here the identifier &amp;lt;code&amp;gt;ActiveDecisions&amp;lt;/code&amp;gt; is actually the variable that computes which decisions to use (as a 1-D array or list), and not one of the decision nodes.  Similarly for &amp;lt;code&amp;gt;ActiveConstraints&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Introduced in [[Analytica 4.5]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Function_Parameter_Qualifiers#Repeated_parameters_.28....29|Repeated parameters]]&lt;br /&gt;
* [[Function Parameter Qualifiers]]&lt;br /&gt;
* [[Parametric Analysis]]&lt;br /&gt;
* [[IndexesOf]]&lt;br /&gt;
* [[DefineOptimization#Constraints|Constraints]]&lt;br /&gt;
* [[DefineOptimization]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Function_parameter_qualifiers&amp;diff=52538</id>
		<title>Function parameter qualifiers</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Function_parameter_qualifiers&amp;diff=52538"/>
		<updated>2019-02-13T18:46:48Z</updated>

		<summary type="html">&lt;p&gt;KMullins: /* Repeated parameters (...) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Functions]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
Parameter qualifiers are keywords used in the Parameters attribute of a function to specify what kind of value or object the function expects: &lt;br /&gt;
*'''Class Qualifiers''', such as '''Index''' and '''Variable''', specify what class of Object is expected.&lt;br /&gt;
*'''Evaluation mode qualifiers''', such as '''Mid''' and '''Prob''', control whether to evaluate a parameter as deterministic or probabilistic.&lt;br /&gt;
*'''Data type qualifiers''', such as '''Number''', '''Text''', '''Reference''', and '''Handle''', specify the expected data type.&lt;br /&gt;
*'''Dimension qualifiers''', such as '''Atom''', '''List''', '''Array''', and '''[i]''', specify the expected dimensions and indexes to support array abstraction.&lt;br /&gt;
* '''Optional''' (or '''=''' with default) and '''Repeated''' (or ...) specify whether a parameter is optional or may be repeated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why use qualifiers? ==&lt;br /&gt;
&lt;br /&gt;
Parameter qualifiers help make sure that each parameter gets the kind of value or object that the function expects. A Class qualifier specifies the expected class (Index, Variable, or other object class). An Evaluation mode qualifier specifies whether to evaluate the parameters as deterministic (Mid) or probabilistic (Prob).  A Data type qualifier specifies whether the parameter should be a number, text, Boolean, or other data type. A Dimension qualifier specifies whether a parameter should be a single value, e.g. a scalar number, or an array, and how many indexes it should have.  &lt;br /&gt;
&lt;br /&gt;
When the actual parameter does not match what the qualifier(s) specify, Analytica will try to convert it to the expected form. For example. it can reduce a high-dimensional array down to arrays with fewer dimensions or a scalar with no dimensions if that's what the function expects the parameter to be.  If a value contains a number, but parameter expects a text, it may be able to coerce (convert) the number to a text.  When it can't convert it, it flags an error.  In this way, qualifiers are very helpful in avoiding errors in function calls, or at least in detecting and reporting them.  &lt;br /&gt;
&lt;br /&gt;
Built-in functions use qualifiers extensively to avoid or detect mismatches between formal and actual parameters.  See the [[Syntax]] segment, to see what the function expects from its parameters. When you write your own [[User-Defined Functions]],  It's a good idea to use qualifiers for any parameter that the function requires to be of a particular class, data type, or dimensions.&lt;br /&gt;
&lt;br /&gt;
By convention, formal parameters (e.g. «a», «i», «o») start with a lowercase letter, global variables and functions (e.g. &amp;lt;code&amp;gt;F, Y, J&amp;lt;/code&amp;gt;) start with an uppercase letter, and qualifiers also start with an uppercase. Analytica doesn't enforce this convention, but it helps clarity in reading functions and models.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
For example, consider a Function F with Parameters specified as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;Parameters: (a: Array Number; i: Index; o: Optional Boolean = False)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We may call the function in an expression as:&lt;br /&gt;
:&amp;lt;code&amp;gt;F(Y^2, J, True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameters, «a», «i», and «o», in the Parameters attribute are termed the ''formal parameters''.  The parameters, &amp;lt;code&amp;gt;Y^2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; in the call to Function F are termed the ''actual parameters.  ''&lt;br /&gt;
&lt;br /&gt;
The qualifiers, '''Array''' '''Number''', after formal parameter «a», require that the actual parameter &amp;lt;code&amp;gt;Y^2&amp;lt;/code&amp;gt; should evaluate to an array of numbers. Parameter &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; should be an Index variable. And «o» should evaluate to a Boolean (or a number that will be treated as a Boolean, i.e., 0 is False and all other numbers are &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;.) Parameter «o» is optional and defaults to &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;, if the call to the function has no actual parameter.&lt;br /&gt;
&lt;br /&gt;
== Object Class Qualifiers ==&lt;br /&gt;
These Qualifiers, including Index, Variable, and Object, specify that the parameter to be the identifier of an object of that [[class]]. Within the function, the parameter contains a [[Handle]] to the object.  It does not evaluate the parameter during the call. The function can operate on the object, including getting an attribute (or assigning to an attribute if the function is called from a script.)&lt;br /&gt;
&lt;br /&gt;
==== Index ====&lt;br /&gt;
Requires the parameter to be the identifier of an Index. It may be a global or [[Local Indexes|local Index]]. The function does not evaluate the Index when it is called, and can use the parameter as an index in internal expressions, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function NormalizeWeights&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Parameters: (x: Number; i: Index)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition: x/Sum(x, i)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A parameter with Index Qualifier must be the identifier of a Variable, but its [[class]] doesn't have to be Index. It also works for other classes of variables if their [[Domain]] is an Index, Discrete, or defined as a List. It also works for a local Index declared as an Index within the Definition calling the function. And it can accept the syntax &amp;lt;code&amp;gt;A.I&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is an array with a local index &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Variable ===&lt;br /&gt;
&lt;br /&gt;
As you might expect, a parameter qualified as Variable, should be the identifier of a Variable.&lt;br /&gt;
&lt;br /&gt;
'''Typical usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(Z: Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[MH: Should we call this Object, since it can refer to any class of Analytica object, not just a Variable? Or would it be better to offer a several such qualifiers, to specify what Class of Object is acceptable? E.g. Module (any module type, including Model, Module, Library), Variable (any Variable type, including Index, Constant, Chance, Decision, and Variable), or Object, that allows an Object of any class.&lt;br /&gt;
Alternatively, we could add Object &amp;lt;Class&amp;gt;, where &amp;lt;class&amp;gt; can be any Analytica class. Should or could you be able to pass an Attribute, or User-defined Function, or System Function to an Object parameter?]&lt;br /&gt;
&lt;br /&gt;
[MH: Please review changes below]&lt;br /&gt;
&lt;br /&gt;
The actual parameter passed to a Variable parameter must be one of:&lt;br /&gt;
* An identifier of an object in the global namespace.&lt;br /&gt;
* An &amp;lt;code&amp;gt;X.I&amp;lt;/code&amp;gt; expression, where &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; holds an array and &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is the identifier of an index of that array.&lt;br /&gt;
* A local variable identifier that is an alias for an object. A local variable is an alias of an object when:&lt;br /&gt;
** It was declared as a Variable or Index parameter.&lt;br /&gt;
** It was assigned a [[Handle]], such as:  &amp;lt;code&amp;gt;Var X := HandleFromIdentifier(&amp;quot;Va1&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variable parameter won't accept a literal text, or a general expression, even if that expression returns a [[Handle]].  This is because the parameter is not actually evaluated as an expression would normally be as an actual parameter not qualified as an Index, Variable, or Object.  For example, in &amp;lt;code&amp;gt;Fu2(X), X&amp;lt;/code&amp;gt; is the identifier of an object, it is not an expression that evaluates to an object.  If the expression were evaluated, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; would have to hold a [[varTerm]].  If you need to use an expression that evaluates to a varTerm, then you would define a local variable to contain the result of that expression and specify the local variable identifier when you call the function.&lt;br /&gt;
&lt;br /&gt;
Within the Definition of the function, the parameter name &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; serves as an alias for the original object, and can be passed to other functions that expect objects (i.e., Variable parameters), such as &amp;lt;code&amp;gt;WhatIf(y, X, x0)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;lt;attrib&amp;gt; Of X&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;X Of o&amp;lt;/code&amp;gt; if X is the name of an Attribute. &lt;br /&gt;
&lt;br /&gt;
A Function called from a [[Script]] (not called from a Variable) can assign to the parameter, &amp;lt;code&amp;gt;X := &amp;lt;expr&amp;gt;&amp;lt;/code&amp;gt;, hence assigning a new definition to the variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; refers to. In other contexts, if &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is in an expression or a parameter to another function that evaluates its parameters, Analytica evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to return its value.&lt;br /&gt;
&lt;br /&gt;
If the object passed in as the parameter is a valid index, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; can be used within the function in an index context, e.g., &amp;lt;code&amp;gt;Sum(expr, X)&amp;lt;/code&amp;gt;.  The Index and Variable qualifiers differ in their behavior when the local variable is used in a value-context and a self-indexed table is passed in.  In a value context, a Variable parameter will evaluate to the value, while an Index parameter evaluates to its index value.&lt;br /&gt;
&lt;br /&gt;
The Variable qualifier is similar to pass-by-reference in other computer languages.  When called from a script (with no caching variables involved), the underlying variable's Value, [[ProbValue]], or other attributes, can be assigned to.  (However, because of a prohibition on side-effects with dependency maintenance, you can't assign to the object when a function is called from a variable evaluation).&lt;br /&gt;
&lt;br /&gt;
If the Variable Qualifier is followed by a Datatype qualifier, such as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3(X: Variable Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Analytica will evaluate &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; when calling &amp;lt;code&amp;gt;Fu3&amp;lt;/code&amp;gt; to check that its value has the specified Datatype. But, in the Definition of &amp;lt;code&amp;gt;Fu3&amp;lt;/code&amp;gt;, it will treat &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; as an unevaluated Variable, as just above.   The Coerce qualifier has no effect on a Variable parameter.&lt;br /&gt;
&lt;br /&gt;
=== LVarType ===&lt;br /&gt;
This qualifier is for internal use by built-in functions.  It is a variation on the Variable qualifier.&lt;br /&gt;
&lt;br /&gt;
=== Object ===&lt;br /&gt;
A parameter with qualified as Object expects the identifier of any user-defined. This may be a Variable, Function, Module, or other class of Object. It is useful for meta-inference about Objects, for example to find the contents of a module. The Object is not evaluated -- which it could not be anyway if it was not a Variable.&lt;br /&gt;
&lt;br /&gt;
'''Typical declaration''':&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(obj: Object)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Typical usage''':&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(MyIdentifier)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The qualifier Handle is closely related to '''Object'''.  The distinction is that Handle is a data type qualifier, while Object is an evaluation mode qualifier.  If you have an expression that returns a handle when evaluated, and you want to pass the resulting handle to a function, then you would use the Handle qualifier.  You would use the Object qualifier only if you want your function to accept an identifier directly without having to surround it within a call to the [[Handle]] function. Compare:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(obj: Object)&amp;lt;/code&amp;gt;           ---   call using:  &amp;lt;code&amp;gt;Fu1(X)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(obj: Handle)&amp;lt;/code&amp;gt;           ---   call using:  &amp;lt;code&amp;gt;Fu2(Handle(X))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Module ===&lt;br /&gt;
''new in [[Analytica 5.0]]''&lt;br /&gt;
Specifies that a module is expected. The calling expression can be a module identifier, text containing the module identifier, or an expression that evaluates to a module identifier or to a textual module name.  Can be used with or without the [[#Atom|atom]] qualifier or other dimensional qualifiers.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(m : Module)&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(m : Module atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
Call using any of these:&lt;br /&gt;
* Fu1(Mo1)&lt;br /&gt;
* Fu1('Mo1')&lt;br /&gt;
* Fu1([[Handle]](Mo1))&lt;br /&gt;
&lt;br /&gt;
=== Class ===&lt;br /&gt;
''new in [[Analytica 5.0]]''&lt;br /&gt;
Specifies that an object Class is expected. This can be the identifier of a class, the textual name of a class, or a handle to the class object. To see a complete list of classes in Analytica, evaluate &amp;lt;code&amp;gt;#[[FindObjects]](class:Object)&amp;lt;/code&amp;gt;. Can be used with or without the [[#Atom|atom]] qualifier or other dimensional qualifiers.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(c:Class)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(c:Class atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
Call using any of these:&lt;br /&gt;
* Fu1(Button)&lt;br /&gt;
* Fu1('Button')&lt;br /&gt;
* Fu1([[Handle]](Button))&lt;br /&gt;
&lt;br /&gt;
=== VarList ===&lt;br /&gt;
Specifies that a function expects a list of variables -- i.e., a list of pointers to Analytica objects.  An example is the second parameter of built-in function [[WhatIfAll]].&lt;br /&gt;
&lt;br /&gt;
'''Related:''' List of Index&lt;br /&gt;
&lt;br /&gt;
If you really want to pass a variable number of Variables as parameters to a function, it is better to use the ellipsis qualifier:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: ... Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, it passes a list of handles to each variable to parameter vars, without evaluating them. Inside the function, vars contains a list of Handles.&lt;br /&gt;
&lt;br /&gt;
When the VarList parameter is used, as with the declarations:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: VarList[I])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: List[I] of Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or with the related declaration:&lt;br /&gt;
:&amp;lt;code&amp;gt;(vars: List[] of IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:etc.&lt;br /&gt;
&lt;br /&gt;
Then the argument IS evaluated.  The elements of the evaluated result must then be Handles.  If not, an error results.  In normal Analytica usage, it is pretty unusual for a result to evaluate to [[varTerm]]s.  If you use an identifier within an expression, it will evaluate to the underlying value, so it doesn't work to pass a list of identifiers.  For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fu1(vars: VarList)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fu2(vars: ... Variable)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1([Va1, Va2, Va3])&amp;lt;/code&amp;gt;    -- won't work because the list expression [...] will evaluate the variables inside it.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(GetVariableByName([&amp;quot;Va1&amp;quot;, &amp;quot;Va2&amp;quot;]))&amp;lt;/code&amp;gt; -- Good&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2([Va1, Va2, Va3])&amp;lt;/code&amp;gt;    -- good&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(Va1, Va2, Va3)&amp;lt;/code&amp;gt;       -- good, equiv to previous&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(GetVariableByName([&amp;quot;Va1&amp;quot;,&amp;quot;Va2&amp;quot;]))&amp;lt;/code&amp;gt; -- won't work&lt;br /&gt;
&lt;br /&gt;
== Evaluation Mode Qualifiers ==&lt;br /&gt;
=== Mid===&lt;br /&gt;
&lt;br /&gt;
Forces the parameter to be evaluated in [[Mid]] (deterministic) mode, irrespective of the context evaluation mode.&lt;br /&gt;
&lt;br /&gt;
=== Prob ===&lt;br /&gt;
Forces the parameter to be evaluated in Prob (probabilistic) mode, independent of the context evaluation mode.&lt;br /&gt;
&lt;br /&gt;
If your user-defined function applies [[:category:Statistical Functions|statistical functions]] to a parameter, that parameter usually should be declared as Prob or Sample, otherwise your function may yield non-intuitive results.  To illustrate, consider the following [[User-Defined Functions|UDF]] that uses the statistical function [[Mean]], shown two ways, with and without the Prob qualifier.&lt;br /&gt;
:&amp;lt;code&amp;gt;Function MeanMax1(X: Prob; J: Index) := Mean(Max(X, J))&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function MeanMax2(X: Array; J: Index) := Mean(Max(X, J))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the results of applying these function in the following example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Case := 1..3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Chance Damage := Table(Case)(LogNormal(10, 2), LogNormal(7, 3), LogNormal(12, 1.2))&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable E_worst1 := Meanmax1(Damage, Case)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable E_worst2 := MeanMax2(Damage, Case)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables &amp;lt;code&amp;gt;E_worst&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;E_worst2&amp;lt;/code&amp;gt; may be evaluated in either [[Mid]] or [[Sample]] mode.  Let's compare:&lt;br /&gt;
:{| class=wikitable&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Expression &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Evaluation Context&lt;br /&gt;
|-&lt;br /&gt;
! Mid !! Sample&lt;br /&gt;
|-&lt;br /&gt;
! Mean(Max(Damage,&amp;quot;Case)) &lt;br /&gt;
| 20.53 || 20.53&lt;br /&gt;
|-&lt;br /&gt;
! MeanMax1(Damage, Case) &lt;br /&gt;
| 20.53 || 20.53&lt;br /&gt;
|-&lt;br /&gt;
! MeanMax2(Damage, Case) &lt;br /&gt;
| 12 || 20.53 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From this table you can see that without the Prob qualifier, the result of &amp;lt;code&amp;gt;MeanMax2&amp;lt;/code&amp;gt; in [[Evaluation Modes|mid mode]] is not the same as &amp;lt;code&amp;gt;Mean(Max(Damage, Case)&amp;lt;/code&amp;gt;.  The potentially counter-intuitive result for &amp;lt;code&amp;gt;Mid(MeanMax2(Damage, Case))&amp;lt;/code&amp;gt; occurs because the first parameter value is obtained by evaluating &amp;lt;code&amp;gt;Damage&amp;lt;/code&amp;gt; in [[Evaluation Modes|mid mode]], yielding the one-dimensional array &amp;lt;code&amp;gt;[10, 7, 12]&amp;lt;/code&amp;gt; indexed by &amp;lt;code&amp;gt;Case&amp;lt;/code&amp;gt;, rather than an array with the full distribution samples.&lt;br /&gt;
&lt;br /&gt;
=== Sample ===&lt;br /&gt;
Like [[Prob]], it forces the parameter to be evaluated in Prob mode, irrespective of the context mode. The only difference is that it gives an error message if the resulting value is not uncertain -- i.e. it does not contain the [[Run]] index.&lt;br /&gt;
&lt;br /&gt;
=== Context ===&lt;br /&gt;
Evaluates the parameter in [[Mid]] or Prob mode, according to the evaluation mode used to evaluate the function being called. Context is the default evaluation mode, if no qualifier ([[Mid]], Prob, or [[Sample]]) is specified, so there is strictly no reason to use it.&lt;br /&gt;
&lt;br /&gt;
=== Unevaluated ===&lt;br /&gt;
Accepts any expression and does not evaluate it. It leaves it up to the function to evaluate it if needed.  It is rarely used within user-defined functions, but is used in various built-in functions, for example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Whatif(e: Unevaluated; v: Variable; x)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ContextSample ===&lt;br /&gt;
Causes the qualified parameter to be evaluated in Prob mode if any of the other parameters to the function are [[Run]]. If not, it evaluates in Context mode -- i.e. Prob or [[Mid]] following the context in which the function is called. &lt;br /&gt;
&lt;br /&gt;
This qualifier is used for the main parameter of most built-in statistical functions. For example, [[Mean]] has these parameters:&lt;br /&gt;
:&amp;lt;code&amp;gt;Mean(x: ContextSample[i]; i: Index = Run)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, &amp;lt;code&amp;gt;Mean(X, Run)&amp;lt;/code&amp;gt; evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; in Prob mode. So does &amp;lt;code&amp;gt;Mean(X)&amp;lt;/code&amp;gt;, because the index &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; defaults to [[Run]]. But, &amp;lt;code&amp;gt;Mean(X, J)&amp;lt;/code&amp;gt; evaluates &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; in [[Mid]] mode, because &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; is not [[Run]].  &lt;br /&gt;
&lt;br /&gt;
When the parameter declaration contains more than one dimension, Prob mode is used if ''any'' of the indexes is [[Run]].&lt;br /&gt;
&lt;br /&gt;
== Dimension qualifiers ==&lt;br /&gt;
&lt;br /&gt;
Dimension qualifiers specify the dimensions -- that is, the indexes -- that the function expects for that parameter.  The qualifier ''Atom'' specifies that the parameter value passed to the function must be a single value, with no indexes. &amp;lt;code&amp;gt;(x : Array[Time, I,  J])&amp;lt;/code&amp;gt; qualifies parameter x as having the three indexes listed.  The main reason to use a Dimension qualifier is when the function will not work with parameters with different, usually more dimensions -- usually because it uses one of the  [[Expressions that don't array-abstract]].  It is also of occasional use to conserve memory in a Function that may use a lot of memory temporarily during calculation. If it specifies few or no dimensions for its parameters, it is less likely to run out of memory during computation.&lt;br /&gt;
&lt;br /&gt;
The key point to understand about dimension qualifiers is that they d ''not'' 'require that the actual value passed to the function has exactly those indexes and number of dimensions. Rather, they specify that the Function expects to work on a parameter with those indexes or number of dimensions.  Analytica automatically resolves any mismatch between the dimensions of the actual value and the dimensional qualifier:&lt;br /&gt;
&lt;br /&gt;
* If the actual value has more indexes than specified by the qualifier, it decomposes the value over the extra indexes into slices each with the expected indexes, and calls the function on each slice. It then reassembles the results from each function call into an array with those extra indexes. This reassembled result may also have additional indexes from the individual result of each function call, if that passes through indexes that it uses, or generates new indexes itself.  &lt;br /&gt;
&lt;br /&gt;
* If the actual value of a parameter is missing any expected index(es) specified in the dimensionality qualifier, the function also works fine. Any operation on a value  &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; over an index  &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; when  &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is not indexed by &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; treats &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; as constant over &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;.  For example, the atomic (scalar) number 4 is not indexed by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt;. Suppose time has 10 steps, so: &lt;br /&gt;
:&amp;lt;code&amp;gt;Size(Time) → 10&amp;lt;/code&amp;gt;. &lt;br /&gt;
Then &lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(4, Time) → 40&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When multiple parameters have dimension qualifiers, Analytica coordinates the iteration over each parameter so that indexes impacting multiple parameters are iterated together.&lt;br /&gt;
&lt;br /&gt;
=== Array ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(x : Array[Time, I,  J]; I: Index; J: Optional Index)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Array qualifier defines what indexes the parameter should have when passed to the Function.  It consists of the word ''Array'', followed by a list of one or more indexes in square brackets.  Actually, the ''Array'' is optional, since the list of indexes in square brackets is sufficient. So, these two declarations are the same:&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Numeric Array[Time])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Numeric[Time])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Array qualifier specifies that the parameter is a multi-dimensional array (of zero or more dimensions), and is most importantly used to declare what those dimensions are.  Inside the body of the function, parameter variable is guaranteed to contain no dimensions other than those declared.  Analytica iterates over the function, calling it repeatedly on successive slices when an argument contains extra dimensions, so that this guarantee is satisifed within the function body -- this is the basis for Array Abstraction.&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is indexed by [[Time]], &amp;lt;code&amp;gt;K1,  K2&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K3&amp;lt;/code&amp;gt; and that a function having the above Typical Usage declaration is called as &amp;lt;code&amp;gt;F(A, K1)&amp;lt;/code&amp;gt;.  Analytica will iterate over all combinations of &amp;lt;code&amp;gt;K2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;K3&amp;lt;/code&amp;gt;, slicing &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; for each combination and calling &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; each time with parameter &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; indexed only by [[Time]] and &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; (where parameter &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is an alias for &amp;lt;code&amp;gt;K1&amp;lt;/code&amp;gt; inside the function Definition).&lt;br /&gt;
&lt;br /&gt;
An array declaration does not add in dimensions, so for example, if in the earlier example, if the function were called using: &amp;lt;code&amp;gt;F(5, In1)&amp;lt;/code&amp;gt;, inside the function body &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; will be the scalar 5 -- the dimensions [[Time]] and &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; are not automatically added to the parameter.  However, since for all [[Array Abstraction|array-abstractable]] functions, 5 is equivalent to an array containing 5 for every element, computations will usually remain equivalent (and sometimes more efficient) even if the argument does not contain the dimension.  The [[All]] keyword (described elsewhere on this page), used in conjunction with a dimensionality declaration.&lt;br /&gt;
&lt;br /&gt;
When you define a function using [[Procedural Programming|procedural programming]] constructs, like [[While]] or or a local index with [[Sequence]]()  that require their parameters to be Atoms, it is a good idea to qualify the dimensions of each function parameter that might affect them.  The function will then array-abstract properly, and continue work if you add dimensions to the model later.&lt;br /&gt;
&lt;br /&gt;
=== Atom ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Atom)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies that the parameter is atomic -- a single element.  If an array is passed to this parameter, Analytica will iterate over its dimensions so that at each call the parameter value is guaranteed to consist of a single element, typically a number, text string, a reference, or the value [[Null]].  &lt;br /&gt;
&lt;br /&gt;
In esoteric cases, some internal data types can also be passed, which could theoretically include an parsed expression structure, a varset, a data blob (such as an image), a [[Optimization_Characteristics#Parts_of_a_Linear_Program_.28LP.29|LP]], [[Optimization_Characteristics#Parts_of_a_Quadratic_Program_.28QP.29|QP]] or [[Optimization_Characteristics#Parts_of_a_Non-Linear_Program_.28NLP.29|NLP]] problem-specification object.&lt;br /&gt;
&lt;br /&gt;
Because an atom is considered to be a zero-dimensional array, the atomic qualifier is functionally equivalent to the Array qualifier with zero indexes, i.e.:&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Array[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[Objects_and_Values#Values|Atomic values]] and [[Atomic..Do]].&lt;br /&gt;
&lt;br /&gt;
=== Scalar ===&lt;br /&gt;
'''Typical usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Scalar qualifier is an alias for &amp;quot;Number Atom&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Vector ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Vector[I]; I: Optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The vector qualifier specifies that the argument passed must contain at least one dimension, even if that dimension is not explicitly specified.  When there is an explicit index provided, the behavior is the same as the Array qualifier.  The distinguishing behavior occurs when no index is specified, such as when an optional index is omitted in the typical preceding typical usage.  In such a case, array abstraction is applied to a vector parameter until a single dimension remains, while in the case of Array it would be applied until the parameter is scalar.  When the parameter contains multiple dimensions, the default single remaining dimension will be the canonically first dimension.  If no index can be identified, an error results.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1 (X: Vector[I, J]; I, J: optional IndexType)&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2 (X: Array [I, J]; I, J: optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3 (X : Vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := (indexed by In1 and In2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dimensionality of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; within function body:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is atomic. Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A, In2)&amp;lt;/code&amp;gt; =&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(A, In1, In2)&amp;lt;/code&amp;gt; =&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu3(A)&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is dimensioned by &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;.  Iterates over &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1([A, A^2])&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is a null-indexed list of atoms.  Iterates over &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;Fu2([A, A^2])&amp;lt;/code&amp;gt;  ==&amp;gt; &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is atomic.  Iterates over null-list, &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;[[Media:Array vs Vector.ANA|Download example model]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the example illustrate the difference between Vector and Array qualifiers.&lt;br /&gt;
&lt;br /&gt;
Many built-in Analytica functions that operate on 1-D parameters act as if they are declared in this fashion (internally not all built-in functions use the newer parameter scheme documented here). These include [[Sum]], [[Min]], [[Max]], [[Product]], [[Cumulate]], [[Uncumulate]], [[CumProduct]], etc.&lt;br /&gt;
&lt;br /&gt;
=== List ===&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List All [ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L: List[I]; I: IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The List parameter qualifier is a variation of the Array qualifier that is used when a null-indexed dimension is expected, and the function does not want array abstraction it iterate over and remove that dimension before evaluating the function.&lt;br /&gt;
&lt;br /&gt;
The array qualifier has no syntactic variation that allows you to the [[Null]]-dimension within the list of dimensions.  The so-called Null-dimension does not really correspond to an actual Analytica object, but rather is a term that refers to a list.  But, essentially, a declaration &amp;lt;code&amp;gt;List[I, J]&amp;lt;/code&amp;gt; would be the conceptual equivalent of &amp;lt;code&amp;gt;Array[NullDim, I, J]&amp;lt;/code&amp;gt;.  It declares that the parameter may be indexed by the null-dimension, &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.  Without the All qualifier, none of these dimensions are required, but they are the only ones allowed.&lt;br /&gt;
&lt;br /&gt;
As is the case with the [[Array]] qualifier, a [[List]] declaration with no brackets is allowed but not particularly useful, since it doesn't restrict the dimensionality of the parameter.&lt;br /&gt;
&lt;br /&gt;
The declaration &amp;lt;code&amp;gt;(L : List[ ])&amp;lt;/code&amp;gt; specifies that only the null-dimension is allowed.  If the argument is not a list, then L will be atomic at each function invocation.  If the argument has a null-dimension, then all other dimensions are iterated, with only the null-dimension passed to the function.&lt;br /&gt;
&lt;br /&gt;
When the [[All]] qualifier is included, as in &amp;lt;code&amp;gt;(L: List All[I])&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;(L : List All[ ])&amp;lt;/code&amp;gt;, then both the specified index(es) and the null-index are required.  When a null-index is added, Analytica has no reference index object to determine its length, so a null-list of length one is added.&lt;br /&gt;
&lt;br /&gt;
When the list qualifier is used in conjunction with the Variable or Index qualifiers, a somewhat different treatment results.  For these cases, see the [[VarList]] qualifier.  &amp;quot;Variable List&amp;quot; or &amp;quot;List of Variable&amp;quot; is synonymous with VarList.&lt;br /&gt;
&lt;br /&gt;
=== All ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array All[I, J])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The All qualifier is used with Array, Vector, or List to specify that the function requires all listed indexes to be present.  Without All, it allows, but does not require that the parameter has these dimensions.  With All , the function body is guaranteed that the parameter has all and exactly the listed dimensions.&lt;br /&gt;
&lt;br /&gt;
If an argument to an array parameter has extra indexes not listed, they are iterated, whether or not the [[All]] qualifier is present.  If any named index(es) is (are) not an index of the actual parameter, it adds the index(es) as a dimension, repeating the value of the parameter across the added dimension(s).  Internally, it represents them as ''sparse dimensions'', so that there is little memory or time penalty involved in passing the extra dimensions; however, if the function operates over that dimension, intermediate or final results may require more memory, because for example, intermediate values may no longer be constant over those dimensions.&lt;br /&gt;
&lt;br /&gt;
=== Reduced ===&lt;br /&gt;
'''Typical Usage:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A, B: Array[I]; C:Array[J]; D: Reduced)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a parameter is declared with the Reduced keyword, it is sliced along any dimensions that are iterated as a result of dimensionality declarations on other parameters.  For example, with the preceding declaration, suppose that the function is called with &amp;lt;code&amp;gt;A[I, J], B[I, K], C[J, K]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;D[I, J, K]&amp;lt;/code&amp;gt;.  Then Analytica will iterate over &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; (for parameter &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;) and over &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; (for parameters &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt;).  &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt; will thus be reduced by dimensions &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;, so that within the function body, &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt; will be remain dimensioned only by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a parameter is declared as Reduced, no index dimensions can be declared.  In other words, &amp;lt;code&amp;gt;D : Reduced[I]&amp;lt;/code&amp;gt; would result in an error.&lt;br /&gt;
&lt;br /&gt;
An example situation where the Reduced qualifier is useful is the following.  Suppose a function can compute multiple related results.  A parameter, computation, indicates which result is desired, e.g.:&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Process(A: Numeric[I]; I: Index; computation: Reduced)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the function, Process can examine the computation parameter to determine exactly which computations need to be done.  If the same computation is requested several times (for the same iteration along A), work does not need to be repeated, and if two computations share 90% of a computation, the function can leverage this fact, which it would not be able to do if these were done on separate iterations.&lt;br /&gt;
&lt;br /&gt;
== Data type qualifiers ==&lt;br /&gt;
A Data Type, such as Number, Positive Negative, Text, or Reference, is a qualifier to specify the expected type of value of a parameter.  If the parameter doesn't have the specified type when the function is called, it gives an evaluation error. If the parameter is an array, it checks that every cell of the array is of the expected type. You can combine a Data type qualifier with an Array type qualifier, such as Vector, Array, or [I], or with object qualifier, such as Index.  The qualifier Coerce requests that, if the parameter has a different type, Analytica should try to convert it to the desired type if possible -- e.g. convert a number to a text. The data type is optional.  A small performance penalty is incurred at the time of a function call when the data type is specified.&lt;br /&gt;
&lt;br /&gt;
=== Number ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a number (which includes [[INF]], -[[INF]], or [[NaN]]), or an array of numbers.&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(s: Text)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a text value (which includes empty text ''), or an array of text values.&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(r: Reference)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects an expression that evaluates to a Reference, or an array of references. &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; must be a reference, or an array of references. Each reference may refer to any type of value or object without restriction.&lt;br /&gt;
&lt;br /&gt;
=== Positive ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(x: Positive)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A positive number, which could include [[INF]], but not [[NaN]].&lt;br /&gt;
&lt;br /&gt;
=== NonNegative ===&lt;br /&gt;
Zero or a positive number, which could include [[INF]], but not [[NaN]].&lt;br /&gt;
&lt;br /&gt;
=== Handle ===&lt;br /&gt;
:&amp;lt;code&amp;gt;(v: Handle)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expects a handle to an object or an array of handles.  These functions [[Handle]], [[HandleFromIdentifier]], [[IndexesOf]] return handles. You can also get a handle from the [[Contains]] or [[IsIn]] Attributes of an object, or an Array of Handles from the Inputs, Outputs, or Contains Attributes of an Object.  Handles are used in [[Meta-Inference]].  The [[Handle]] qualifier is a different from the Variable, Index or Object qualifiers in that its parameter is typically evaluated.  The Handle qualifier specifies the expected the data type, not the evaluation mode.&lt;br /&gt;
&lt;br /&gt;
=== Color ===&lt;br /&gt;
(''new to ''Analytica 5.0]]'')&lt;br /&gt;
&lt;br /&gt;
A color can be either a color integer or a textual color name.  A color integer is most conveniently written in hex notation as 0xaarrggbb or 0xrrggbb, where ''aa'' is the alpha value, rr the red value, ''gg'' the green value, and ''bb'' the blue value. For example, &amp;lt;code&amp;gt;0x80c0257d&amp;lt;/code&amp;gt; has an alpha of 0x80, a red of 0xc0, a green of 0x25 and a blue of 0x7d. A color name is a color name in English, such as 'Red', 'Yellow', 'Green', or 'Brown'. See [[Color parameters]] for a full list of color names.&lt;br /&gt;
&lt;br /&gt;
=== Coerce &amp;lt;type&amp;gt; ===&lt;br /&gt;
If possible, it converts the value of the parameter into the desired type, Text or Number, as specified. &lt;br /&gt;
&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(t : Coerce Text; x: Coerce Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When coercing a number to Text, it uses the number format of the Variable or Function that calls the function which coerces its parameter(s)-- not the number format of the called function. &lt;br /&gt;
:&amp;lt;code&amp;gt;Function Result_text(x: Coerce Text) := 'The result is ' &amp;amp; x&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Y := Result_text(12345.678)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; uses Analytica's default Number Format, which is suffix format with 4 significant digits, it gives&lt;br /&gt;
:&amp;lt;code&amp;gt;Y -&amp;gt; 'The result is 12.35K'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But if the Number format of Y was set to Fixed point with 2 decimal digits and commas, it gives&lt;br /&gt;
:&amp;lt;code&amp;gt;Y &amp;amp;rarr; 'The result is 12,345.68'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When coercing from Text to Number, it tries to parse text containing numbers using the number format. &lt;br /&gt;
&lt;br /&gt;
Coercion to a reference returns a reference to an atomic value (text or number) that is not already a reference. &lt;br /&gt;
Coercing an array to a reference returns an array of references to the elements of the array.&lt;br /&gt;
&lt;br /&gt;
In all cases, if a coercion is not possible (including when a text does not contain a valid number), it flags an evaluation error.&lt;br /&gt;
&lt;br /&gt;
== Ordering Qualifiers ==&lt;br /&gt;
&lt;br /&gt;
=== Ascending ===&lt;br /&gt;
'''Typical Usages:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;(A : Ascending[I])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L : Ascending List[ ])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(I : Ascending IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ascending qualifier specifies that the values of a list, vector, array, or index must be in non-strictly ascending order.  Use of this qualifier requires that the declaration specifies a one-dimensional parameter.   Without one dimension, the index over which it must be ascending is ambiguous, and hence an error is issued.&lt;br /&gt;
&lt;br /&gt;
The test triggers an error if any element is less than the value that precedes it. The test is non-strict, so that a constant array, or an element equal to its predecessor, does not trigger an error.  There is no parameter qualifier variation that tests for strict ascending order.&lt;br /&gt;
&lt;br /&gt;
=== Descending ===&lt;br /&gt;
The descending qualifier specifies that the values of a list, vector, array, or index must be in non-strictly descending order.  It is the exact dual of the Ascending parameter qualifier -- see the description above for Ascending for details.&lt;br /&gt;
&lt;br /&gt;
== Optional and repeated parameters ==&lt;br /&gt;
=== Optional qualifier ===&lt;br /&gt;
'''Typical uses:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F1(x: optional)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F2(a: Array[I]; i: optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Function F3(a: Optional = 0; b := 99)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''Optional'' qualifier specifies that a parameter is optional.  If the function is called with no value, the parameter has the value Undefined inside the function. You can test if the value is undefined with functions [[Data_Type_Functions#IsNotSpecified|IsNotSpecified]](...) or IsUndef(...). &lt;br /&gt;
&lt;br /&gt;
You can provide a different default using an equal sign,  as in the example, &amp;lt;code&amp;gt;a: = 0&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;F3&amp;lt;/code&amp;gt; above.  In that case, the parameter gets the specified default if none is provided when you call it.&lt;br /&gt;
&lt;br /&gt;
The function, you can pass a parameter declared as optional as a argument to another function having an optional parameter.  If the parameter is not specified to the first function, it will appear to the second function as if it is not specified as well.  Within the body, should the parameter variable itself be used, it contains the special system value Undefined.&lt;br /&gt;
&lt;br /&gt;
Optional can be applied to values or indexes.  Using the optional qualifier on index parameters causes array parameters using that index to be of variable dimensionality.&lt;br /&gt;
&lt;br /&gt;
Note: Use of the ellipsis qualifier, or the inclusion of a default value, are alternative means to specify optional or variable-length parameter lists.&lt;br /&gt;
&lt;br /&gt;
=== Default values ===&lt;br /&gt;
'''Syntax:''' &amp;lt;code&amp;gt;ident: qualifiers = defaultValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Typical Usages''':&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Optional Number = 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: Number = 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: ContextSample[R]; R: Index = Run)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify a default value to be used for an optional parameter when the parameter is omitted when calling the function. In the parameters, you simply include &amp;lt;code&amp;gt; = &amp;lt;defaultVal&amp;gt;&amp;lt;/code&amp;gt; in the qualifier.  If you specify a default in this way, you don't need to include the &amp;quot;Optional&amp;quot; qualifier since it is implied.  For a value parameter, the optional value should usually be a literal, a number or text. You may use an expression, but we don't recommend it.   For an Index or Variable parameter, the optional value must identify an index or variable.  For one of these Unevaluated parameter types, the default could be another parameter of that type declared earlier in the parameters list.&lt;br /&gt;
&lt;br /&gt;
For an index parameter you may specify the default as code&amp;gt;Common&amp;lt;/code&amp;gt;, meaning that the default  the index common to all array parameters using that index.  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;(P, R: Array[I]; I: Index = Common)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the parameters passed for &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; must share exactly one index if &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is not specified.&lt;br /&gt;
&lt;br /&gt;
=== Repeated parameters (...) ===&lt;br /&gt;
'''Typical Usages''':&lt;br /&gt;
:&amp;lt;code&amp;gt;(X: ... Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I] ; I : ... IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Three dots &amp;quot;...&amp;quot; qualifies a parameter as repeated: The function accepts one or more actual parameters of the given type.  If you combine &amp;quot;...&amp;quot; with Optional, it accepts ''zero'' or more parameters -- instead of requiring at least one parameter. Within the function, an repeated parameter is a list (with [[Null]] index) containing the actual parameters given. For example,&lt;br /&gt;
:&amp;lt;code&amp;gt;Function ValMax(x: ... Number) := Max(X)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ValMax(3, 6,-2, 4) &amp;amp;rarr; 6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ValMax()&amp;lt;/code&amp;gt; returns the maximum value of its repeated parameter. Unlike the built-in [[Max]] function, it doesn't need square brackets around its parameters. During evaluation of &amp;lt;code&amp;gt;ValMax&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; is the null-indexed list &amp;lt;code&amp;gt;[3, 6,- 2, 4]&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;ValMax&amp;lt;/code&amp;gt; could also be applied to array arguments, such as &lt;br /&gt;
:&amp;lt;code&amp;gt;ValMax(Sqrt(X), X^2, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Total(a: Array[I]; i: ... IndexType)&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
sums its parameter, a, over one or more dimensions -- a generalization of Sum(A,I).  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Total(A, I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is equivalent to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Sum(A, I), J), K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Actually, the built-in Function [[Sum]], and other [[array-reducing functions]], including [[Product]], [[Min]], [[Max]], [[Average]], already allow you to provide a list of indexes to work over.)&lt;br /&gt;
&lt;br /&gt;
Inside the body of &amp;lt;code&amp;gt;Total&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; would be an array containing the [[Null]]-index, along with all dimensions listed in the &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
You can specify an array parameter with a variable number of explicit indexes, by using the ellipsis on an index parameter, e.g:&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I]; I: ... Optional IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A parameter passed to an repeated parameter may NOT be indexed by [[Null]].  (However, an explicit bracket syntax can be used to group a variable number of arguments in the call, see examples below).&lt;br /&gt;
&lt;br /&gt;
Several syntaxes may be used when calling a function containing an repeated parameter.  When the parameter is named in the call, then all arguments that follow are considered to be instances of that parameter up until another parameter name is indicated.  For example, in the declaration&lt;br /&gt;
You may use several methods to specify the actual parameters to a function with repeated parameters. For this function:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Function Fxy(X: ... scalar; Y: ... Optional Scalar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you may give the repeated parameter by name:&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy(X: 1, 2, 3, 4, Y: 5, 6, 7)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use position and naming only the second parameter Y:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy(1, 2, 3, 4, Y: 5, 6, 7)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the first four are treated as parameters to X. You needed to specify parameter Y by name, to make clear that the second four are elements of Y.&lt;br /&gt;
&lt;br /&gt;
You may also use square brackets with pure positional syntax:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Fxy([1, 2, 3, 4], [5, 6, 7])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The brackets prevent any ambiguity.&lt;br /&gt;
&lt;br /&gt;
Repeated parameters for indexes are useful to enable a variable number of dimensions for an array parameter. However, you cannot (currently) use the individual indexes explicitly from within the user-defined function.  You could implement the &amp;lt;code&amp;gt;Total&amp;lt;/code&amp;gt; function above as:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(Sum(A)))))))))))))))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which would work up to 15 dimensions (the maximum # of dimensions allowed in Analytica anyway), but note that the indexes are not specified explicitly.  It would be difficult currently to use the I parameter in the function itself.&lt;br /&gt;
&lt;br /&gt;
Note that Repeated indexes can be mixed with non-Repeated indexes in array declarations, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;(A: Array[I, J]; I: IndexType; J: ... IndexType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function requires two or more indexes: &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; and one or more instances of &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== '''Using Index with Optional and Repeated Qualifiers''' ===&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index&amp;lt;/code&amp;gt; -- The function requires an index parameter&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Optional Index&amp;lt;/code&amp;gt; -- the function can accept an Index parameter, but it is optional.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index = J&amp;lt;/code&amp;gt; -- the function can accept an Index parameter. If omitted it defaults to &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.  Using &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; to specify a default value implies the parameter is optional, even if the keyword &amp;lt;code&amp;gt;Optional&amp;lt;/code&amp;gt; is omitted.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Index = Run&amp;lt;/code&amp;gt; -- the function can accept an Index parameter. If omitted it defaults to [[Run]]].&lt;br /&gt;
:&amp;lt;code&amp;gt;I: Repeat Index&amp;lt;/code&amp;gt; -- the function expects a list of one or more Index parameters.&lt;br /&gt;
:&amp;lt;code&amp;gt;I: ... Optional Index&amp;lt;/code&amp;gt; -- the function expects a list of zero or more Index parameters. Ellipsis &amp;quot;...&amp;quot; is a synonym for&amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use a local variable that refers to an Index:&lt;br /&gt;
:&amp;lt;code&amp;gt;VAR v := GetVariableByName(&amp;quot;In1&amp;quot;) DO Fu1(v)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is equivalent to &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(In1)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You cannot specify a general expression where an Index is required, so you could not compose the above to: &lt;br /&gt;
:&amp;lt;code&amp;gt;Fu1(GetVariableByName(&amp;quot;In1&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Qualifiers ==&lt;br /&gt;
=== Hidden ===&lt;br /&gt;
When marked as hidden, a parameter does not appear in the object finder dialog, or when pasting the definition via the definition menu.  The parameter, however, is there and can be specified in a function call.&lt;br /&gt;
&lt;br /&gt;
Internally Analytica makes use of hidden parameters in the following construct:&lt;br /&gt;
:&amp;lt;code&amp;gt;(A; exprA: hidden unevaluated = A)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows the underlying implementation access to the expression for &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, while still receiving the evaluated parameter &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; (suitably iterated and typechecked if other qualifiers are attached to &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Of ===&lt;br /&gt;
The [[Of]] qualifier is ignored by the parameter qualifier parser, but can be included within qualifier list for stylistic preference, such as:&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Ascending Array[I, J] of Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(L : List of Number)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as equivalent alternatives to &lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Ascending Number Array[I,J])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;(X : Number List)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so on.  Note that qualifiers can appear in any order, and contain various aliases (such as Numeric or Numbers) to make either stylistic variation sensible, depending on user preference.&lt;br /&gt;
&lt;br /&gt;
=== Deprecated Synonyms for Parameter Qualifiers ===&lt;br /&gt;
&lt;br /&gt;
We originally defined synonyms for some parameter qualifiers, thinking it would let you specify parameter lists more flexibly. In practice, users found it harder to recognize and remember so many terms, so we have chosen one preferred term for each qualifier and deprecate the others -- i.e. we advise you not to use them. Please use the preferred terms, since the deprecated ones may not be supported in future releases.&lt;br /&gt;
&lt;br /&gt;
For the benefit of those looking at old Analytica code, here are the synonyms, after the recommended term for each qualifier:&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Recommended term&lt;br /&gt;
!Synonyms&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt;&lt;br /&gt;
|ArrayType, Arr&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|IndexType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Prob&amp;lt;/code&amp;gt;&lt;br /&gt;
|Probabilistic, ProbType,  Uncertain&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Sample&amp;lt;/code&amp;gt;&lt;br /&gt;
|Samp, SampType, SampleType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Mid&amp;lt;/code&amp;gt;&lt;br /&gt;
|Determ, DetermType, DetermMode, MidMode&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Context&amp;lt;/code&amp;gt;&lt;br /&gt;
|Expr, ContextType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Unevaluated&amp;lt;/code&amp;gt;&lt;br /&gt;
|Expression&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;ContextSample&amp;lt;/code&amp;gt;&lt;br /&gt;
|ContextSamp, MaybeSamp, MaybeSample&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Variable&amp;lt;/code&amp;gt;&lt;br /&gt;
|VariableType, Var, VarType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;VariableList&amp;lt;/code&amp;gt;&lt;br /&gt;
|VarList, Variable List, List of Variable&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Atom&amp;lt;/code&amp;gt;&lt;br /&gt;
|Atomic, AtomicType, AtomType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Scalar&amp;lt;/code&amp;gt;&lt;br /&gt;
|ScalarType, Scalars&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Vector&amp;lt;/code&amp;gt;&lt;br /&gt;
|VectorType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;List&amp;lt;/code&amp;gt;&lt;br /&gt;
|ListType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Number&amp;lt;/code&amp;gt;&lt;br /&gt;
|Numeric, Numbers, NumberType, NumericType, Num, Real, Boolean&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Text&amp;lt;/code&amp;gt;&lt;br /&gt;
|Textual, TexType, TextType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Reference&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ref, RefType, ReferenceType&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;NonNegative&amp;lt;/code&amp;gt;&lt;br /&gt;
|PositiveOrZero, NotNegative&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Coerce&amp;lt;/code&amp;gt;&lt;br /&gt;
|Coerced&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Optional&amp;lt;/code&amp;gt;&lt;br /&gt;
|opt&lt;br /&gt;
|}&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Parameter qualifiers]]&lt;br /&gt;
* [[ParameterEnumeration]]&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Repeated Parameter Forwarding]]&lt;br /&gt;
* [[User-Defined Functions]]&lt;br /&gt;
* [[User-defined Functions and Libraries]]&lt;br /&gt;
* [[Class]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Box_Plots&amp;diff=52512</id>
		<title>Box Plots</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Box_Plots&amp;diff=52512"/>
		<updated>2019-02-01T19:57:07Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Graphs]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Using [[What's new in Analytica 5.2?|Analytica 5.2]] or later versions, users can create box-whisker plots using the [[OnGraphDraw]] attribute and the set of [[Drawing images|relevant drawing functions]]. The following is an example of a box-whisker plot created using the new functionality:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw_TukeyBands.png|400px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Users of previous versions may use probability bands, as described below, to communicate similar information. &lt;br /&gt;
&lt;br /&gt;
A classical box-whisker plot is one that looks like this:&lt;br /&gt;
&lt;br /&gt;
:[[image:Classic-box-wisker.png]]&lt;br /&gt;
&lt;br /&gt;
The whisker-ends usually represent either the min and max range of data, or the 10% and 90% fractiles.  The top and bottom of the box denotes the 25% and 75% quartiles, with the middle line being the median.&lt;br /&gt;
&lt;br /&gt;
Analytica's probability bands graph is used to depict the same type information, but in a different format:&lt;br /&gt;
&lt;br /&gt;
:[[image:ProbBands-plot.png]]&lt;br /&gt;
&lt;br /&gt;
As a substitute for a box-whisker plot, you can consider a &amp;quot;box-box-box plot&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
:[[image:box-box-box-plot.png]]&lt;br /&gt;
&lt;br /&gt;
Or, in the other direction, a whisker-whisker-whisker plot:&lt;br /&gt;
&lt;br /&gt;
:[[image:whisker-whisker-whisker-plot.png]]&lt;br /&gt;
&lt;br /&gt;
While the topmost box-whisker plot is not currently available in Analytica 4.4, all three of the other variations are possible using Analytica's graphing engine.  All three plots depict the same information.&lt;br /&gt;
&lt;br /&gt;
The examples in this article are contained in the [[media:Box-like-plots.ana|Box-like-plots.ana]] model, which you can download and play with.&lt;br /&gt;
&lt;br /&gt;
== Probability Bands Plot ==&lt;br /&gt;
&lt;br /&gt;
The probability bands plot is immediate in the result view when viewing an uncertain quantity that has at least one other dimension (usually a time dimension).  Just select the ProbBands view in the top-left corner of the result view.&lt;br /&gt;
&lt;br /&gt;
:[[image:ProbBands-select.png]]&lt;br /&gt;
&lt;br /&gt;
== Box-Box-Box plots ==&lt;br /&gt;
&lt;br /&gt;
To obtain a box-box-box plot, select a [[ProbBands]] result view, then double click to change the chart type settings.  Select a bar chart, check the &amp;quot;Variable origin&amp;quot;, and uncheck &amp;quot;Swap horizontal and vertical&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-graphSetup.png]]&lt;br /&gt;
&lt;br /&gt;
Next, press ''Ctrl+U'' ([[Uncertainty Setup dialog]]) and select the probability levels of interest:&lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-probability-levels.png]]&lt;br /&gt;
&lt;br /&gt;
Finally, ensure your horizontal axis is your time index, Key is Probability, and then for [[Bar Origin]] select ''Probability = 0'' (or your lowest selected fractile):&lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-plot.png]]&lt;br /&gt;
&lt;br /&gt;
== Whisker-Whisker-Whisker plots ==&lt;br /&gt;
&lt;br /&gt;
The Whisker-whisker-whisker plot is sometimes a little tricky to get right.  Once again, display the [[ProbBands]] view. You must add your Time in as a comparison index, even though it already appears as a pivoter index.  This enables the use of an XY graph with more flexible control over which series of points are connected by lines (the running index).  &lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-XY-setting.png]]&lt;br /&gt;
&lt;br /&gt;
You need to use a line-symbol chart type, and select '''Use Separate color / symbol keys''':&lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-ChartType-setting.png]]&lt;br /&gt;
&lt;br /&gt;
With this, you can now pivot as shown in the next final image to obtain the final graph:&lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-whisker-whisker-plot.png]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[media:Box-like-plots.ana|Box-like-plots.ana]]&lt;br /&gt;
* [[Graph settings]]&lt;br /&gt;
* [[Tornado Plots]]&lt;br /&gt;
* [[Bar Origin]]&lt;br /&gt;
* [[Statistical_Functions_and_Importance_Weighting#ProbBands|ProbBands]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Box_Plots&amp;diff=52511</id>
		<title>Box Plots</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Box_Plots&amp;diff=52511"/>
		<updated>2019-02-01T19:50:58Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added a link to the new 5.2 OnGraphDraw attribute and drawing functions. This should be expanded to include code on how to produce the example plot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Graphs]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Using [[What's new in Analytica 5.2?|Analytica 5.2]] or later versions, users can create box-whisker plots using the [[OnGraphDraw]] attribute and the set of [[Drawing images|relevant drawing functions]]. The following is an example of a box-whisker plot created using the new functionality:&lt;br /&gt;
&lt;br /&gt;
:[[image:OnGraphDraw_TukeyBands.png]]&lt;br /&gt;
&lt;br /&gt;
Users of previous versions may use probability bands, as described below, to communicate similar information. &lt;br /&gt;
&lt;br /&gt;
A classical box-whisker plot is one that looks like this:&lt;br /&gt;
&lt;br /&gt;
:[[image:Classic-box-wisker.png]]&lt;br /&gt;
&lt;br /&gt;
The whisker-ends usually represent either the min and max range of data, or the 10% and 90% fractiles.  The top and bottom of the box denotes the 25% and 75% quartiles, with the middle line being the median.&lt;br /&gt;
&lt;br /&gt;
Analytica's probability bands graph is used to depict the same type information, but in a different format:&lt;br /&gt;
&lt;br /&gt;
:[[image:ProbBands-plot.png]]&lt;br /&gt;
&lt;br /&gt;
As a substitute for a box-whisker plot, you can consider a &amp;quot;box-box-box plot&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
:[[image:box-box-box-plot.png]]&lt;br /&gt;
&lt;br /&gt;
Or, in the other direction, a whisker-whisker-whisker plot:&lt;br /&gt;
&lt;br /&gt;
:[[image:whisker-whisker-whisker-plot.png]]&lt;br /&gt;
&lt;br /&gt;
While the topmost box-whisker plot is not currently available in Analytica 4.4, all three of the other variations are possible using Analytica's graphing engine.  All three plots depict the same information.&lt;br /&gt;
&lt;br /&gt;
The examples in this article are contained in the [[media:Box-like-plots.ana|Box-like-plots.ana]] model, which you can download and play with.&lt;br /&gt;
&lt;br /&gt;
== Probability Bands Plot ==&lt;br /&gt;
&lt;br /&gt;
The probability bands plot is immediate in the result view when viewing an uncertain quantity that has at least one other dimension (usually a time dimension).  Just select the ProbBands view in the top-left corner of the result view.&lt;br /&gt;
&lt;br /&gt;
:[[image:ProbBands-select.png]]&lt;br /&gt;
&lt;br /&gt;
== Box-Box-Box plots ==&lt;br /&gt;
&lt;br /&gt;
To obtain a box-box-box plot, select a [[ProbBands]] result view, then double click to change the chart type settings.  Select a bar chart, check the &amp;quot;Variable origin&amp;quot;, and uncheck &amp;quot;Swap horizontal and vertical&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-graphSetup.png]]&lt;br /&gt;
&lt;br /&gt;
Next, press ''Ctrl+U'' ([[Uncertainty Setup dialog]]) and select the probability levels of interest:&lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-probability-levels.png]]&lt;br /&gt;
&lt;br /&gt;
Finally, ensure your horizontal axis is your time index, Key is Probability, and then for [[Bar Origin]] select ''Probability = 0'' (or your lowest selected fractile):&lt;br /&gt;
&lt;br /&gt;
:[[image:Box-box-box-plot.png]]&lt;br /&gt;
&lt;br /&gt;
== Whisker-Whisker-Whisker plots ==&lt;br /&gt;
&lt;br /&gt;
The Whisker-whisker-whisker plot is sometimes a little tricky to get right.  Once again, display the [[ProbBands]] view. You must add your Time in as a comparison index, even though it already appears as a pivoter index.  This enables the use of an XY graph with more flexible control over which series of points are connected by lines (the running index).  &lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-XY-setting.png]]&lt;br /&gt;
&lt;br /&gt;
You need to use a line-symbol chart type, and select '''Use Separate color / symbol keys''':&lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-ChartType-setting.png]]&lt;br /&gt;
&lt;br /&gt;
With this, you can now pivot as shown in the next final image to obtain the final graph:&lt;br /&gt;
&lt;br /&gt;
:[[image:Whisker-whisker-whisker-plot.png]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[media:Box-like-plots.ana|Box-like-plots.ana]]&lt;br /&gt;
* [[Graph settings]]&lt;br /&gt;
* [[Tornado Plots]]&lt;br /&gt;
* [[Bar Origin]]&lt;br /&gt;
* [[Statistical_Functions_and_Importance_Weighting#ProbBands|ProbBands]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Archived_webinars&amp;diff=52228</id>
		<title>Archived webinars</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Archived_webinars&amp;diff=52228"/>
		<updated>2018-11-08T18:57:56Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added link to the good tutorial videos page, since this is the first search return for me when I search 'webinars'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Videos]]&lt;br /&gt;
&lt;br /&gt;
Old webinars and videos that are out of date or recordings of poor quality. Visit the [[Tutorial videos]] page for the complete list of past webinars.&lt;br /&gt;
&lt;br /&gt;
=== New Features in [[Analytica 4.4]] ===&lt;br /&gt;
&lt;br /&gt;
'''Date and Time:''' 19 Jan 2012 10:00am Pacific Standard Time &lt;br /&gt;
&lt;br /&gt;
'''Presenter''': Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Abstract'''&lt;br /&gt;
&lt;br /&gt;
I will give a rapid overview of enhancements and changes in [[Analytica 4.4]] and what these mean for people upgrading from Analytica 4.3.&lt;br /&gt;
I'll give quick demonstrations of Expression Assist, Publish to [[ACP|Cloud]], Kernel density smoothing, adjusting legacy models for Clear Type font, Help balloons, and dozens of small improvements that you'll find listed at [[What's new in Analytica 4.4?]].  I'll include a few hidden gems.  In following weeks, &lt;br /&gt;
we will follow up with more in-depth webinars on specific items.&lt;br /&gt;
&lt;br /&gt;
Watch a recording of this webinar from [http://AnalyticaOnline.com/WebinarArchive/2012-01-19-New-In-Analytica-4.4.wmv New In Analytica 4.4.wmv]&lt;br /&gt;
&lt;br /&gt;
=== Analytica Web Player ===&lt;br /&gt;
&lt;br /&gt;
'''Date and Time:''' Thursday, August 7, 2008, 10:00am Pacific Daylight Time&lt;br /&gt;
&lt;br /&gt;
'''Presenter:''' Max Henrion, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
The Analytica Web Player (AWP) is scheduled to launch on July 31, 2008.  AWP is a subscription service hosted on Lumina's servers.  As a subscriber, you can upload your models to the server and send your colleagues a URL so that they can view your model.  To view your models, they need only a Flash-enabled web browser.  They can browser your model, change inputs, and evaluate results, all from within their web browser.&lt;br /&gt;
&lt;br /&gt;
In this talk we'll cover the available subscription plans, pricing, limitations, and how you sign up.  We'll also demonstrate the process of uploading models and sharing these with colleagues.&lt;br /&gt;
&lt;br /&gt;
You can watch a recording of this webinar at [http://AnalyticaOnline.com/WebinarArchive/2008-08-07-AWP.wmv AWP.wmv].&lt;br /&gt;
&lt;br /&gt;
=== Manipulating Indexes and Arrays in Analytica Expressions ===&lt;br /&gt;
&lt;br /&gt;
Demonstrates common operations applied to indexes and arrays from within Analytica expressions, including the powerful [[Subscript]] and [[Slice]] operations,  [[Associative_vs._Positional_Indexing|duality of associational and positional indexing]], including @I, A[@I=n], and @[I=n] operations. Explains the distinction between index and value contexts in expressions, along with the distinction between a variable's index value, mid value and sample value, [[Self-Indexed Arrays]].  Explains slice assignment -- the ability to assign values to individual slices of an array within an algorithm.&lt;br /&gt;
&lt;br /&gt;
Audience: Moderate to advanced Analytica users.&lt;br /&gt;
&lt;br /&gt;
Watch [[media:Indexes and Arrays UG2.ANA | &amp;quot;Indexes and Arrays UG2.ANA&amp;quot;]].  (This wouldn't be very interesting for someone who didn't attend, but it contains the examples we tried).&lt;br /&gt;
&lt;br /&gt;
'''Missing the link to video file.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Presented by:&amp;lt;/b&amp;gt; Lonnie Chrisman, CTO, Lumina Decision Systems on Aug 9, 2007.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Example_Models&amp;diff=52211</id>
		<title>Example Models</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Example_Models&amp;diff=52211"/>
		<updated>2018-10-30T20:20:42Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Changed PV video link to YouTube rather than Camtasia embedded video player. Thought: driving traffic to our YouTube page is desirable.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Models]]&lt;br /&gt;
[[category:Doc Status D]]&lt;br /&gt;
&lt;br /&gt;
You may find these example Analytica models useful to see what Analytica can do, and as inspiration or a starting point for your own models. They cover a wide variety of topics and techniques.  &lt;br /&gt;
&lt;br /&gt;
These examples supplement the example models that are [[Example Models and Libraries |installed with Analytica]] into the Examples folder. &lt;br /&gt;
&lt;br /&gt;
You can are also invited to contribute your own models as examples. For how to do that, see [[Uploading Example Models]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Business Examples==&lt;br /&gt;
&lt;br /&gt;
=== Marginal Abatement Graph ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Marginal abatement heating energy.png]]&lt;br /&gt;
&lt;br /&gt;
This model, along with [http://blog.lumina.com/2015/marginal-abatement/ the accompanying blog article], show how to set up a Marginal Abatement graph in Analytica.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Graph methods, carbon price, energy efficiency, climate policy, optimal allocation, budget constraint.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Marginal abatement home heating.ana|Marginal abatement home heating.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Solar Panel Analysis ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Solar Panel Analysis.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Would it be cost effective to install solar panels on the roof of my house? This model explores this question for my situation in San Jose, California. [https://www.youtube.com/watch?v=vhSor_fPIsI An accompanying video] documents the building of this model, and is a good example of the process one goes through when building any decision model.&lt;br /&gt;
&lt;br /&gt;
The model explores how many panels I should install, and what the payoff is in terms of [[NPV|net present value]], [[IRR|Internal rate of return]] and time to recoup cost. It also looks at whether I should postpone the start of the installation to take advantage of rapidly falling PV prices, or cash in on tax credits.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''':  Renewable energy, photovoltaics, net present value, internal rate of return, tax credits, agile modeling.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Solar Panel Analysis.ana|Solar Panel Analysis.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Items within Budget function ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Given a set of items, with a priority and a cost for each, the function Items_within_budget function selects out the highest priority items that fit within the fixed budget. &lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Items_within_budget.ana|Items within budget.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Grant Exclusion Model ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model tests a hypothesis about the distribution of an attribute of the marginal rejectee of a grant program, given the relevance of that attribute to award of the grant.  It could be used by an organization to make decisions as to whether to fiscally-sponsor another organization that will use that fiscal sponsorship to apply for grants, by looking at the effect on the pool of grant recipients overall.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Business analysis&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Grant_exclusion.ANA|Grant exclusion.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Project Planner ===&lt;br /&gt;
&lt;br /&gt;
:[[Image: Project planner model.png |500px]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This is a demo model that shows how to:&lt;br /&gt;
* Evaluate a set of R&amp;amp;D projects, including uncertain R&amp;amp;D costs, and uncertain revenues if it leads to release of a commercial product.&lt;br /&gt;
* Use multiattribute analysis to compare projects, including a hard attribute -- expected net present value -- and soft attributes -- strategic fit, staff development, and public good will.&lt;br /&gt;
* Compare cost, [[NPV]], and multiattribute value for a selected portfolio of projects.&lt;br /&gt;
* Generate the best portfolio (ratio of NPV or multiattribute merit to cost) given a R&amp;amp;D budget.&lt;br /&gt;
&lt;br /&gt;
The model linked here is only a test, and to an older version: [[File:Project_priorities_2007_4.0.ANA]]&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Business models, cost analysis, net present value (NPV), uncertainty analysis&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Project Priorities 5 0.ana|Project Priorities 5 0.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Steel and Aluminum import tariff impact on US trade deficit ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Steel and aluminum tariff model diagram.png|400px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' On 2-March-2018, President Trump proposed new import tariffs on steel and aluminum. It seems as if the projected net impacts of these tariffs on the total US trade deficit and US economy depends largely on which news outlets you get your news from. We thought it would be helpful to put together a simple and easy to understand model to estimate of the net impact of these tariffs on the US trade deficit, assuming that no other factors change (e.g., no retaliatory tariffs are enacted by other countries). We wanted something that allows you to understand how its estimates are being derived, with assumptions that can be easily replaced with your own, so that the model itself would be impartial to any particular viewpoint. We want the uncertainties that are inherent in such a simple model to be explicit, so you can see the range of possibilities and not just a single guess. Finally, we wanted the model to be easy to understand fully for non-economists (a group to which we belong, too).&lt;br /&gt;
&lt;br /&gt;
This model accompanied a current event blog post on the Lumina blog: [http://lumina.com/blog/impact-of-trumps-proposed-steel-aluminum-tariffs-on-us-trade-deficit Impact of Trump’s proposed Steel &amp;amp; Aluminum tariffs on US trade deficit]&lt;br /&gt;
&lt;br /&gt;
'''Authors:''' Kimberley Mullins and Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Steel and aluminum tariff model.ana|Steel and aluminum tariff model.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Tax bracket interpolation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:Tax bracket interpolation.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Computes amount of tax due from taxable income for a 2017 US Federal tax return. To match the IRS's numbers exactly, it is necessary to process tax brackets correctly as well as implementation a complex mix of rounding rules that reproduce the 12 pages of table lookups from the Form 1040 instructions. This model is showcased in a blog article, [http://Lumina.com/blog/how-to-simplify-the-irs-tax-tables How to simplify the IRS Tax Tables].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media: Tax bracket interpolation.ana|Tax bracket interpolation.ana]]&lt;br /&gt;
&lt;br /&gt;
==Data Analysis==&lt;br /&gt;
&lt;br /&gt;
=== Sampling from only feasible points ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' You have a bunch of chance variables, each with a probability distribution. Their joint sample, however, contains some combinations of points that are (for one reason or another) physically impossible. We'll call those infeasible points. You'd like to eliminate those points from the sample and keep only the feasible points. &lt;br /&gt;
&lt;br /&gt;
This module implements a button that will sample a collection of chance variables, then reset the sample size and keep only those sample points that are &amp;quot;feasible&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Obviously, this approach will work best when most of your samples are feasible. If you can handle the &amp;quot;infeasible&amp;quot; points in your model directly, by conditioning certain chance variables on others, that is far preferable. But there are some cases where this solution (although a bit of a kludge) is more convenient. &lt;br /&gt;
&lt;br /&gt;
The instructions for how to use this are in the module description field.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Statistics, sampling, Importance sampling, feasibility, Monte Carlo simulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download''':  [[Media:Feasible_Sampler.ana|Feasible Sampler.ana]] &lt;br /&gt;
&lt;br /&gt;
=== Cross-Validation / Fitting Kernel Functions to Data ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Cross-validated data fit.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' When fitting a function to data, if you have too many free parameters relative to the number of points in your data set, you may &amp;quot;overfit&amp;quot; the data.  When this happens, the fit to your training data may be very good, but the fit to new data points (beyond those used for training) may be very poor.&lt;br /&gt;
&lt;br /&gt;
Cross-validation is a common technique to deal with this problem: We set aside a fraction of the available data as a cross-validation set.  Then we begin by fitting very simple functions to the data (with few free parameters), successively increasing the number of free parameters, and seeing how the predictive performance changes on the cross-validation set.  It is typical to see improvement on the cross-validation set for a while, followed by a deterioration of predictive performance on the cross-validation set once overfitting starts occurring.  &lt;br /&gt;
&lt;br /&gt;
This example model successively fits a non-linear kernel function to the residual error, and uses cross-validation to determine how many kernel functions should be used.&lt;br /&gt;
&lt;br /&gt;
Requires Analytica Optimizer: The kernel fitting function (Kern_Fit) uses [[NlpDefine]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''  Cross-validation, overfitting, non-linear kernel functions&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Cross-validation example.ana|Cross-validation example.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Statistical Bootstrapping ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Bootstrapping is a technique from statistics for estimating the sampling error present in a statistical estimator.  The simplest version estimates sampling error by resampling the original data.  This model demonstrates how to do this in Analytica.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Bootstrapping, sampling error, re-sampling&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Bootstrapping.ana|Bootstrapping.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Smooth PDF plots using Kernel Density Estimation ===&lt;br /&gt;
&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| [[image:Dens_Est_builtin_pdf.png|frame|Analytica's built-in PDF plot with default settings]] &lt;br /&gt;
|&lt;br /&gt;
[[image:Dens_Est_Kernel_pdf.png|frame|PDF computed from Kernel Density estimation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This example demonstrates a very simple fixed-width kernel density estimator to estimate a &amp;quot;smooth&amp;quot; probability density.   The built-in PDF function in Analytica often has a choppy appearance due to the nature of histogramming -- it sets up a set of bins and counts how many points land in each bin.  A kernel density estimator smooths this out, producing a less choppy PDF plot.&lt;br /&gt;
&lt;br /&gt;
This smoothing is built into [[Analytica 4.4]].  You can select [[Kernel Density Smoothing|smoothing]] from the [[Uncertainty Setup dialog]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Kernel density estimation, kernel density smoothing&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Kernel_Density_Estimation.ana|Kernel Density Estimation.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Output and Input Columns in Same Table ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Output and input columns.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Presents an input table to a user, where one column is populated with computed output data, the other column with checkboxes for the user to select.  Although the '''Output Data''' column isn't read only, as would be desired, a [[Check Attribute]] has been configured to complain if he does try to change values in that column.  The model that uses these inputs would ignore any changes he makes to data in the '''Output Data''' column.&lt;br /&gt;
&lt;br /&gt;
Populating the '''Output Data''' column requires the user to press a button, which runs a button script to populate that column.  This button is presented on the top-level panel.  If you change the input value, the output data will change, and then the button needs to be pressed to refresh the output data column.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Data analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Output and input columns.ana|Output and input columns.ana]]&lt;br /&gt;
&lt;br /&gt;
==Decision Analysis==&lt;br /&gt;
&lt;br /&gt;
=== Retirement plan type comparison ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Comparing retirement account types.png|500px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Will you end up with a bigger nest egg at retirement with a 401(k), traditional IRA, Roth IRA or a normal non-tax-advantaged brokerage account? For example, comparing a Roth IRA to a normal brokerage, intermediate capital gains compound in the Roth, but eventually you pay taxes on those gains at your income tax rate at retirement, whereas in the brokerage you pay capital gains taxes on the gains, which is likely a lower tax rate. So does the compounding outweigh the tax rate difference? What effect do the higher account maintenance fees in a 401(k) account have? How sensitive are these conclusions to the various input estimates? The answers to all these questions depend on your own situation, and may different for someone else. Explore these questions with this model.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' 401(k), IRA, retirement account, decision analysis, uncertainty, sensitivity analysis, [[MultiTable]]s.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Comparing retirement account types.ana|Comparing retirement account types.ana]]. &lt;br /&gt;
::For a version without the sensitivity analysis part, which has fewer than 100 object and can thus be modified using [http://lumina.com/products/free101/ Analytica Free 101], you can use this one: [[media:Comparing retirement account types without sensitivity.ana|Comparing retirement account types without sensitivity.ana]].&lt;br /&gt;
&lt;br /&gt;
=== Plane Catching Decision with Expected Value of Including Uncertainty ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A simple model to assess what time I should leave my home to catch a plane, with uncertain driving time, walking from parking to gate (including security), and how long I need to be at the gate ahead of scheduled departure time. It uses a loss model based on minutes, assuming I value each extra minute snoozing in bed and set the loss if I miss the plane to 400 of those minutes.&lt;br /&gt;
&lt;br /&gt;
It illustrates the EVIU (expected value of including uncertainty) i.e. the difference in expected value if I make a decision to minimize expected loss instead of decision to minimize time ignoring uncertainty (assuming each distribution is fixed at its mid value). For more details see &amp;quot;The  Value of Knowing How Little You Know&amp;quot;, Max Henrion, PhD Dissertation, Carnegie Mellon University, 1982.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Decision theory, decision analysis, uncertainty, Monte Carlo simulation, value of information, EVPI, EVIU.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Plane catching decision with EVIU.ana|Plane catching decision with EVIU.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Marginal Analysis for Control of SO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; emissions ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Acid rain in eastern US and Canada caused by sulfur dioxide is emitted primarily by coal-burning electric-generating plants in the Midwestern U.S.  This model demonstrates a marginal analysis a.k.a. benefit/cost analysis to determine the policy alternative that leads us to the most economically efficient level of cleanup.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Environmental engineering, cost-benefit analysis, marginal analysis &lt;br /&gt;
&lt;br /&gt;
'''Author:''' Surya Swamy&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Marginal Analysis for Control of SO2 Emissions.ana|Marginal Analysis for Control of SO2 Emissions.ana]]&lt;br /&gt;
&lt;br /&gt;
==Dynamic Models==&lt;br /&gt;
&lt;br /&gt;
=== Donor/Presenter Dashboard ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model implements a continuous-time Markov chain in Analytica's discrete-time dynamic simulation environment.  It supports immigration to, and emigration from, every node.&lt;br /&gt;
&lt;br /&gt;
It can be used by an arts organization to probabilistically forecast future audience evolution, in both the short and the long (steady state) term.  It also allows for uncertainty in the input parameters.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dynamic models, Markov processes&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Donor_Presenter_Dashboard_II.ANA|Donor-Presenter Dashboard.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Regulation of Photosynthesis ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Photosynthesis fluorescence.jpg]]&lt;br /&gt;
&lt;br /&gt;
A model of how photosynthesis is regulated inside a cyanobacteria.  As light exposure varies over time (and you can experiment with various light intensity waveforms), it simulates the concentration levels of key transport molecules along the chain, through the PSII complex, plasto-quinone pool, PSI complex, down to metabolic oxidation.  The dynamic response to light levels, or changes in light levels, over time becomes evident, and the impact of changes to metabolic demand can also be observed.  In the graph of fluorescence above, we can see an indicator of how much energy is being absorbed, in three different cases (different light intensities).  In the two higher intensity cases, photoinhibition is observed -- a protective mechanism of the cell that engages when more energy is coming in than can be utilized by the cell.  Excess incoming energy, in the absence of photoinhibition, causes damage, particularly to the PSII complex.&lt;br /&gt;
&lt;br /&gt;
This model uses node shapes for a different purpose than is normally seen in decision analysis models.  In this model, ovals, instead of depicting chance variables, depict chemical reactions, where the value depicts the reaction rate, and rounded rectangles depict chemical concentrations.&lt;br /&gt;
&lt;br /&gt;
Two models are attached.  The first is a bit cleaner, and focused on the core transport chain, as described above.  The second is less developed, but is focused more on genetic regulation processes.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''  Photosynthesis, dynamic models&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:'''&lt;br /&gt;
* [[media:Photosynthesis regulation.ANA|Photosynthesis Regulation.ana]] - main regulation pathways&lt;br /&gt;
* [[media:Photosystem.ana | Photosystem.ana]] - rough sketch of genetic regulation.&lt;br /&gt;
&lt;br /&gt;
=== Time-series re-indexing ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Weekly_data_graph_ex.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model contains some examples of time-series re-indexing.  It is intended to demonstrate some of these basic techniques.&lt;br /&gt;
&lt;br /&gt;
In this example, actual measurements were collected at non-uniform time increments.  Before analyzing these, we map these to a uniformly spaced time index (&amp;lt;code&amp;gt;Week&amp;lt;/code&amp;gt;), occurring on Monday of each week.  The mapping is done using an interpolation.  The evenly-spaced data is then used to forecast future behavior.  We first forecast over an index containing only future time points (&amp;lt;code&amp;gt;Future_weeks&amp;lt;/code&amp;gt;), using a log-normal process model based on the historical weekly change.  We then combine the historical data with the forecast on a common index (&amp;lt;code&amp;gt;Week&amp;lt;/code&amp;gt;).  A prob-bands graph of the weekly_data result shows the range of uncertainty projected by the process model (you'll notice the uncertainty exists only for future forecasted values, not historical ones).&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dynamic models, forecasting, time-series re-indexing&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Time-series-reindexing.ana|Time-series-reindexing.ana]]&lt;br /&gt;
&lt;br /&gt;
==Engineering Examples==&lt;br /&gt;
&lt;br /&gt;
=== Timber Post Compression Load Capacity ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Here is a calculator for computing the maximum load that can be handled by a Douglas Fir - Larch post of a given size, grade, and composition in a construction setting.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:PostCompression.ana|Post Compression Model]]&lt;br /&gt;
&lt;br /&gt;
=== Compression Post Load Calculator ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Computes the load that a Douglas-Fir Larch post can support in compression.  Works for different timber types and grades and post sizes.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Compression analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Compression_Post_Load_Capacity.ana|Compression Post Load Capacity.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Daylighting Options in Building Design ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter_9.7-updated.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A demonstration showing how to analyze lifecycle costs and savings from daylighting options in building design.&lt;br /&gt;
&lt;br /&gt;
Analysis based on Nomograph Cost/Benefit Tool for Daylighting. adapted from S.E. Selkowitz and M. Gabel. 1984. &amp;quot;LBL Daylighting Nomographs,&amp;quot; LBL-13534, Lawrence Berkeley Laboratory, Berkeley CA, 94704. (510) 486-6845.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Engineering, cost-benefits analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Daylighting analyzer.ana|Daylighting analyzer.ana]]&lt;br /&gt;
&lt;br /&gt;
=== California Power Plants ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' An example showing how to use Choice menus and Checkbox inside an Edit table. It also shows how to use the Cell default attribute to specify default values (including Choice menu and Checkbox with default selections) specified in &amp;quot;Default Plant Data&amp;quot; to be used when user creates a new row in the Edit table.  This model shows how to demonstrates the use of [[Choice|choice pulldowns]] in edit tables.  The model is created during a mini-tutorial on [[Inserting Choice Controls in Edit Table Cells]] elsewhere on this Wiki.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Edit table, Choice menu, pulldown menu, checkbox, Power plants.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:California_Power_Plants.ANA|California Power Plants.ana ]]&lt;br /&gt;
&lt;br /&gt;
=== Electrical Generation and Transmission ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This model of an electrical network minimizes total cost of generation and transmission.  Each node in the network has power generators and consumers (demand).  Nodes are connected by transmission links. Each link has a maximum capacity in Watts and an admittance (the real part of impedance is assumed to be zero).  Each generator has a min and max power and a marginal cost in $/KWh.  The model uses a linear program to determine how much power each generator should produce so as to minimize total cost of generation and transmission, while satisfying demand and remaining within link constraints.&lt;br /&gt;
&lt;br /&gt;
''Requires Analytica Optimizer''&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Electrical engineering, power generation and transmission&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Electrical Transmission.ana|Electrical Transmission.ana]]&lt;br /&gt;
&lt;br /&gt;
==Fun and Games==&lt;br /&gt;
&lt;br /&gt;
=== Color Map ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Color_map.gif]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A model which highlights [[Cell Format Expression|Cell Formatting]] and [[Computed cell formats|Computed Cell Formats]]. Model result is a 'color map' wherein the cell fill color is computed based on three input variables (R, G, and B), the computed color is displayed in hexadecimal, and the font color of the hexadecimal color is determined by the cell fill color.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Computed cell formatting&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Kimberley Mullins, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:color_map.ana|Color map.ana]]&lt;br /&gt;
&lt;br /&gt;
=== 2018 World Cup Soccer final ===&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:World cup.ana|World cup.ana]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' On July 15, 2018, France beat Croatia 4-2 in the final game of the World Cup to become world champions. But how much of that is can be attributed to France being the better team versus to the random chance? This model accompanies my blog article, [http://lumina.com/blog/world-cup-soccer.-how-much-does-randomness-determine-the-winner World Cup Soccer. How much does randomness determine the winner?], where I explore this question and use the example to demonstrate the [[Poisson|Poisson distribution]].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
=== Image recognition ===&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [http://AnalyticaOnline.com/Lonnie/resnet18.zip resnet18.zip]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Show it an image, and it tries to recognize what it is an image of, classifying it among 1000 possible categories. It uses an 18-layer residual network. This model is described and demonstrated in a video in the blog article [http://lumina.com/blog/an-analytica-model-that-recognizes-images An Analytica model that recognizes images].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems.  (Analytica implementation). Residual network developed by&lt;br /&gt;
* Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, &amp;quot;Deep Residual Learning for Image Recognition&amp;quot;, https://arxiv.org/abs/1512.03385 rXiv:1512.03385]&lt;br /&gt;
&lt;br /&gt;
==Function Examples==&lt;br /&gt;
&lt;br /&gt;
=== Transforming Dimensions by transform matrix, month to quarter ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The model shows how to transform an array from a finer-grain index (e.g., Month) onto a coarser index (e.g., Quarter).  We generally refer to this as [[Aggregate|aggregation]].   The model illustrates the direct use of [[Aggregate]], as well as a method to do this used before Aggregate was added to Analytica in release 4.2.&lt;br /&gt;
&lt;br /&gt;
'''Webinar:''' [[Analytica_User_Group/Past_Topics#The_Aggregate_Function|the Aggregate function]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': Aggregation, level of detail, days, weeks, months, quarters, years.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[Media:Month to quarter.ana|Month to quarter.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Convolution ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Convolution is used mostly for signal and systems analysis. It is a way to combine two time series.  This model contains function Convolve(Y, Z, T, I), that computes the convolution of two time series.  The model contains several examples of convolved functions.&lt;br /&gt;
&lt;br /&gt;
A time series is a set of points, &amp;lt;code&amp;gt;(Y, T)&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; is the ascending X-axis, and the set of points is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. The values of &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; do not have to be equally spaced. The function treats &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt; as being equal to 0 outside the range of &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt;. The two time series here are the set of points &amp;lt;code&amp;gt;(Y, T)&amp;lt;/code&amp;gt; and the set of points &amp;lt;code&amp;gt;(Z, T)&amp;lt;/code&amp;gt;, where both sets of points are indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The mathematical definition of the convolution of two time series is the function given by:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;h(t) = \int y(u) z(t-u) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Signal analysis, systems analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Convolution.ana|Convolution.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Dependency Tracker Module ===&lt;br /&gt;
&lt;br /&gt;
:[[image:Dependency tracker.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This module tracks dependencies through your model, updating the visual appearance of nodes so that you can quickly visualize the paths by which one variable influences another.  You can also use it to provide a visual indication of which nodes are downstream (or upstream) from an indicated variable.&lt;br /&gt;
&lt;br /&gt;
The module contains button scripts that change the bevel appearance of nodes in your model.  To see how Variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; influences Variable &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;, the script will bevel the nodes for all variables that are influenced by &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; and influence &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.  Alternatively, you can bevel all nodes that are influenced by &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, or you can bevel all nodes that influence &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the image above, the path from &amp;lt;code&amp;gt;dp_ex_2&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;dp_ex_4&amp;lt;/code&amp;gt; has been highlighted using the bevel style of the nodes.  (The result of pressing the &amp;quot;Bevel all from Ancestor to Descendant&amp;quot; button)&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Dependency analysis&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Dependency_Tracker.ANA | Dependency Tracker.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Multi-lingual Influence Diagram ===&lt;br /&gt;
&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
| [[Image:English-view.png]]&lt;br /&gt;
| [[Image:French-view.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Maintains a single influence diagram with Title and Description attributes in both English and French.  With the change of a pull-down, the influence diagram and all object descriptions are instantly reflected in the language of choice.&lt;br /&gt;
&lt;br /&gt;
If you change a title or description while viewing English, and then change to French, the change you made will become the English-language version of the description.  Similarly if you make a change while viewing French.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Multi-lingual models&lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:French-English.ana|French-English.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Extracting Data from an XML file ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Suppose you receive data in an XML format that you want to read into your model. This example demonstrates two methods for extracting data: Using a full XML DOM parser, or using regular expressions. The first method fully parses the XML structure, the second simply finds the data of interest by matching patterns, which can be easier for very simple data structures (as is often the case).&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Data extraction, xml, DOM parsing &lt;br /&gt;
&lt;br /&gt;
'''Author:''' D. Rice, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Parsing XML example.ana|Parsing XML example.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Vector Math ===&lt;br /&gt;
&lt;br /&gt;
'''Description:'''&lt;br /&gt;
Functions used for computing geospatial coordinates and distances. Includes:&lt;br /&gt;
* A cross product of vectors function&lt;br /&gt;
* Functions to conversion between spherical and Cartesian coordinates in 3-D&lt;br /&gt;
* Functions to compute bearings from one latitude-longitude point to another&lt;br /&gt;
* Functions for finding distance between two latitude-longitude points along the great circle.&lt;br /&gt;
* Functions for finding the intersection of two great circles&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Geospatial analysis, GIS, vector analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Robert D. Brown III, Incite Decision Technologies, LLC&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Vector Math.ana|Vector Math.ana]]&lt;br /&gt;
&lt;br /&gt;
==Optimizer Examples==&lt;br /&gt;
&lt;br /&gt;
=== Total Allowable Harvest  ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The problem applies to any population of fish or animal whose dynamics are poorly known but can be summarized in a simple model:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;N_t + 1 = N_t*Lambda - landed catch*(1 + loss rate)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where «N_t» is the population size (number of individuals) at time ''t'', «N_t+1» is the population size at time ''t + 1'', «Lambda» is the intrinsic rate of increase and the «loss rate» is the percentage of fish or animals killed but not retrieved relative to the «landed catch», or catch secured.&lt;br /&gt;
&lt;br /&gt;
The question here is to determine how many fish or animals can be caught (landed) annually so that the probability of the population declining X%  in Y years (decline threshold) is less than Z% (risk tolerance).  &lt;br /&gt;
&lt;br /&gt;
Two models are available for download.  One uses the Optimizer ([[NlpDefine]]) to find the maximum landed catch at the risk tolerance level for the given decline threshold. The other (for those using a version of Analytica without Optimizer) uses [[StepInterp]] in an iterative way to get that maximum landed catch.    &lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Population analysis, dynamic models, optimization analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Models contributed by Pierre Richard&lt;br /&gt;
&lt;br /&gt;
'''Download:'''&lt;br /&gt;
* [[media:Total Allowable Removal model with Optimizer.ana | Total Allowable w Optimizer.ana]]&lt;br /&gt;
* [[media:Total Allowable Removal model w StepInterp.ana|Total Allowable w StepInterp.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Linearizing a discrete NSP ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A cereal formulation model&lt;br /&gt;
&lt;br /&gt;
A discrete mixed integer model that chooses product formulations to minimize total ingredient costs.  This could be an NSP but it uses two methods to linearize:&lt;br /&gt;
1) Decision variable is constructed as a constrained Boolean array&lt;br /&gt;
2) Prices are defined as piecewise linear curves&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' product formulation, cereal formulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' P. Sanford, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Cereal Formulation1.ana|Cereal Formulation1.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Neural Network ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A feed-forward neural network can be trained (fit to training data) using the Analytica Optimizer.  This is essentially an example of non-linear regression.  This model contains four sample data sets, and is set up to train a 2-layer feedforward sigmoid network to &amp;quot;learn&amp;quot; the concept represented by the data set(s), and then test how well it does across examples not appearing in the training set.&lt;br /&gt;
&lt;br /&gt;
Developed during the Analytica User Group Webinar of 21-Apr-2011 -- see the [[Analytica_User_Group/Past_Topics#Neural_Networks|webinar recording]].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Feed-forward neural networks, optimization analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Neural-Network.ana|Neural Network.ana]]&lt;br /&gt;
&lt;br /&gt;
==Risk Analysis==&lt;br /&gt;
&lt;br /&gt;
=== Earthquake Expenses ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' An example of risk analysis with time-dependence and costs shifted over time.&lt;br /&gt;
&lt;br /&gt;
Certain organizations (insurance companies, large companies, governments) incur expenses following earthquakes.  This simplified demo model can be used to answer questions such as:&lt;br /&gt;
* What is the probability of more than one quake in a specific 10 year period.&lt;br /&gt;
* What is the probability that in my time window my costs exceed $X?&lt;br /&gt;
&lt;br /&gt;
Assumptions in this model:  &lt;br /&gt;
* Earthquakes are Poisson events with mean rate of once every 10 years.&lt;br /&gt;
* Damage caused by such quake is lognormally distributed, with mean $10M adn stddev of $6M.&lt;br /&gt;
* Cost of damage gets incurred over the period of a year from the date of the quake as equipment is replaced and buildings are repaired over time:  20% in 1st quarter after quake, 50% in 2nd quarter, 20% in 3rd quarter, 10% in 4th quarter.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Risk analysis, cost analysis&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[media:Earthquake expenses.ana|Earthquake expenses.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Loan Policy Selection ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A lender has a large pool of money to loan, but needs to decide what credit rating threshold to require and what interest rate (above prime) to charge.  The optimal value is determined by market forces (competing lenders) and by the probability that the borrower defaults on the loan, which is a function of the economy and borrower's credit rating.  The model can be used without the Analytica optimizer, in which case you can explore the decision space manually or use a parametric analysis to find the near optimal solution.  Those with Analytica Optimizer can find the optimal solution (more quickly) using an [[NlpDefine|NLP]] search.&lt;br /&gt;
&lt;br /&gt;
'''Best used with Analytica Optimizer'''&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Creditworthiness, credit rating, default risk, risk analysis&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Loan policy selection.ANA|Loan policy selection.ana]]&lt;br /&gt;
&lt;br /&gt;
=== Inherent and Residual Risk Simulation ===&lt;br /&gt;
&lt;br /&gt;
:[[File:Prob of Exceeding Loss.png]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' The model simulates loss exceedance curves for a set of cybersecurity events, the likelihood and probabilistic monetary impact of which have been characterized by system experts. The goal of the model is assess the impact of mitigation measures, by comparing the residual risk curve to the inherent risk curve (defined as risk without any mitigation measures) and to the risk tolerance curve. This is a translation of a model built by Douglas Hubbard and Richard Seiersen which they describe in their book [https://www.howtomeasureanything.com/cybersecurity/about-the-book/ How to Measure Anything in Cybersecurity Risk], and which they make available [https://www.howtomeasureanything.com/cybersecurity/ here].&lt;br /&gt;
&lt;br /&gt;
'''Keywords:''' Cybersecurity risk, loss exceedance curve, simulation&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Kim Mullins&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Hubbard and Seiersen cyberrisk.ana|Hubbard_and_Seiersen_cyberrisk.ana]]&lt;br /&gt;
&lt;br /&gt;
== Graphing examples ==&lt;br /&gt;
=== Red or blue state ===&lt;br /&gt;
[[image:Red_or_blue_state.png|600px]]&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Red State Blue State plot.ana]]&lt;br /&gt;
&lt;br /&gt;
'''Description:''' This example contains the shape outlines for each of the 50 US states, along with a graph that uses color to depict something that varies by state (historical political party leaning). You may find the shape data useful for your own plots. In addition, it demonstrates the polygon fill feature that is new in [[Analytica 5.2]].&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Lonnie Chrisman, Lumina Decision Systems&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[New examples]]&lt;br /&gt;
* [[Additional libraries]]&lt;br /&gt;
* [[Uploading Example Models]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Using Add Module... to import a Model file]]&lt;br /&gt;
* [[Import a module or library]]&lt;br /&gt;
* [[Tutorial: Sharing a model with ACP]]&lt;br /&gt;
* [[Obfuscated and Browse-Only Models]]&lt;br /&gt;
* [[Filed modules and libraries]]&lt;br /&gt;
* [[Working with Models, Modules, and Files in ADE]]&lt;br /&gt;
* [[Combining models into an integrated model]]&lt;br /&gt;
* [[Model file formats]]&lt;br /&gt;
* [[Model Licensing]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Using_References&amp;diff=51757</id>
		<title>Using References</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Using_References&amp;diff=51757"/>
		<updated>2018-09-10T21:35:49Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Concepts]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Operator: \A ==&lt;br /&gt;
&lt;br /&gt;
The reference operator returns a reference to the value of «A».  «A» is an expression which is evaluated in the current context.  «A» reference acts as an [[atomic]] element for [[Array Abstraction|array abstraction]], and can be thought of as a pointer to a value (the value is often array-valued).  with the simple syntax, &amp;lt;code&amp;gt;\A&amp;lt;/code&amp;gt;, all dimensions of «A» are placed under the reference.&lt;br /&gt;
&lt;br /&gt;
A reference displays in a result table as «ref».  You can view the value pointed to by the reference by double-clicking on the cell containing «ref».&lt;br /&gt;
&lt;br /&gt;
== \[I, J]A ==&lt;br /&gt;
&lt;br /&gt;
A list of zero or more indexes can be specified with taking the reference of a value.  When indexes are specified, only those dimensions are swallowed by the reference.  If there are other dimensions, the result returned will be an array of references.  An empty list of references, &amp;lt;code&amp;gt;\[]A&amp;lt;/code&amp;gt;, creates pointers to atomic values.&lt;br /&gt;
&lt;br /&gt;
== Dereference Operator: #R ==&lt;br /&gt;
&lt;br /&gt;
When you have a reference (e.g., a pointer to a value), the dereference operator, &amp;lt;code&amp;gt;#R&amp;lt;/code&amp;gt;, returns the value pointed to.&lt;br /&gt;
&lt;br /&gt;
The operator has a lower precedence than subscript, so that &amp;lt;code&amp;gt;#R[I = x]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;#(R[I = x])&amp;lt;/code&amp;gt;.  In other words, when you have an array of references indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, this is how you get to the thing pointed to by one of those references.  If you need to slice the de-referenced value, then use &amp;lt;code&amp;gt;(#R)[I = x]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When «R» is an array of references, &amp;lt;code&amp;gt;#R&amp;lt;/code&amp;gt; will contain the union of all indexes from the de-referenced cells.  There are many cases where you want to avoid this, either because the resulting number of dimensions would be huge, or because two or more of the dereferenced values contain an implicit dimension (e.g., list), which would cause an error.  Because references are often used to separate items with distinct dimensionality, or to store separate lists, these situations are common for cases where references are used.  Thus, you will often need to explicitly loop with [[For..Do]] or other looping constructs, rather than letting array abstraction take care of it for you.&lt;br /&gt;
&lt;br /&gt;
== Comparisons ==&lt;br /&gt;
&lt;br /&gt;
Less-than and greater-than comparisons are not defined for references and always return [[Null]]. &lt;br /&gt;
&lt;br /&gt;
Testing equality of references gets a bit tricky, and in general it is a bad practice to rely on equality of references.  References are equal only if they point to the exact same data in memory.  The value pointed to by two references can be identical while the references are not considered equal.  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;\&amp;quot;Hello&amp;quot; = \&amp;quot;Hello&amp;quot; &amp;amp;rarr; 0               { they point to two different instances of &amp;quot;Hello&amp;quot; in memory }&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Var..Do|Var s := &amp;quot;Hello&amp;quot; Do (\s = \s) &amp;amp;rarr; 1     { Now they point to the same instance in memory }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
References to equal numbers, null, or undef do test for equality.&lt;br /&gt;
:&amp;lt;code&amp;gt;\1 = \1 &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;\Null = \Null &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Subscript]]ing on a reference does not work in Analytica 4.1 and earlier, even if the references are considered equal by the equality operator.  For example, &amp;lt;code&amp;gt;A[J = Slice(J, 1)]&amp;lt;/code&amp;gt; will not get the first slice in &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; when the first element of &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; is a reference.  This is remedied in Analytica 4.2.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Operators]]&lt;br /&gt;
* [[Set Functions]]&lt;br /&gt;
* [[References and Data Structures]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Using_References&amp;diff=51756</id>
		<title>Using References</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Using_References&amp;diff=51756"/>
		<updated>2018-09-10T21:34:44Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Temporary change to create a new page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Concepts]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Operator: \A ==&lt;br /&gt;
&lt;br /&gt;
The reference operator returns a reference to the value of «A».  «A» is an expression which is evaluated in the current context.  «A» reference acts as an [[atomic]] element for [[Array Abstraction|array abstraction]], and can be thought of as a pointer to a value (the value is often array-valued).  with the simple syntax, &amp;lt;code&amp;gt;\A&amp;lt;/code&amp;gt;, all dimensions of «A» are placed under the reference.&lt;br /&gt;
&lt;br /&gt;
A reference displays in a result table as «ref».  You can view the value pointed to by the reference by double-clicking on the cell containing «ref».&lt;br /&gt;
&lt;br /&gt;
== \[I, J]A ==&lt;br /&gt;
&lt;br /&gt;
A list of zero or more indexes can be specified with taking the reference of a value.  When indexes are specified, only those dimensions are swallowed by the reference.  If there are other dimensions, the result returned will be an array of references.  An empty list of references, &amp;lt;code&amp;gt;\[]A&amp;lt;/code&amp;gt;, creates pointers to atomic values.&lt;br /&gt;
&lt;br /&gt;
== Dereference Operator: #R ==&lt;br /&gt;
&lt;br /&gt;
When you have a reference (e.g., a pointer to a value), the dereference operator, &amp;lt;code&amp;gt;#R&amp;lt;/code&amp;gt;, returns the value pointed to.&lt;br /&gt;
&lt;br /&gt;
The operator has a lower precedence than subscript, so that &amp;lt;code&amp;gt;#R[I = x]&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;#(R[I = x])&amp;lt;/code&amp;gt;.  In other words, when you have an array of references indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, this is how you get to the thing pointed to by one of those references.  If you need to slice the de-referenced value, then use &amp;lt;code&amp;gt;(#R)[I = x]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When «R» is an array of references, &amp;lt;code&amp;gt;#R&amp;lt;/code&amp;gt; will contain the union of all indexes from the de-referenced cells.  There are many cases where you want to avoid this, either because the resulting number of dimensions would be huge, or because two or more of the dereferenced values contain an implicit dimension (e.g., list), which would cause an error.  Because references are often used to separate items with distinct dimensionality, or to store separate lists, these situations are common for cases where references are used.  Thus, you will often need to explicitly loop with [[For..Do]] or other looping constructs, rather than letting array abstraction take care of it for you.&lt;br /&gt;
&lt;br /&gt;
== Comparisons ==&lt;br /&gt;
&lt;br /&gt;
Less-than and greater-than comparisons are not defined for references and always return [[Null]]. &lt;br /&gt;
&lt;br /&gt;
Testing equality of references gets a bit tricky, and in general it is a bad practice to rely on equality of references.  References are equal only if they point to the exact same data in memory.  The value pointed to by two references can be identical while the references are not considered equal.  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;\&amp;quot;Hello&amp;quot; = \&amp;quot;Hello&amp;quot; &amp;amp;rarr; 0               { they point to two different instances of &amp;quot;Hello&amp;quot; in memory }&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Var..Do|Var s := &amp;quot;Hello&amp;quot; Do (\s = \s) &amp;amp;rarr; 1     { Now they point to the same instance in memory }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
References to equal numbers, null, or undef do test for equality.&lt;br /&gt;
:&amp;lt;code&amp;gt;\1 = \1 &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;\Null = \Null &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Subscript]]ing on a reference does not work in Analytica 4.1 and earlier, even if the references are considered equal by the equality operator.  For example, &amp;lt;code&amp;gt;A[J = Slice(J, 1)]&amp;lt;/code&amp;gt; will not get the first slice in &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; when the first element of &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; is a reference.  This is remedied in Analytica 4.2.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
[[Change node color example]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Operators]]&lt;br /&gt;
* [[Set Functions]]&lt;br /&gt;
* [[References and Data Structures]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Additional_libraries&amp;diff=51754</id>
		<title>Additional libraries</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Additional_libraries&amp;diff=51754"/>
		<updated>2018-09-06T18:27:58Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Function libraries]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes a set of useful Analytica function libraries.  These are ''additional'' to the [[Standard libraries]] that are automatically installed when you install Analytica.  If you want to use any of these additional libraries, click on its link and it will download onto your computer. Depending on your download settings, it may automatically open it in Analytica. Either way, you should save it into a directory so that you can add it into your models.  It's usually most convenient to save it with your [[Standard libraries]] in directory&lt;br /&gt;
:&amp;lt;code&amp;gt;c: Lumina/Analytica 4.6/Libraries&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then easily add it into your models using the standard menu option '''Add Library...''' from the [[File menu]].&lt;br /&gt;
&lt;br /&gt;
See [[User-defined Functions and Libraries]] to build your own functions and libraries.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Large Sample Library ===&lt;br /&gt;
'''Download:''' [[media:Large_Sample_Library_v10.ana|Large sample library v10.ana]]&lt;br /&gt;
&lt;br /&gt;
:[[image:Large sample library.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Large Sample Library: User Guide|Large Sample Library]] is an Analytica library that lets you run a Monte Carlo simulation for large models or a large sample size that might otherwise exhaust computer memory, including virtual memory. It breaks up a large sample into a series of batch samples, each small enough to run in memory. For selected variables, known as the Large Sample Variables or LSVs, it accumulates the batches into a large sample. You can then view the probability distributions for each LSV using the standard methods — confidence bands, [[PDF]], [[CDF]], etc. — with the full precision of the large sample.&lt;br /&gt;
&lt;br /&gt;
See [[Large Sample Library: User Guide]].&lt;br /&gt;
&lt;br /&gt;
===The Sensitivity Analysis Library===&lt;br /&gt;
[[The Sensitivity Analysis Library]] provides functions for analyzing the sensitivity of an output to each cell of each array-valued chance input, and locating those individual scalar inputs that have the greatest impact on the result.  See [[The Sensitivity Analysis Library]] for documentation on using this library.  &lt;br /&gt;
&lt;br /&gt;
The library itself can be downloaded from [[media:Sensitivity Analysis Library.ana|Sensitivity Analysis Library.ana]], and an example model to demonstrate its usage is at [[media:Sensitivity Functions Examples.ana|Sensitivity Functions Examples.ana]].&lt;br /&gt;
&lt;br /&gt;
=== Model Documentation Library ===&lt;br /&gt;
'''Download: ''' [[media:Model Documentation Library.ana|Model Documentation Library.ana]]&lt;br /&gt;
&lt;br /&gt;
'''Prerequisites:''' [[Analytica 5.0]] or later. The [[Preferences_dialog|Domain acts as self index]] legacy preference must be OFF. You must be using [[Diagram_Style_dialog|ClearType text]] (not the very old non-clearType legacy setting).&lt;br /&gt;
&lt;br /&gt;
Some people like to create a concise report on paper that contains all objects in their model along with descriptions or other selected attributes.  The &amp;quot;Print Report&amp;quot; feature in Analytica can be used for this purpose, but is not at all concise and ends up placing each object window on a separate page.  The ''Model Documentation Library'' allows you to select a module from your model and produce a result table containing every object within that module with its selected attributes such as title, description, units, definition, or user-defined attributes.  This table can then be exported to Excel where you can format it nicely and print it.  Thus, you can end up with a very concise report on paper.&lt;br /&gt;
&lt;br /&gt;
To use this library, load your model and then select '''File &amp;amp;rarr; Add Module...'''.  Add the [[media:Model Documentation Library.ana|Model Documentation Library.ana]] module file using Embed.  In that module, using the pulldown, select the top-level module for the report.  Follow the instructions shown on the diagram.  If you make changes to your model later, press the ''Update Model Documentation'' button to adjust the pulldown content.&lt;br /&gt;
&lt;br /&gt;
=== Units Conversion Library ===&lt;br /&gt;
'''Download: ''' [[media:Units conversion library.ana|Units conversion library.ana]]&lt;br /&gt;
&lt;br /&gt;
The functions in this library provide conversions between different units -- for example, from feet to kilometers, or from Btu (British thermal units) to gigajoules of energy.  Using this library relieves you from having to look up conversion factors. It also makes the model more transparent by making it clear where you are converting from one units to another -- instead of just embedding conversion constants in the formulas. &lt;br /&gt;
&lt;br /&gt;
Use '''Conversion_Factor'''(oldUnits, newUnits) to give a conversion factor between two units.&lt;br /&gt;
&lt;br /&gt;
If you omit «newUnits», it will assume the standard units for that type (dimensions).&lt;br /&gt;
&lt;br /&gt;
When specifying units , you must use a symbol (abbreviation) from the Units table.&lt;br /&gt;
&lt;br /&gt;
If the units are of different dimensions, e.g. energy and power, or if it doesn't recognize the units, it will give an error.&lt;br /&gt;
&lt;br /&gt;
Use '''Nom_to_real_dollars'''(yr, baseYr) to convert from nominal dollars for year «yr» to &amp;quot;real dollars&amp;quot; for specified «baseYr». If you omit «baseYr», it defaults to the Standard base year.&lt;br /&gt;
&lt;br /&gt;
=== Greatest Common Divisor functions ===&lt;br /&gt;
'''Download: ''' [[media:GCD function library.ana|GCD function library.ana]]&lt;br /&gt;
&lt;br /&gt;
This library contains two [[User-Defined Functions]] for computing the greatest common divisor.&lt;br /&gt;
&lt;br /&gt;
=== DB Conversion Library ===&lt;br /&gt;
'''Download: ''' [[media:Db conversion lib.ana|DB conversion lib.ana]]&lt;br /&gt;
&lt;br /&gt;
Lets you embed data obtained from a database into the Analytica model. This breaks the need to use it with an external database, so -- for example -- you can send to someone (e.g. Lumina tech support) who does not have access to the database or has an edition of Analytica (e.g. Professional) that doesn't support database access.  &lt;br /&gt;
&lt;br /&gt;
Press a button in this library to transform all the variables defined using [[DbQuery]], [[DbLabels]] and [[DbTable]] to literal data.  Variables and indexes defined using [[DbQuery]] or [[DbLabels]] are transformed to list definitions, and those defined using [[DbTable]] are transformed into edit tables.  This breaks the connection to the external database. So, of course, the model will no longer be able to get new or extended data from the database.&lt;br /&gt;
&lt;br /&gt;
The library is limited in its scope.  It only works when all calls to [[DbQuery]], [[DbLabels]] and [[DbTable]] occur at the top level of variable definitions.  Do not try to use it if the calls to these functions are embedded within larger expressions or in [[User-Defined Functions]].  &lt;br /&gt;
&lt;br /&gt;
'''''Use with extreme caution!!''''':  Make a copy of your original model ''before'' adding and executing this module.  After running the transformation, be sure to use '''File &amp;amp;rarr; Save As...''' to save the transformed model under a different filename, so you don't clobber your original model.&lt;br /&gt;
&lt;br /&gt;
=== Spreadsheet Helper Library ===&lt;br /&gt;
'''Download: ''' [[media:Spreadsheet Helper lib.ana|Spreadsheet Helper lib.ana]]&lt;br /&gt;
&lt;br /&gt;
Includes functions that return the list of worksheet names and the Excel filename of the workbook.  It also contains a SpreadsheetOpenEx function that can be used in place of [[SpreadsheetOpen]], but which remembers the filename selected by the user so the next time they don't have to select the file again.&lt;br /&gt;
&lt;br /&gt;
=== Data Standardization Library ===&lt;br /&gt;
'''Download: ''' [[media:Data Standardization Library.ana|Data Standardization Library.ana]]&lt;br /&gt;
&lt;br /&gt;
Imported data is often inconsistent.  This library allows you to choose what the &amp;quot;standard&amp;quot; values should be in a column of data.  You can then map any non-standard value to one of the standard values.  The result is a column of consistent data.&lt;br /&gt;
&lt;br /&gt;
== Individual functions with examples ==&lt;br /&gt;
&lt;br /&gt;
'''Download: '''  [[media:Recumulate example.ana|Recumulate example.ana]] : Like [[Cumulate]], but resets to zero at selected points.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[media:Apportion.ana|Apportion.ana]]: Aggregates or disaggregates an array of values from one index to another index, where the second index may be larger or smaller. Does not require the indexes to be index multiples of each other. For example, if you map from a 47-element index to a 13-element index, each 3.62 elements of the original map to an element in the destination, so for example, the first 3 items map to the first item, then the fourth item is shared, with 0.62 apportioned to the first element and 0.38 apportioned to the second element. Supports aggregation types &amp;lt;code&amp;gt;'SUM'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'AVERAGE'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'MIN'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'MAX'&amp;lt;/code&amp;gt;. Contributed by Paul Sanford of EPRI.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Standard libraries]]: Installed with Analytica&lt;br /&gt;
* [[User Libraries]]: How to create your own Libraries&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Large Sample Library: User Guide]]&lt;br /&gt;
* [[Modules and Libraries]]&lt;br /&gt;
* [[Filed modules and libraries]]&lt;br /&gt;
* [[User-defined Functions and Libraries]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Financial library functions]]&lt;br /&gt;
* [[The Sensitivity Analysis Library]] &lt;br /&gt;
* [[Distribution Densities Library]]&lt;br /&gt;
* [[Linked list library]]&lt;br /&gt;
* [[Base Conversion Function Library]]&lt;br /&gt;
* [[Performance Profiler library]]&lt;br /&gt;
* [[List of libraries]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=BitShift&amp;diff=51748</id>
		<title>BitShift</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=BitShift&amp;diff=51748"/>
		<updated>2018-08-30T17:26:41Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Added hexadecimal to RGB triplet example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Bit functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BitShift(x, shift'', left, I, rotate, bit'' ) ==&lt;br /&gt;
&lt;br /&gt;
Shifts the bits in an integer value «x» bit «shift» positions to the right, or by «shift» positions to the left when «left» is specified as true. Alternatively, «shift» can be negative to invert the shift direction.&lt;br /&gt;
&lt;br /&gt;
When an array is provided and the index «I» is specified, the bits are shifted to the adjacent cell. Each integer in each cell is considered to have 64 bits.&lt;br /&gt;
&lt;br /&gt;
When «rotate» is true, the bits are rotated, so that a bit that shifts off the right edge is used for the value of the bit shifted in on the left.&lt;br /&gt;
&lt;br /&gt;
When «rotate» is not specified, you can specify the value for new bits in the «bit» parameter, which must be either 0 or 1.&lt;br /&gt;
&lt;br /&gt;
When neither «rotate» nor «bit» are specified, then 0 bits are shifted into the result when shifting left, but when shifting right, the most significant bit (the 64th bit) is used, which has the effect of preserving the sign of the integer. This default is equivalent to integer division by powers of 2 when shifting right, and multiplication by powers of 2 when shifting left.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
To make the effect of the function obvious, integers are written here in [[Binary and hexadecimal integer formats|binary notation]].&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(0b110101011100, 5) &amp;amp;rarr;&amp;lt;/code&amp;gt; &lt;br /&gt;
::&amp;lt;code&amp;gt;0b1101010&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(3420, 5) &amp;amp;rarr;&amp;lt;/code&amp;gt; &lt;br /&gt;
::&amp;lt;code&amp;gt;106&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(0b110101011100, 5, left: true) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;0b110101011100000&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(3420, 5, left: true) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;109440&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Negative numbers have leading 1 bits, and are 64 bits in length. Shifting right shifts 1s into the left side.&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(-170, 5) &amp;amp;rarr;&amp;lt;/code&amp;gt; &lt;br /&gt;
::&amp;lt;code&amp;gt;0b1111111111111111111111111111111111111111111111111111111111111010 = -6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can shift in zero bits:&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(-170, 5) &amp;amp;rarr;&amp;lt;/code&amp;gt; &lt;br /&gt;
::&amp;lt;code&amp;gt;0b0000011111111111111111111111111111111111111111111111111111111010 = 576460752303423482&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(0b1101010111, 3, rotate: true) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;0b1110000000000000000000000000000000000000000000000000000001101010&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, shifting across cells of an array:&lt;br /&gt;
:&amp;lt;code&amp;gt;x :=&amp;lt;/code&amp;gt; &lt;br /&gt;
:[[image:BitShift_x.png]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(x, 4, I: J) &amp;amp;rarr; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[image:BitShift_right.png]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;BitShift(x, 4, I: J, rotate: true) &amp;amp;rarr; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[image:BitShift_right_rot.png]]&lt;br /&gt;
&lt;br /&gt;
=== Convert Hexadecimal to RGB numeric values ===&lt;br /&gt;
&lt;br /&gt;
Colors are commonly defined with three channels for information: Red, Green, and Blue. The BitShift function offers a straightforward way to convert colors defined by a hexadecimal string to numerical RGB triplet.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local Values|Local]] hex_val := 0x0079BF&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local Values|Local]] R := BitShift( hex_val, 16 ) &amp;amp;rarr; 00&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local Values|Local]] G := BitShift( hex_val, 8 ) - BitShift( R, 8, left: True ) &amp;amp;rarr; 79&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local Values|Local]] B := hex_val - BitShift( R, 16, True ) - BitShift( G, 8, True ) &amp;amp;rarr; BF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displayed as integers, these values are &amp;lt;code&amp;gt;[R, G, B] = [0, 121, 191]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Introduced in [[Analytica 5.0]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[BitAnd]]&lt;br /&gt;
* [[BitOr]]&lt;br /&gt;
* [[BitNot]]&lt;br /&gt;
* [[BitXOr]]&lt;br /&gt;
* [[BitCount]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=FAQs_on_Software_Licensing_and_Activation&amp;diff=51542</id>
		<title>FAQs on Software Licensing and Activation</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=FAQs_on_Software_Licensing_and_Activation&amp;diff=51542"/>
		<updated>2018-06-22T20:26:10Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a collection of frequently asked questions about activating your Analytica software products. If you have questions that aren't answered here, please let us know at [mailto:sales@lumina.com sales@lumina.com].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==License Server==&lt;br /&gt;
===Where do I find my software key?===&lt;br /&gt;
&lt;br /&gt;
:Colon to indent.&lt;br /&gt;
&lt;br /&gt;
Three apostrophes to '''bold''' text.&lt;br /&gt;
&lt;br /&gt;
''italics''&lt;br /&gt;
&lt;br /&gt;
===Second question===&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=FAQs_on_Software_Licensing_and_Activation&amp;diff=51541</id>
		<title>FAQs on Software Licensing and Activation</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=FAQs_on_Software_Licensing_and_Activation&amp;diff=51541"/>
		<updated>2018-06-22T19:45:49Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Created page with &amp;quot;This is a collection of frequently asked questions about activating your Analytica software products. If you have questions that aren't answered here, please let us know at sa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a collection of frequently asked questions about activating your Analytica software products. If you have questions that aren't answered here, please let us know at sales@lumina.com.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Where do I find my software key?===&lt;br /&gt;
Email.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiTable&amp;diff=51537</id>
		<title>MultiTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiTable&amp;diff=51537"/>
		<updated>2018-06-21T23:20:12Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Minor update to clarify the purpose of 'item' in the initial example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:User-interface functions]]&lt;br /&gt;
[[category:Top level functions]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MultiTable(i1,i2,...)(src1, src2, ...) ==&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] lets you mix editable and computed values in a single table. Editable cells are based on other variables, each defined as a [[Table]] or [[SubTable]]. Computed values are based on calculated variables or expressions.  When you change an editable cell, you are actually changing the original cell in the source table, not a copy.&lt;br /&gt;
&lt;br /&gt;
It is best practice in Analytica to keep different editable user inputs and computed results in different variables. But, it is often convenient to define part of a user interface that combines editable and computed values, which the [[MultiTable]] lets you do.&lt;br /&gt;
&lt;br /&gt;
For example, suppose &amp;lt;code&amp;gt;Startup_cost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Prob_success&amp;lt;/code&amp;gt; are both edit tables, indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;.  Then the a variable defined as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Project_inputs := MultiTable(Item)(Startup_cost, Prob_success)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lets you view and edit both Startup_cost and Prob_Success in the same edit table. The [[MultiTable]] is indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;, the index common to both Startup_cost and Prob_success, and by &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt;, which is an additional index that needs to be created. &lt;br /&gt;
&lt;br /&gt;
[[MultiTable]] is the inverse of [[SubTable]] in that it combines multiple sources into one view, where [[SubTable]] selects a particular slice or subset of data to edit.&lt;br /&gt;
&lt;br /&gt;
== Creating a MultiTable ==&lt;br /&gt;
&lt;br /&gt;
Before you create a [[MultiTable]], you need to create or identify one or more indexes that your data sources will vary over. For example, if you want a different data source to appear in each column of your table, then you'll need a column index, and you'll need to fill in the labels for each column as you define the index.&lt;br /&gt;
&lt;br /&gt;
Next, create a variable to hold your [[MultiTable]] and press ''Ctrl+E'' to place your cursor in the definition field.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create1.png]]&lt;br /&gt;
&lt;br /&gt;
In the '''Object Finder''', select the '''Array''' library and scroll down to find and select [[MultiTable]]. Then, press the '''Indexes''' button.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create2.png]]&lt;br /&gt;
&lt;br /&gt;
Select the indexes that your [[MultiTable]] data sources will vary along. These are not the indexes of your data sources themselves.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create3.png]]&lt;br /&gt;
&lt;br /&gt;
The table initially displays the &amp;quot;Meta expressions&amp;quot; view so that you can specify the data sources for the table. The ''meta-expression selector'' controls which view you are in. &lt;br /&gt;
&lt;br /&gt;
== Specifying Data Sources ==&lt;br /&gt;
&lt;br /&gt;
Whenever you need to specify or change which data source should appear in a [[MultiTable]], use the ''meta-expressions selector'' to change to '''meta-expressions view'''. &lt;br /&gt;
&lt;br /&gt;
Here is an example of meta-expressions.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create4.png]]&lt;br /&gt;
&lt;br /&gt;
In the above meta-expressions view, &amp;lt;code&amp;gt;Option_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Stock_symbol&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Strike_price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Expiration_date&amp;lt;/code&amp;gt; are identifiers of other edit tables. These will be editable columns. &amp;lt;code&amp;gt;Stock_price_lookup(Stock_Symbol)&amp;lt;/code&amp;gt; is a call to a [[User-Defined Function]], and its computed value will appear in this column. The last cell contains &amp;lt;code&amp;gt;Mid(Contract_valuation)&amp;lt;/code&amp;gt;, so that the computed mid-value of &amp;lt;code&amp;gt;Contract_valuation&amp;lt;/code&amp;gt; will be displayed. When you want the computed value of a variable, you must surround its identifier with [[Mid]] in this fashion, otherwise its definition will appear in the cell and will be editable.&lt;br /&gt;
&lt;br /&gt;
=== Editable sources ===&lt;br /&gt;
&lt;br /&gt;
An editable source reflects the contents of another edit table in your model, a [[slice]] of an edit table, or the [[definition]] of another variable. When a user edits these cells in the multitable, they are actually changing the data in the specified source definition or table. In meta-expression view, an editable source is specified in one of the following ways.&lt;br /&gt;
* &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; : An identifier. The definition of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, or the [[Table|edit table]] (or [[SubTable]] or [[MultiTable]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;) is depicted.&lt;br /&gt;
* &amp;lt;code&amp;gt;X[I=v]&amp;lt;/code&amp;gt; : A [[Slice]] or [[Subscript]] of another table. That slice is depicted in an editable form.&lt;br /&gt;
&lt;br /&gt;
The source can be a scalar variable, an [[Table|edit table]], a [[SubTable]] or another [[MultiTable]]. Rather arbitrary transformations that be accomplished by nesting SubTables and MultiTables.&lt;br /&gt;
&lt;br /&gt;
=== Computed sources ===&lt;br /&gt;
&lt;br /&gt;
The following are computed expressions, which are evaluated and the resulting value displayed in a non-editable form with a gray background.&lt;br /&gt;
* &amp;lt;code&amp;gt;31.4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;Text&amp;quot;&amp;lt;/code&amp;gt;: Literal values (numbers, quoted text)&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;: Displays the computed mid-value of the variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;F(...)&amp;lt;/code&amp;gt;: Any function call other than [[Slice]] or [[Subscript]], including calls to [[User-Defined Function]]s, are evaluated.&lt;br /&gt;
* &amp;lt;code&amp;gt;x + y&amp;lt;/code&amp;gt; : An expression, such as one involving arithmetic operations, is evaluated.&lt;br /&gt;
&lt;br /&gt;
Here are a few additional examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;  : ''computes and displays the [[mid]]-value of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Abs(X)&amp;lt;/code&amp;gt; : ''displays the [[Abs|absolute value]] of the (mid-value) of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Mean(X)&amp;lt;/code&amp;gt; : ''computes and displays the [[mean]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;1.2&amp;lt;/code&amp;gt; : ''displays the number, 1.2, in a non-editable cell''&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;Some text&amp;quot;&amp;lt;/code&amp;gt; : ''displays the text, without quotes, in a non-editable cell&lt;br /&gt;
&lt;br /&gt;
A computed expression or computed variable CAN depend on the values of other data sources that appear in the same [[MultiTable]]. When you do this, the computed value will change when the user changes the input cells and presses the green check button.&lt;br /&gt;
&lt;br /&gt;
== Viewing the Data ==&lt;br /&gt;
&lt;br /&gt;
After you have specified the data sources in meta-expression view, change the '''meta-expression selector''' to '''Show Cells''' to see the actual data.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create5.png]]&lt;br /&gt;
&lt;br /&gt;
=== When cells can be edited ===&lt;br /&gt;
&lt;br /&gt;
You can never edit computed values in a [[MultiTable]] &lt;br /&gt;
&lt;br /&gt;
In [[Browse mode]], you can edit data in a variable only if the variable has a [[user input node]].  This means that if your [[MultiTable]] variable has a user input node, users in [[Browse mode]] (including [[Analytica Cloud Player]] or [[Free Edition|Analytica Free 101]]) can edit all table sources.  Otherwise, if one source has a user input node and another does not, users in [[Browse mode]] can edit only those cells from the source(s) with the user in.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of an editable value and computed value in the same table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background:white; border:white; margin-left: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
 Index Base := [&amp;quot;Decimal&amp;quot;, &amp;quot;Hex&amp;quot;]&lt;br /&gt;
 Variable x := 123&lt;br /&gt;
 Variable HexConverter := MultiTable(Base)(x, NumberToText(x, &amp;quot;Hexadecimal&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The edit table displays like this:&lt;br /&gt;
&lt;br /&gt;
:[[image:HexConverter.png]]&lt;br /&gt;
&lt;br /&gt;
The first cell can be edited, and when you change it and press the green check, the [[Binary and hexadecimal integer formats|hexadecimal]] value is computed and displayed.&lt;br /&gt;
&lt;br /&gt;
== Dimensionality ==&lt;br /&gt;
&lt;br /&gt;
The dimensions of the [[MultiTable]] content are the union of the indexes from all sources and of the [[MultiTable]] index(es).&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] works best when your sources all have the same dimensionality.  When one source does not have an index present in another source, a single cell in the source will map to multiple cells in the [[MultiTable]]; hence, you'll see the same value multiple places, and when you change it, multiple cells will change.  The source retains its original dimensionality, so if the value doesn't vary along an index in the source, it won't vary along that index is the [[MultiTable]].  You may temporarily see a difference in these cells after you first enter a value, but they will become consistent as soon as you press the Green check.&lt;br /&gt;
&lt;br /&gt;
== Number Formats ==&lt;br /&gt;
&lt;br /&gt;
When number formats are set for the source tables, those formats are used in the corresponding column of the MultiTable.&lt;br /&gt;
&lt;br /&gt;
When a meta-expression is of the form &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;'s number format is used. For arbitrary expressions, the number format of the [[MultiTable]]'s own variable is used.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Introduced in [[Analytica 4.6]].  Present in experimental form in [[Analytica 4.5]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Tutorial: Arrays]]&lt;br /&gt;
* [[Arrays and Indexes]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[Mid]], [[Mean]], [[Sample]] -- used for specifying computed results.&lt;br /&gt;
* [[Subscript]], [[Slice]], [[Subscript/Slice Operator]]&lt;br /&gt;
* [[Objects and Values]]&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Foxes_and_hares_dynamic.ana&amp;diff=51514</id>
		<title>File:Foxes and hares dynamic.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Foxes_and_hares_dynamic.ana&amp;diff=51514"/>
		<updated>2018-06-14T19:35:33Z</updated>

		<summary type="html">&lt;p&gt;KMullins: Tutorial model from the system dynamics section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tutorial model from the system dynamics section.&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Open_a_model_to_browse&amp;diff=51430</id>
		<title>Tutorial: Open a model to browse</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Open_a_model_to_browse&amp;diff=51430"/>
		<updated>2018-06-01T17:42:41Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category: Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to open an example Analytica model: The '''Rent vs. Buy model''' lets you compare the cost of renting a house to the cost of buying one. You will learn how to: &lt;br /&gt;
* open an existing model, &lt;br /&gt;
* use it to calculate results, and &lt;br /&gt;
* change input values to calculate different results&lt;br /&gt;
* save your changes and quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/GQV0dnDN0Q0&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Video:''' [https://youtu.be/GQV0dnDN0Q0 Tutorial: Open a model to browse] (7 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Open the Rent vs. Buy model==&lt;br /&gt;
To begin, follow these steps.&lt;br /&gt;
# Launch Analytica: Click the '''Start''' button on the Windows taskbar. Click '''All Programs''' &amp;amp;rarr; '''Analytica {{#svarget:anarelease|4.6}}''' &amp;amp;rarr; '''Analytica {{#svarget:anarelease|4.6}}'''. &amp;lt;br&amp;gt;{{Release||4.6|[[File:Chapter 1.1.png|300px]]}}{{Release|5.0||[[File:Launch Ana5.0 from Start Menu.png|300px]]}}&lt;br /&gt;
# After Analytica starts, {{Release||4.6|&lt;br /&gt;
select '''File''' &amp;amp;rarr; '''Open''' from the menu.&lt;br /&gt;
# &amp;lt;br&amp;gt; [[File:Chapter 1.2a.png]]&lt;br /&gt;
# Open the Rent vs. Buy model. &amp;lt;br&amp;gt; [[File:Chapter 1.2b.png]] &amp;lt;br&amp;gt; Analytica reads in the Rent vs. Buy model.&lt;br /&gt;
}}{{Release|5.0||&lt;br /&gt;
select the ''Rent vs. Buy Example'' on the [[Intro screen]].&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Open Buy vs Rent Example.png]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==The Diagram window==&lt;br /&gt;
When you open a model, Analytica first displays a top-level [[Diagram window]]. The ''Rent vs. Buy'' model diagram shows several input variables that affect the trade-offs between renting and buying, '''Normal''' buttons, a '''Calc''' button, and a node labeled Model.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.3.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Normal buttons|Type=Bare|v=130|pt=215,129|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Normal buttons |Type=Bare|v=130|pt=518,155|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Model node|Type=Bare|v=200|pt=246,210|path=r-}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Calc button|Type=Bare|v=268|pt=412,262|path=r-}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This top-level diagram is an end-user interface to the model itself, which is contained in the Model node. In this chapter, you use only the interface in this top level diagram; in the following chapters you will explore the model in more depth.&lt;br /&gt;
&lt;br /&gt;
Across the top of the screen is a [[toolbar|horizontal palette of buttons]]. This is called the '''''tools palette'''''.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 1.4.png]]}}&lt;br /&gt;
{{Release|5.0||&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:BrowseToolOnToolbar5.0.png]]|&lt;br /&gt;
{{CalloutAnnotation|The browse tool|Type=Bare|v=10|pt=267,33|path=bD20-}}}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When you first open the ''Rent vs. Buy'' model, the '''browse tool''' is highlighted on the palette. With the browse tool selected, the cursor looks like a hand [[File:Chapter 1.5.png]]	when it is over the diagram. The browse tool allows you to calculate the model, change input values, and examine — but not change — the structure of the model. In this chapter, you only use the browse tool.&lt;br /&gt;
&lt;br /&gt;
==Access Help Resources==&lt;br /&gt;
&lt;br /&gt;
At any time, you can press the ''F1'' key on the keyboard or use the '''Help'''  menu to access Analytica’s help resources online. This menu includes links to  this [[Analytica Tutorial|Tutorial], the [[Analytica User Guide|User Guide]] and much more tips and reference material on this [[Analytica Wiki]].  &lt;br /&gt;
&lt;br /&gt;
==Compute output values==&lt;br /&gt;
&lt;br /&gt;
In the ''Rent vs. Buy'' model, the output value of interest is at the bottom, ''Present value of buying and renting''.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.3.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compare the present value of buying and renting.|v=200|pt=413,265|path=bD20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The output value displays in a [[Result window]]. This '''Result''' window shows a graph of two '''''probability density''''' curves, one for buying and one for renting. In a probability density graph, the units of the vertical scale are chosen so that the total area under each curve is 1 (100%). 25μ corresponds to 25 x 10-6 or 0.000025.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;Numerical suffixes like μ and K are used extensively throughout Analytica. A quick reference for these suffixes is given in [[Number formats]] .&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.7.png]]&lt;br /&gt;
&lt;br /&gt;
Since the graph is of probability densities, both buying and renting have probabilistic, or uncertain, inputs. The probability density graph for each appear to be bell-shaped curves ([[normal]] distribution), although they appear a bit “noisy.”&lt;br /&gt;
&lt;br /&gt;
The graphs show that the cost of renting, given the model’s inputs, are between about $105,000 and $155,000 (the negative numbers mean cost — cash flowing out), while the cost of buying is between $115,000 and a gain of $75,000.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.8.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Diagram''' window to bring it to the front.|v=20|pt=60,220|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''''Note''': Your results can vary slightly, since the model is generating random inputs based on a normal distribution for the uncertainty of the rate of inflation and for the appreciation rate.''&lt;br /&gt;
&lt;br /&gt;
Click the model [[Diagram window]] to bring it to the front. Notice that the button next to ''Costs of buying and renting'' has changed to '''Result'''. The '''Result''' button indicates that the value has been computed; clicking the '''Result''' button re-displays the computed values.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.9.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
The '''Calc''' button has changed to '''Result'''.|Type=Bare|v=220|pt=413,265|path=bD20-}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Change input values and recompute results==&lt;br /&gt;
&lt;br /&gt;
Now you will change some input values to the model and recompute the rent vs. buy comparison. You will change the values of ''Time horizon'', ''Monthly rent'', and ''Buying price''.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.9.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Time horizon''. Change the value to '''''7''''' and press ''Alt+Enter''.|v=50|pt=220,64|path=tU20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;The main Enter key and the numeric keypad Enter key are not interchangeable. They have different functions in Analytica. Alt+Enter is equivalent to the numeric keypad Enter key.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As soon as you change an input, the '''Result''' button changes to a '''Calc''' button, indicating that ''Present value of buying and renting'' needs to be recomputed.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.10.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Monthly rent''. Change the value to '''''1400''''' and press ''Alt+Enter''.|v=170|pt=220,171|path=r-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.11.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the box next to ''Buying price''. Change the value to '''''180K''''' (or 180000) and press ''Alt+Enter''.|v=130|pt=510,65|path=tU100-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now you are ready to recompute to see the new results. &lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.12.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compute the comparison of the costs of buying to renting.|v=140|pt=413,265|path=bD20-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The graphs show that the cost of renting, given these changed inputs, is between $90,000 and $120,000, while the cost of buying is between $135,000 and a gain of $70,000.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.13.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Diagram''' window to bring it to the front.|v=140|pt=127,386|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Examine and change an uncertain input==&lt;br /&gt;
When an input is defined as a probability distribution, a button with the name of the distribution appears next to the input’s name. Clicking this button opens the [[Object Finder dialog|Object Finder]] window, in which you can see details and change the distribution’s parameters or type of distribution.&lt;br /&gt;
&lt;br /&gt;
''Rate of inflation''’s button says '''Normal''', indicating that it is defined as a normal distribution.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.12.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Normal''' button next to the ''Rate of inflation''.|v=90|pt=218,134|path=bD20-|n=1}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The [[Object Finder dialog|Object Finder]] window appears. It shows that ''Rate of inflation'' is defined as a normal distribution with a '''''mean''''' of 3.5 and a '''''standard deviation''''' of 1.3.&lt;br /&gt;
&lt;br /&gt;
You will now modify the probability distribution that defines ''Rate of inflation''. Rather than using the normal distribution, you will use the uniform distribution, and assume that inflation has an equal probability of being anywhere between 3% and 4% per year.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.15.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Scroll down the list of distributions and select '''Uniform'''|v=80|pt=0,200|path=b!|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.16.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Change the minimum to '''''3'''''.|v=205|pt=222,248|path=r-|n=+}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Change the maximum to '''''4'''''.|v=290|pt=330,268|path=tU10/|n=+}}&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click '''OK''' to accept the change.|v=480|pt=537,481|path=r-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[image:Chapter 1.17.png]]|&lt;br /&gt;
{{CalloutAnnotation|&lt;br /&gt;
Click the '''Calc''' button to compute the new comparison of the present value of buying to renting.|v=140|pt=413,265|path=bD20-|n=+}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.18.png]]&lt;br /&gt;
&lt;br /&gt;
The graphs show that the uncertainty in the cost of renting has narrowed to between about $105,000 and $109,000, while the uncertainty in the cost of buying has flattened to between about $125,000 and a gain of $10,000.&lt;br /&gt;
&lt;br /&gt;
==Display alternative uncertainty views==&lt;br /&gt;
&lt;br /&gt;
Analytica offers a variety of views to display uncertain values, including selected statistics, [[Statistical_Functions_and_Importance_Weighting#ProbBands|probability bands]], the [[Uncertainty_Setup_dialog#Probability_density_option|probability density]] function, the [[Uncertainty_Setup_dialog#Cumulative_probability_option|cumulative probability]] distribution function, measures of central tendency, and the table of random numbers from which the uncertain distribution is estimated.&lt;br /&gt;
&lt;br /&gt;
You will now examine several of these views.&lt;br /&gt;
&lt;br /&gt;
In the upper-left corner of the [[Result window]] is the [[Uncertainty view of a result|Uncertainty View]] popup menu.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.19.png]]&lt;br /&gt;
&lt;br /&gt;
The miniature probability distribution [[File:Chapter 1.20.png]] indicates that '''''Probability Density''''' is selected.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.21.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now shows two cumulative probability curves. Along the vertical axis, these curves give the probability that each cost is less than a given value along the horizontal axis.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.22.png]]&lt;br /&gt;
&lt;br /&gt;
There appears to be about a 50% probability that the cost to buy is below $70,000, while the cost to rent has a 50% probability of being below about $110,000.&lt;br /&gt;
&lt;br /&gt;
Sometimes you might want to see an uncertain value expressed as a single number — a measure of central tendency. Analytica computes the [[mid]] value (sometimes called the '''''deterministic value''''') by fixing all input probability distributions at their [[median]] (50% probability) values. The mid value is the only uncertainty view available for nonprobabilistic results.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.23.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now displays bar graphs for the two mid values.&lt;br /&gt;
&lt;br /&gt;
Under the [[Uncertainty view of a result|Uncertainty View]] popup menu are two buttons, [[File:Chapter 1.23.2.png]] and [[File:Chapter 1.23.3.png]]. The [[File:Chapter 1.23.3.png]] is highlighted, indicating that the '''Result''' window is displaying a [[Graph view of a result|graph view]]. The '''Result''' window can also display numeric values in a spreadsheet-like table view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.24.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica also provides the [[mean]] (or average) value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.25.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.25.2.png]]&lt;br /&gt;
&lt;br /&gt;
You can also view a set of [[statistics]], including both the [[median]] and [[mean]], the ranges ([[Functions Min and Max|minimum and maximum]]), and the [[Sdeviation|standard deviation]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.26.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] now displays the minimum, median&amp;lt;ref&amp;gt;Note that the median value is slightly different from the mid value. The mid value is composed of non- probabilistic results generated by using the mean value for each input. The median value is calculated using probabilistic inputs and taking the median of the resulting distribution.&amp;lt;/ref&amp;gt;, mean, maximum, and standard deviation for ''Costs of buying and renting''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.27.png]]&lt;br /&gt;
&lt;br /&gt;
The statistics might not be exact, because they are estimated from a sample of values from the distribution.&lt;br /&gt;
&lt;br /&gt;
Finally, you see the [[sample]] values.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.28.png]]&lt;br /&gt;
&lt;br /&gt;
The table above lists the 100 sample values that Analytica randomly generated from the probability distribution to estimate the [[statistics]].&lt;br /&gt;
&lt;br /&gt;
A [[SampleSize|sample size]] of 100 is adequate for most applications; however, if you need more precise estimates, you can increase the [[SampleSize|sample size]]. See [[Uncertainty Setup dialog]] in the [[Analytica User Guide]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.29.png]]&lt;br /&gt;
&lt;br /&gt;
==Save your model==  &lt;br /&gt;
If you want to save changes to your model, you can do so at this point. (For instructions on quitting without saving, see the next section.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.30.png]]&lt;br /&gt;
&lt;br /&gt;
If you wish to save your model as a different file, so that you do not change the original model, select '''Save As''' from the [[File menu]].&lt;br /&gt;
&lt;br /&gt;
==Quit Analytica==&lt;br /&gt;
When you have finished using a model, you might want to quit Analytica.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 1.33.png]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
You have now opened an Analytica model,  calculated and viewed the results, changes input values and probability distributions, and displayed the uncertain results in several ways. These are the basic techniques for using any quantitative model.&lt;br /&gt;
&lt;br /&gt;
After you create your own models, you might want to give them a top-level input and output diagram like the one used in this chapter. For information about customizing a model for end users, see [[Creating Interfaces for End Users]] in the [[Analytica User Guide]]. &lt;br /&gt;
&lt;br /&gt;
The next Tutorial page, shows how to navigate the details of the Rent vs. Buy model, exploring its structure and contents.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]  &lt;br /&gt;
* [https://www.youtube.com/watch?v=GQV0dnDN0Q0 Using the Rent vs. Buy Model] (an explanatory video on YouTube)&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
* [[To open or exit a model]]&lt;br /&gt;
* [[Create and save a model]]&lt;br /&gt;
* [[Tutorial: Create a model]]&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Help menu and documentation]]&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[Expressing Uncertainty]]&lt;br /&gt;
* [[Uncertainty Setup dialog]]&lt;br /&gt;
* [[Uncertainty view of a result]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;About Analytica/ {{PAGENAME}} / Tutorial: Reviewing a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51429</id>
		<title>Tutorial: Reviewing a model</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51429"/>
		<updated>2018-06-01T17:41:52Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category: Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to explore a model by examining the ''Rent vs. Buy'' model's:&lt;br /&gt;
* Influence diagrams&lt;br /&gt;
* Variables&lt;br /&gt;
* Attributes&lt;br /&gt;
* Definitions&lt;br /&gt;
* Results&lt;br /&gt;
&lt;br /&gt;
This assumes you have started Analytica and have opened the ''Rent vs. Buy'' model. If this is not the case, see [[Tutorial: Open a model to browse#Opening_the_Rent_vs._Buy_model|Opening the Rent vs. Buy model]]. If you are using the model as modified from [[Tutorial: Open a model to browse|Chapter 1]], change the value of ''Time horizon ''back to '''10''', the value of ''Monthly rent ''back to '''1200''', and the value of ''Buying price ''back to '''140K'''. Also change the ''Rate of inflation ''back to a normal distribution with a mean of '''3.5 '''and a standard deviation of '''1.3'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/mpF4xcmKaao&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tutorial Video:''' [https://youtu.be/mpF4xcmKaao Review/explore a model] (8 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Recognize influence diagrams==&lt;br /&gt;
In this chapter, you will delve into some of the details of the ''Rent vs. Buy'' model. You will not use the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.1.png]]&lt;br /&gt;
&lt;br /&gt;
The details of an Analytica model display in an [[Diagram window|influence diagram window]]. An influence diagram (shown below) is a graphical representation of a model, showing how different variables in the model interact with each other. A typical influence diagram consists of a number of '''''nodes''''' connected by '''''arrows'''''.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 2.2.png]]}}{{Release|5.0||[[File:Chapter_2_2b.png]]}}&lt;br /&gt;
&lt;br /&gt;
'''''Nodes''''' represent variables and appear as boxes, ovals, hexagons, and other shapes. Different node shapes represent different types of variables. Analytica uses the term '''''variable''''' broadly to include anything that has a value or can be evaluated. Note that many of the variables have the same names as the inputs and output at the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]]. The top diagram provides an easy way to see and change these nodes’ values.&lt;br /&gt;
&lt;br /&gt;
'''''Arrows''''' connecting different variables indicate a relation between the variables. The arrow connecting ''Rate of inflation ''to ''Appreciation rate ''indicates that the value of the ''Appreciation rate ''variable depends on the value of the ''Rate of inflation ''variable. In the ''Rent vs. Buy ''model influence diagram, ''Cost to Buy ''depends on the ''Buying price'', ''Rate of inflation'', ''Appreciation rate'', ''Discount rate'', and ''Time horizon ''variables.&lt;br /&gt;
&lt;br /&gt;
The following figure illustrates different types of nodes.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Open Object windows==&lt;br /&gt;
Every object in Analytica has an associated [[Object window]] containing detailed information about it. You can display the '''Object''' window of any variable by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.4.png]]&lt;br /&gt;
&lt;br /&gt;
Information about a variable is provided in a list of attributes. [[Attributes]] include the variable’s class (for example, decision, chance, or constant), identifier, units, title, description, definition, inputs, and outputs. See the illustration below.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.5.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;You can enter numbers with a suffix abbreviation, so Buying Price can be defined as either 140K or 140000. A quick reference for these suffixes is given on [[Number formats]] page.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Move between Object windows==&lt;br /&gt;
You have opened the [[Object window]] of a variable (''Buying price'') by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
The '''Object '''window contains a list of the variable’s '''''inputs '''''and '''''outputs''''', if there are any.&lt;br /&gt;
&lt;br /&gt;
You can open the [[Object window]] for any input or output variable by double-clicking the one you wish to view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.6.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica opens the '''Object''' window for ''Mortgage loan amount''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.7.png]]&lt;br /&gt;
&lt;br /&gt;
Note in the figure above that the '''''Title '''''of ''Mortgage loan amount ''is different from the variable’s [[identifier]], ''Mortgage''. The title is what the model user normally sees; the identifier is used as a mathematical symbol in the definitions of other variables that depend on this variable.&lt;br /&gt;
&lt;br /&gt;
The [[definition]] of the ''Mortgage loan amount ''is an [[Expressions|expression]], the sum of ''Buying price ''and ''Down payment ''(which is a negative amount). The definition refers to these variables by their identifiers.&lt;br /&gt;
&lt;br /&gt;
'''''Inputs '''''lists the identifiers and titles of the variables in the definition. ''Buying price'', the variable you just examined, is one of the inputs. The other input of ''Mortgage loan amount ''is ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.8.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Object window]] now displays the [[attributes]] of ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.9.png]]&lt;br /&gt;
&lt;br /&gt;
==Use the Attribute panel==&lt;br /&gt;
As an alternative to viewing a variable’s attributes in a separate window, you can inspect them in the [[Attribute panel]], which is an auxiliary window pane that you can open below the influence diagram.&lt;br /&gt;
&lt;br /&gt;
The [[Attribute panel]] allows you to rapidly examine one [[attributes|attribute]] at a time of any variable in the model. You select the variable you wish to view and select the attribute to examine from a popup menu.&lt;br /&gt;
&lt;br /&gt;
The variable ''Buying price ''should be highlighted with a title in white, indicating that it is selected; if it is not, select it by clicking it once.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.10.png]]&lt;br /&gt;
&lt;br /&gt;
By default, Analytica displays the '''''description '''''of the selected node (e.g., ''Buying price'') in the [[Attribute panel]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.11.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspect definitions in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to inspect any attribute of a variable.&lt;br /&gt;
&lt;br /&gt;
In this section, you will see the [[definition]] of two variables that you viewed in the top-level diagram in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.12.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.13.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.14.png]]&lt;br /&gt;
&lt;br /&gt;
When a variable is defined as an '''''uncertainty distribution''''', a button appears in the '''Definition''' field.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.15.png]]&lt;br /&gt;
&lt;br /&gt;
In [[Tutorial: Open a model to browse|Chapter 1]] you saw that ''Rate of inflation'' is defined as a [[normal]] distribution with a [[mean]] of 3.5 and a [[Sdeviation|standard deviation]] of 1.3.&lt;br /&gt;
&lt;br /&gt;
==Open modules==&lt;br /&gt;
Analytica models generally contain '''''modules'''''. Each [[Modules and Libraries|module]] contains the details of a part of the model, also represented as an [[influence diagram]]. In the ''Rent vs. Buy'' model, ''Cost to Buy'' and ''Cost to Rent'' are both modules.&lt;br /&gt;
&lt;br /&gt;
Modules can also contain other modules. In this manner, a large model with hundreds of variables can be organized into a hierarchy of modules, each small enough to be easily understood.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.16.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica displays the influence diagram of the ''Cost to Buy'' [[Modules and Libraries|module]]. This module contains three additional modules: ''Out-of-pocket costs to own, Future sales proceeds,'' and ''Opportunity cost''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.17.png]]&lt;br /&gt;
&lt;br /&gt;
The '''''input arrowhead''''' (without a trailing line) shows that the node to the right of the arrow has one or more inputs from outside this module.&lt;br /&gt;
&lt;br /&gt;
The '''''output arrowhead''''' shows that the node to the left of the arrow has one or more outputs outside this module.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.18.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.19.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica limits the number of open windows at each level of the model hierarchy to minimize clutter on your screen. See [[Managing windows]] in the [[Analytica User Guide]] for information on how to open more than one module [[Diagram window]] at a time.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.20.png]]&lt;br /&gt;
&lt;br /&gt;
The combined arrowhead, shown above, indicates that the node has one or more inputs from outside this module, plus the input variable in this module.&lt;br /&gt;
&lt;br /&gt;
You can also navigate the model by tracking a variable’s [[User input nodes and user output nodes|inputs or outputs]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.22.png]]&lt;br /&gt;
&lt;br /&gt;
The Out-of-pocket costs to own module diagram is brought to the front, with the Insurance node selected.&lt;br /&gt;
&lt;br /&gt;
==Learn about nodes using Help balloons==&lt;br /&gt;
[[Help balloons]] pop up when you hover over a node for about a second, and display the title, units, and description for a variable. These allow you to browse information very rapidly without having to open the object window. Balloons do not appear when objects do not have the Help or Description attribute filled in.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.24.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.23.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspect values in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to view certain attributes, such as a variable’s '''''value''''', that are not (initially) displayed in an [[Object window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.25.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.26.png]]&lt;br /&gt;
&lt;br /&gt;
If '''''Value '''''was not previously computed, Analytica computes the variable’s value '''''deterministically''''', assuming that all of the input probability distributions are fixed at their median values. [[Mid]] value is an abbreviation for this deterministically computed value.&lt;br /&gt;
&lt;br /&gt;
You can use the [[Attribute panel]] in this manner to examine the mid value of any variable in the model.&lt;br /&gt;
&lt;br /&gt;
It is faster to compute a mid (deterministic) value than an uncertain (probabilistic) value, so it is useful for conducting initial checks of a model before performing any uncertainty analysis.&lt;br /&gt;
&lt;br /&gt;
==Display results==&lt;br /&gt;
When you are viewing a model’s [[Diagram window|influence diagram]], you can evaluate any variable and display its value in a [[Result window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.27.png]]&lt;br /&gt;
&lt;br /&gt;
A [[Result window]] displays the [[Probability density and mass graphs|probability density function graph]] for this variable. Analytica displays the [[Uncertainty view of a result|uncertainty view]] that was most recently selected from the [[Uncertainty views|Uncertainty View]] popup menu, or that was saved with the model.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.29-updated.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;The ''Rent vs. Buy ''model uses financial flow conventions: funds flowing in (received) have positive values; funds flowing out (expended) have negative values.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an alternative to clicking the '''Result''' button [[File:Chapter 2.29.1.png]] and then selecting an uncertainty view, you can use the [[Result menu]] to evaluate a variable and select the [[Uncertainty view of a result|uncertainty view of the result]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.30.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] appears displaying the variable’s [[Distribution_Densities_Library#Cumulative_Probability_Functions|cumulative probability distribution]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.31.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.33.png]]&lt;br /&gt;
&lt;br /&gt;
A single [[mid]] value appears in table view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.34.png]]&lt;br /&gt;
&lt;br /&gt;
The [[mid]] value in [[Table view of a result|table view]] is the only result view available for a nonprobabilistic variable with a single value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.35.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica tells you that this is a nonprobabilistic value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.36.png]]&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
You now have browsed the ''Rent vs. Buy'' model by examining its influence diagrams, variables, attributes, definitions, and results. These are the basic techniques for exploring any Analytica model.&lt;br /&gt;
&lt;br /&gt;
The next chapter shows you how to analyze the Rent vs. Buy model.&lt;br /&gt;
&lt;br /&gt;
You can quit Analytica at this point.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]  &lt;br /&gt;
* [https://www.youtube.com/watch?v=mpF4xcmKaao Exploring a model] (an explanatory video on YouTube)&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
* [[Examining a Model]]&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Creating Lucid Influence Diagrams]]&lt;br /&gt;
* [[Object Window]]&lt;br /&gt;
* [[Classes of variables and other objects]]&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Attribute panel]]&lt;br /&gt;
* [[Entering Attributes using the Attribute panel]]&lt;br /&gt;
* [[Definitions]]&lt;br /&gt;
* [[Import a module or library]]&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[Help balloons]]&lt;br /&gt;
* [[Result Tables and Graphs]]&lt;br /&gt;
* [[Result window]]&lt;br /&gt;
* [[Managing windows]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Tutorial: Open a model to browse/ {{PAGENAME}} / Tutorial: Analyzing a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51428</id>
		<title>Tutorial: Reviewing a model</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51428"/>
		<updated>2018-06-01T17:40:39Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category: Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to explore a model by examining the ''Rent vs. Buy'' model's:&lt;br /&gt;
* Influence diagrams&lt;br /&gt;
* Variables&lt;br /&gt;
* Attributes&lt;br /&gt;
* Definitions&lt;br /&gt;
* Results&lt;br /&gt;
&lt;br /&gt;
This assumes you have started Analytica and have opened the ''Rent vs. Buy'' model. If this is not the case, see [[Tutorial: Open a model to browse#Opening_the_Rent_vs._Buy_model|Opening the Rent vs. Buy model]]. If you are using the model as modified from [[Tutorial: Open a model to browse|Chapter 1]], change the value of ''Time horizon ''back to '''10''', the value of ''Monthly rent ''back to '''1200''', and the value of ''Buying price ''back to '''140K'''. Also change the ''Rate of inflation ''back to a normal distribution with a mean of '''3.5 '''and a standard deviation of '''1.3'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/mpF4xcmKaao&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tutorial Video:''' [https://youtu.be/mpF4xcmKaao Review/explore a model] (8 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Recognize influence diagrams==&lt;br /&gt;
In this chapter, you will delve into some of the details of the ''Rent vs. Buy'' model. You will not use the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.1.png]]&lt;br /&gt;
&lt;br /&gt;
The details of an Analytica model display in an [[Diagram window|influence diagram window]]. An influence diagram (shown below) is a graphical representation of a model, showing how different variables in the model interact with each other. A typical influence diagram consists of a number of '''''nodes''''' connected by '''''arrows'''''.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 2.2.png]]}}{{Release|5.0||[[File:Chapter_2_2b.png]]}}&lt;br /&gt;
&lt;br /&gt;
'''''Nodes''''' represent variables and appear as boxes, ovals, hexagons, and other shapes. Different node shapes represent different types of variables. Analytica uses the term '''''variable''''' broadly to include anything that has a value or can be evaluated. Note that many of the variables have the same names as the inputs and output at the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]]. The top diagram provides an easy way to see and change these nodes’ values.&lt;br /&gt;
&lt;br /&gt;
'''''Arrows''''' connecting different variables indicate a relation between the variables. The arrow connecting ''Rate of inflation ''to ''Appreciation rate ''indicates that the value of the ''Appreciation rate ''variable depends on the value of the ''Rate of inflation ''variable. In the ''Rent vs. Buy ''model influence diagram, ''Cost to Buy ''depends on the ''Buying price'', ''Rate of inflation'', ''Appreciation rate'', ''Discount rate'', and ''Time horizon ''variables.&lt;br /&gt;
&lt;br /&gt;
The following figure illustrates different types of nodes.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Open Object windows==&lt;br /&gt;
Every object in Analytica has an associated [[Object window]] containing detailed information about it. You can display the '''Object''' window of any variable by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.4.png]]&lt;br /&gt;
&lt;br /&gt;
Information about a variable is provided in a list of attributes. [[Attributes]] include the variable’s class (for example, decision, chance, or constant), identifier, units, title, description, definition, inputs, and outputs. See the illustration below.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.5.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;You can enter numbers with a suffix abbreviation, so Buying Price can be defined as either 140K or 140000. A quick reference for these suffixes is given on [[Number formats]] page.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Move between Object windows==&lt;br /&gt;
You have opened the [[Object window]] of a variable (''Buying price'') by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
The '''Object '''window contains a list of the variable’s '''''inputs '''''and '''''outputs''''', if there are any.&lt;br /&gt;
&lt;br /&gt;
You can open the [[Object window]] for any input or output variable by double-clicking the one you wish to view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.6.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica opens the '''Object''' window for ''Mortgage loan amount''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.7.png]]&lt;br /&gt;
&lt;br /&gt;
Note in the figure above that the '''''Title '''''of ''Mortgage loan amount ''is different from the variable’s [[identifier]], ''Mortgage''. The title is what the model user normally sees; the identifier is used as a mathematical symbol in the definitions of other variables that depend on this variable.&lt;br /&gt;
&lt;br /&gt;
The [[definition]] of the ''Mortgage loan amount ''is an [[Expressions|expression]], the sum of ''Buying price ''and ''Down payment ''(which is a negative amount). The definition refers to these variables by their identifiers.&lt;br /&gt;
&lt;br /&gt;
'''''Inputs '''''lists the identifiers and titles of the variables in the definition. ''Buying price'', the variable you just examined, is one of the inputs. The other input of ''Mortgage loan amount ''is ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.8.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Object window]] now displays the [[attributes]] of ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.9.png]]&lt;br /&gt;
&lt;br /&gt;
==Use the Attribute panel==&lt;br /&gt;
As an alternative to viewing a variable’s attributes in a separate window, you can inspect them in the [[Attribute panel]], which is an auxiliary window pane that you can open below the influence diagram.&lt;br /&gt;
&lt;br /&gt;
The [[Attribute panel]] allows you to rapidly examine one [[attributes|attribute]] at a time of any variable in the model. You select the variable you wish to view and select the attribute to examine from a popup menu.&lt;br /&gt;
&lt;br /&gt;
The variable ''Buying price ''should be highlighted with a title in white, indicating that it is selected; if it is not, select it by clicking it once.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.10.png]]&lt;br /&gt;
&lt;br /&gt;
By default, Analytica displays the '''''description '''''of the selected node (e.g., ''Buying price'') in the [[Attribute panel]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.11.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspect definitions in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to inspect any attribute of a variable.&lt;br /&gt;
&lt;br /&gt;
In this section, you will see the [[definition]] of two variables that you viewed in the top-level diagram in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.12.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.13.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.14.png]]&lt;br /&gt;
&lt;br /&gt;
When a variable is defined as an '''''uncertainty distribution''''', a button appears in the '''Definition''' field.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.15.png]]&lt;br /&gt;
&lt;br /&gt;
In [[Tutorial: Open a model to browse|Chapter 1]] you saw that ''Rate of inflation'' is defined as a [[normal]] distribution with a [[mean]] of 3.5 and a [[Sdeviation|standard deviation]] of 1.3.&lt;br /&gt;
&lt;br /&gt;
==Open modules==&lt;br /&gt;
Analytica models generally contain '''''modules'''''. Each [[Modules and Libraries|module]] contains the details of a part of the model, also represented as an [[influence diagram]]. In the ''Rent vs. Buy'' model, ''Cost to Buy'' and ''Cost to Rent'' are both modules.&lt;br /&gt;
&lt;br /&gt;
Modules can also contain other modules. In this manner, a large model with hundreds of variables can be organized into a hierarchy of modules, each small enough to be easily understood.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.16.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica displays the influence diagram of the ''Cost to Buy'' [[Modules and Libraries|module]]. This module contains three additional modules: ''Out-of-pocket costs to own, Future sales proceeds,'' and ''Opportunity cost''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.17.png]]&lt;br /&gt;
&lt;br /&gt;
The '''''input arrowhead''''' (without a trailing line) shows that the node to the right of the arrow has one or more inputs from outside this module.&lt;br /&gt;
&lt;br /&gt;
The '''''output arrowhead''''' shows that the node to the left of the arrow has one or more outputs outside this module.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.18.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.19.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica limits the number of open windows at each level of the model hierarchy to minimize clutter on your screen. See [[Managing windows]] in the [[Analytica User Guide]] for information on how to open more than one module [[Diagram window]] at a time.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.20.png]]&lt;br /&gt;
&lt;br /&gt;
The combined arrowhead, shown above, indicates that the node has one or more inputs from outside this module, plus the input variable in this module.&lt;br /&gt;
&lt;br /&gt;
You can also navigate the model by tracking a variable’s [[User input nodes and user output nodes|inputs or outputs]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.22.png]]&lt;br /&gt;
&lt;br /&gt;
The Out-of-pocket costs to own module diagram is brought to the front, with the Insurance node selected.&lt;br /&gt;
&lt;br /&gt;
==Help balloons==&lt;br /&gt;
[[Help balloons]] pop up when you hover over a node for about a second, and display the title, units, and description for a variable. These allow you to browse information very rapidly without having to open the object window. Balloons do not appear when objects do not have the Help or Description attribute filled in.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.24.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.23.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspect values in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to view certain attributes, such as a variable’s '''''value''''', that are not (initially) displayed in an [[Object window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.25.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.26.png]]&lt;br /&gt;
&lt;br /&gt;
If '''''Value '''''was not previously computed, Analytica computes the variable’s value '''''deterministically''''', assuming that all of the input probability distributions are fixed at their median values. [[Mid]] value is an abbreviation for this deterministically computed value.&lt;br /&gt;
&lt;br /&gt;
You can use the [[Attribute panel]] in this manner to examine the mid value of any variable in the model.&lt;br /&gt;
&lt;br /&gt;
It is faster to compute a mid (deterministic) value than an uncertain (probabilistic) value, so it is useful for conducting initial checks of a model before performing any uncertainty analysis.&lt;br /&gt;
&lt;br /&gt;
==Display results==&lt;br /&gt;
When you are viewing a model’s [[Diagram window|influence diagram]], you can evaluate any variable and display its value in a [[Result window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.27.png]]&lt;br /&gt;
&lt;br /&gt;
A [[Result window]] displays the [[Probability density and mass graphs|probability density function graph]] for this variable. Analytica displays the [[Uncertainty view of a result|uncertainty view]] that was most recently selected from the [[Uncertainty views|Uncertainty View]] popup menu, or that was saved with the model.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.29-updated.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;The ''Rent vs. Buy ''model uses financial flow conventions: funds flowing in (received) have positive values; funds flowing out (expended) have negative values.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an alternative to clicking the '''Result''' button [[File:Chapter 2.29.1.png]] and then selecting an uncertainty view, you can use the [[Result menu]] to evaluate a variable and select the [[Uncertainty view of a result|uncertainty view of the result]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.30.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] appears displaying the variable’s [[Distribution_Densities_Library#Cumulative_Probability_Functions|cumulative probability distribution]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.31.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.33.png]]&lt;br /&gt;
&lt;br /&gt;
A single [[mid]] value appears in table view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.34.png]]&lt;br /&gt;
&lt;br /&gt;
The [[mid]] value in [[Table view of a result|table view]] is the only result view available for a nonprobabilistic variable with a single value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.35.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica tells you that this is a nonprobabilistic value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.36.png]]&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
You now have browsed the ''Rent vs. Buy'' model by examining its influence diagrams, variables, attributes, definitions, and results. These are the basic techniques for exploring any Analytica model.&lt;br /&gt;
&lt;br /&gt;
The next chapter shows you how to analyze the Rent vs. Buy model.&lt;br /&gt;
&lt;br /&gt;
You can quit Analytica at this point.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]  &lt;br /&gt;
* [https://www.youtube.com/watch?v=mpF4xcmKaao Exploring a model] (an explanatory video on YouTube)&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
* [[Examining a Model]]&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Creating Lucid Influence Diagrams]]&lt;br /&gt;
* [[Object Window]]&lt;br /&gt;
* [[Classes of variables and other objects]]&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Attribute panel]]&lt;br /&gt;
* [[Entering Attributes using the Attribute panel]]&lt;br /&gt;
* [[Definitions]]&lt;br /&gt;
* [[Import a module or library]]&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[Help balloons]]&lt;br /&gt;
* [[Result Tables and Graphs]]&lt;br /&gt;
* [[Result window]]&lt;br /&gt;
* [[Managing windows]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Tutorial: Open a model to browse/ {{PAGENAME}} / Tutorial: Analyzing a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Analyzing_a_model&amp;diff=51427</id>
		<title>Tutorial: Analyzing a model</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Analyzing_a_model&amp;diff=51427"/>
		<updated>2018-06-01T17:39:11Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category:  Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to:&lt;br /&gt;
* Perform importance analysis&lt;br /&gt;
* Perform parametric analysis&lt;br /&gt;
* Set up and compare alternative decisions&lt;br /&gt;
&lt;br /&gt;
In this Tutorial you will analyze the ''Rent vs. Buy Analysis ''model, a modified version of the model that you used in [[Tutorial: Open a model to browse]] and [[Tutorial: Reviewing a model]]. You will identify its key sources of uncertainty through '''''importance analysis, perform parametric analysis''''', and '''''compare alternative '''''decisions.&lt;br /&gt;
&lt;br /&gt;
For instructions on how to open a model, see “Opening the Rent vs. Buy model”. In this case, however, open the ''Rent vs. Buy Analysis ''model by double-clicking the file labeled '''Rent vs. Buy Analysis.ana'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/scVOq29NMG4&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tutorial Video:''' [https://youtu.be/scVOq29NMG4 Analyze a model] (6 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examine the difference between renting and buying==&lt;br /&gt;
The ''Rent vs. Buy Analysis ''model is the module called ''Model ''that you explored in [[Tutorial: Reviewing a model]] with the addition of nodes to help you understand the importance of the uncertain inputs to the uncertainty in the output.&lt;br /&gt;
&lt;br /&gt;
In [[Tutorial: Open a model to browse]] you saw that evaluating ''Costs of buying and renting ''produces a graph of two uncertain values. To understand whether it would be financially advantageous to rent or buy, the ''Rent vs. Buy Analysis ''model includes the objective node, ''Difference between buying and renting''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.1.png]]&lt;br /&gt;
&lt;br /&gt;
The difference between the two uncertain values is also uncertain. The difference is positive if buying costs less over the time period, and negative if renting costs less over the time period.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Importance analysis==&lt;br /&gt;
In the ''Rent vs. Buy Analysis ''model, as in most complex models, several of the input variables are uncertain.&lt;br /&gt;
&lt;br /&gt;
It is often useful to understand how much each uncertain input contributes to the uncertainty in the output. Typically, a few key uncertain inputs are responsible for the lion’s share of the uncertainty in the output, while the rest of the inputs have little impact.&lt;br /&gt;
&lt;br /&gt;
Analytica’s [[importance analysis]] features can help you understand which uncertain inputs contribute most to the uncertainty in the output. You can then concentrate on getting more precise estimates or building a more detailed model for the one or two most “important” inputs.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.6.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica defines '''''importance''''' as the [[rank]] order [[correlation]] between the output value and each uncertain input. Each variable’s importance is calculated on a relative scale from 0 to 1. An importance value of 0 indicates that the uncertain input variable has no effect on the uncertainty in the output. A value of 1 implies total correlation, where all of the uncertainty in the output is due to the uncertainty of a single input.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.6b.png]]&lt;br /&gt;
&lt;br /&gt;
It is clear in the figure above that the input ''Appreciation Rate'' is contributing most of the uncertainty in the ''Difference between buying and renting''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.8.png]]&lt;br /&gt;
&lt;br /&gt;
For more information about [[importance analysis]] and the steps to create an importance variable in your own model, see [[Scatter plots]] in the [[Statistics, Sensitivity, and Uncertainty Analysis]] chapter of the [[Analytica User Guide]].&lt;br /&gt;
&lt;br /&gt;
==Perform parametric (sensitivity) analysis==&lt;br /&gt;
'''''Parametric analysis '''''(also called '''''sensitivity analysis''''') involves varying the value of an input variable to examine its effect on a selected output. Performing sensitivity analysis often provides useful insights into how small changes in input variable values affect the desired outcome.&lt;br /&gt;
&lt;br /&gt;
Because the [[importance analysis]] in the section “Importance analysis” revealed that ''Appreciation rate ''caused most of the uncertainty in ''Difference between buying and renting, ''you will start the [[parametric analysis]] with that input variable. You will change ''Appreciation rate''’s definition from a probability distribution to a list of alternative values, and analyze the effect on the ''Difference between buying and renting ''output.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, click the edit button [[File:Chapter 3.10a.png]] in the toolbar to switch into edit mode. In edit mode you can modify the model: adding and removing nodes, and modifying existing nodes. Then click the key icon [[File:Chapter 3.10b.png]] to open the [[Attribute panel]], then select the ''Appreciation rate ''node, and then select '''Definition '''from the [[Attribute dropdown menu]] to view its definition.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 3.10.png]]}}{{Release|5.0||[[File:Chapter 3.10_v5.0.png]]}} &lt;br /&gt;
&lt;br /&gt;
When the Definition [[attributes|attribute]] is displayed, the [[Expression popup menu]] [[File:Chapter 3.10c.png]] appears.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, click the [[toolbar|edit tool]] [[File:Chapter 3.10a.png]] to switch to edit mode.&lt;br /&gt;
&lt;br /&gt;
The [[Expression popup menu]] allows you to change the [[definition]] of a variable to one of several different types of expressions.&lt;br /&gt;
&lt;br /&gt;
Expression types include:&lt;br /&gt;
* Expression, or mathematical formula [[File:Chapter 3.10d.png]]&lt;br /&gt;
* List [[File:Chapter 3.10e.png]]&lt;br /&gt;
* List of Labels [[File:Chapter 3.10f.png]]&lt;br /&gt;
* Table [[File:Chapter 3.10g.png]]&lt;br /&gt;
* Probability table [[File:Chapter 3.10g.png]]&lt;br /&gt;
* Distribution [[File:Chapter 3.10c.png]]&lt;br /&gt;
* Choice [[File:Chapter 3.10h.png]]&lt;br /&gt;
&lt;br /&gt;
You will now use [[the Expression popup menu]] to change the definition of ''Appreciation rate'' from a probability distribution to a list. You will redefine ''Appreciation rate'' as a list of alternative values from -10% to 10%.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.11.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.12.png]]&lt;br /&gt;
&lt;br /&gt;
Note that the icon on the [[Expression popup menu]] changes to indicate that '''List''' [[File:Chapter 3.10e.png]] is selected.&lt;br /&gt;
&lt;br /&gt;
When a definition is first changed to a list, a cell (indicated by a box around it) appears in the definition. The first cell in the list initially contains the expression that was previously in the definition. In this case, you see the expression for a [[normal]] distribution (Normal(Inflation,3)).&lt;br /&gt;
&lt;br /&gt;
You will replace the entry with a number and add cells to perform [[parametric analysis]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.13.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;In Analytica, you add cells to a list by pressing the main Enter key, not the numeric keypad Enter key.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new cell appears with the value -9. Change its value to -5. After you have entered two values, as you press ''Enter'' to add a new cell, Analytica automatically fills in the new cell with a value based on the difference between the last two values. You can override the automatic value by typing the desired value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.14.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.15.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.16.png]]&lt;br /&gt;
&lt;br /&gt;
Pivot the graph as follows:&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.17.png]]&lt;br /&gt;
&lt;br /&gt;
The resulting graph shows the [[mid]] value of buying and renting as a function of ''Appreciation rate'', which varies from -10% to 10%, as you just entered.&lt;br /&gt;
&lt;br /&gt;
''Appreciation rate'' is informally called an '''''index''''' because it characterizes a dimension of another variable’s value, in this case, ''Costs of buying and renting''.&lt;br /&gt;
&lt;br /&gt;
The graph shows that at an ''Appreciation rate'' of about -5% per year, renting and buying costs the same. If it is less than -5%, it would be better to rent; if it is greater than -5%, it would be better to buy.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.18-updated.png]]&lt;br /&gt;
&lt;br /&gt;
The table shows the values computed for each parameterized value of ''Appreciation rate''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.19-updated.png]]&lt;br /&gt;
&lt;br /&gt;
==Evaluate alternative decisions==&lt;br /&gt;
Analytica allows you to perform sensitivity analysis on several variables simultaneously.&lt;br /&gt;
&lt;br /&gt;
In this section, you will change ''Buying price'' to compare results based on alternative decisions. In doing so, you will perform [[parametric analysis]] on both ''Buying price'' and ''Appreciation rate'' at the same time.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.20-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.21-updated.png]]&lt;br /&gt;
&lt;br /&gt;
The first cell in this list contains the expression for the previous definition, 140K. You will change this value, and add additional cells, as you did in previous steps.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.22-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.23-updated.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] appears displaying the variable’s mid value. The ''Difference between buying and renting variable'' is three curves, one for each ''Buying price''. Below the graph is a key to identify each curve.&lt;br /&gt;
&lt;br /&gt;
When you examine the mid value results, you can see that only a $160K home, coupled with an appreciation rate of -2%/year or less, or a $140K home, coupled with an appreciation rate of -6%/year or less, results in renting being cheaper than buying. So, what is the best buy, a 120K home or a 160K home? That depends on what you anticipate the appreciation rate will be. For appreciation rates less than 9% per year, the less expensive home is the better investment. For higher appreciation rates above 9%, the more expensive home provides a larger return.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.24-updated.png]]&lt;br /&gt;
&lt;br /&gt;
Remember that the cost of renting has been held constant. To further investigate the effect of this, you will examine the Costs of renting and buying node.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.25-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.26-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.27-updated.png]]&lt;br /&gt;
&lt;br /&gt;
The result has three dimensions, ''Buying price, Buy or rent,'' and ''Appreciation rate'', shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
Because only two dimensions can be shown in the graph, Analytica chooses one value of the third dimension to display, in this case, ''Buying price'' equals '''$120K'''.&lt;br /&gt;
&lt;br /&gt;
Use the navigating arrows to display different values of the ''Buying price'' index.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.28-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.29-updated.png]]&lt;br /&gt;
&lt;br /&gt;
The graph changes to show the [[mid]] value of ''Costs of buying and renting'' given that the ''Buying price'' equals '''$160K'''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.30-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.31-updated.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.32-updated.png]]&lt;br /&gt;
&lt;br /&gt;
This table shows the [[mid]] value cost of buying for the parameterized values of ''Buying Price'' and ''Appreciation Rate''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.33-updated.png]]&lt;br /&gt;
&lt;br /&gt;
This table shows that ''Cost to Rent'' does not vary with ''Buying Price'' or ''Appreciation rate''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 3.34-updated.png]]&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
In this chapter, you have:&lt;br /&gt;
* Performed importance analysis.&lt;br /&gt;
* Performed parametric analysis.&lt;br /&gt;
* Set up and compared alternative decisions.&lt;br /&gt;
The next chapter introduces you to creating a new Analytica model.&lt;br /&gt;
&lt;br /&gt;
You can quit Analytica at this point.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]&lt;br /&gt;
* [https://www.youtube.com/watch?v=scVOq29NMG4 Analyzing a model] (en explanatory video on YouTube)&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Comparing results]]&lt;br /&gt;
* [[Importance analysis]]&lt;br /&gt;
* [[Parametric analysis]]&lt;br /&gt;
* [[Statistics, Sensitivity, and Uncertainty Analysis]]&lt;br /&gt;
* [[Sensitivity analysis functions]]&lt;br /&gt;
* [[The Sensitivity Analysis Library]]&lt;br /&gt;
* [[Tornado Plots]]&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Tutorial: Reviewing a model/ {{PAGENAME}} / Tutorial: Create a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51426</id>
		<title>Tutorial: Reviewing a model</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tutorial:_Reviewing_a_model&amp;diff=51426"/>
		<updated>2018-06-01T17:34:29Z</updated>

		<summary type="html">&lt;p&gt;KMullins: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica Tutorial]]&lt;br /&gt;
[[Category: Rent vs. Buy model]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica Tutorial &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
This Tutorial page shows you how to explore a model by examining the ''Rent vs. Buy'' model's:&lt;br /&gt;
* Influence diagrams&lt;br /&gt;
* Variables&lt;br /&gt;
* Attributes&lt;br /&gt;
* Definitions&lt;br /&gt;
* Results&lt;br /&gt;
&lt;br /&gt;
This assumes you have started Analytica and have opened the ''Rent vs. Buy'' model. If this is not the case, see [[Tutorial: Open a model to browse#Opening_the_Rent_vs._Buy_model|Opening the Rent vs. Buy model]]. If you are using the model as modified from [[Tutorial: Open a model to browse|Chapter 1]], change the value of ''Time horizon ''back to '''10''', the value of ''Monthly rent ''back to '''1200''', and the value of ''Buying price ''back to '''140K'''. Also change the ''Rate of inflation ''back to a normal distribution with a mean of '''3.5 '''and a standard deviation of '''1.3'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;iframe width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; src=&amp;quot;https://www.youtube.com/embed/mpF4xcmKaao&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tutorial Video:''' [https://youtu.be/mpF4xcmKaao Review/explore a model] (8 minutes)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Recognizing influence diagrams==&lt;br /&gt;
In this chapter, you will delve into some of the details of the ''Rent vs. Buy'' model. You will not use the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.1.png]]&lt;br /&gt;
&lt;br /&gt;
The details of an Analytica model display in an [[Diagram window|influence diagram window]]. An influence diagram (shown below) is a graphical representation of a model, showing how different variables in the model interact with each other. A typical influence diagram consists of a number of '''''nodes''''' connected by '''''arrows'''''.&lt;br /&gt;
&lt;br /&gt;
:{{Release||4.6|[[File:Chapter 2.2.png]]}}{{Release|5.0||[[File:Chapter_2_2b.png]]}}&lt;br /&gt;
&lt;br /&gt;
'''''Nodes''''' represent variables and appear as boxes, ovals, hexagons, and other shapes. Different node shapes represent different types of variables. Analytica uses the term '''''variable''''' broadly to include anything that has a value or can be evaluated. Note that many of the variables have the same names as the inputs and output at the top diagram that you used in [[Tutorial: Open a model to browse|Chapter 1]]. The top diagram provides an easy way to see and change these nodes’ values.&lt;br /&gt;
&lt;br /&gt;
'''''Arrows''''' connecting different variables indicate a relation between the variables. The arrow connecting ''Rate of inflation ''to ''Appreciation rate ''indicates that the value of the ''Appreciation rate ''variable depends on the value of the ''Rate of inflation ''variable. In the ''Rent vs. Buy ''model influence diagram, ''Cost to Buy ''depends on the ''Buying price'', ''Rate of inflation'', ''Appreciation rate'', ''Discount rate'', and ''Time horizon ''variables.&lt;br /&gt;
&lt;br /&gt;
The following figure illustrates different types of nodes.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Opening Object windows==&lt;br /&gt;
Every object in Analytica has an associated [[Object window]] containing detailed information about it. You can display the '''Object''' window of any variable by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.4.png]]&lt;br /&gt;
&lt;br /&gt;
Information about a variable is provided in a list of attributes. [[Attributes]] include the variable’s class (for example, decision, chance, or constant), identifier, units, title, description, definition, inputs, and outputs. See the illustration below.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.5.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;You can enter numbers with a suffix abbreviation, so Buying Price can be defined as either 140K or 140000. A quick reference for these suffixes is given on [[Number formats]] page.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Moving between Object windows==&lt;br /&gt;
You have opened the [[Object window]] of a variable (''Buying price'') by double-clicking its node in the [[Diagram window|influence diagram]].&lt;br /&gt;
&lt;br /&gt;
The '''Object '''window contains a list of the variable’s '''''inputs '''''and '''''outputs''''', if there are any.&lt;br /&gt;
&lt;br /&gt;
You can open the [[Object window]] for any input or output variable by double-clicking the one you wish to view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.6.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica opens the '''Object''' window for ''Mortgage loan amount''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.7.png]]&lt;br /&gt;
&lt;br /&gt;
Note in the figure above that the '''''Title '''''of ''Mortgage loan amount ''is different from the variable’s [[identifier]], ''Mortgage''. The title is what the model user normally sees; the identifier is used as a mathematical symbol in the definitions of other variables that depend on this variable.&lt;br /&gt;
&lt;br /&gt;
The [[definition]] of the ''Mortgage loan amount ''is an [[Expressions|expression]], the sum of ''Buying price ''and ''Down payment ''(which is a negative amount). The definition refers to these variables by their identifiers.&lt;br /&gt;
&lt;br /&gt;
'''''Inputs '''''lists the identifiers and titles of the variables in the definition. ''Buying price'', the variable you just examined, is one of the inputs. The other input of ''Mortgage loan amount ''is ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.8.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Object window]] now displays the [[attributes]] of ''Down payment''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.9.png]]&lt;br /&gt;
&lt;br /&gt;
==Using the Attribute panel==&lt;br /&gt;
As an alternative to viewing a variable’s attributes in a separate window, you can inspect them in the [[Attribute panel]], which is an auxiliary window pane that you can open below the influence diagram.&lt;br /&gt;
&lt;br /&gt;
The [[Attribute panel]] allows you to rapidly examine one [[attributes|attribute]] at a time of any variable in the model. You select the variable you wish to view and select the attribute to examine from a popup menu.&lt;br /&gt;
&lt;br /&gt;
The variable ''Buying price ''should be highlighted with a title in white, indicating that it is selected; if it is not, select it by clicking it once.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.10.png]]&lt;br /&gt;
&lt;br /&gt;
By default, Analytica displays the '''''description '''''of the selected node (e.g., ''Buying price'') in the [[Attribute panel]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.11.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspecting definitions in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to inspect any attribute of a variable.&lt;br /&gt;
&lt;br /&gt;
In this section, you will see the [[definition]] of two variables that you viewed in the top-level diagram in [[Tutorial: Open a model to browse|Chapter 1]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.12.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.13.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.14.png]]&lt;br /&gt;
&lt;br /&gt;
When a variable is defined as an '''''uncertainty distribution''''', a button appears in the '''Definition''' field.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.15.png]]&lt;br /&gt;
&lt;br /&gt;
In [[Tutorial: Open a model to browse|Chapter 1]] you saw that ''Rate of inflation'' is defined as a [[normal]] distribution with a [[mean]] of 3.5 and a [[Sdeviation|standard deviation]] of 1.3.&lt;br /&gt;
&lt;br /&gt;
==Opening modules==&lt;br /&gt;
Analytica models generally contain '''''modules'''''. Each [[Modules and Libraries|module]] contains the details of a part of the model, also represented as an [[influence diagram]]. In the ''Rent vs. Buy'' model, ''Cost to Buy'' and ''Cost to Rent'' are both modules.&lt;br /&gt;
&lt;br /&gt;
Modules can also contain other modules. In this manner, a large model with hundreds of variables can be organized into a hierarchy of modules, each small enough to be easily understood.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.16.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica displays the influence diagram of the ''Cost to Buy'' [[Modules and Libraries|module]]. This module contains three additional modules: ''Out-of-pocket costs to own, Future sales proceeds,'' and ''Opportunity cost''.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.17.png]]&lt;br /&gt;
&lt;br /&gt;
The '''''input arrowhead''''' (without a trailing line) shows that the node to the right of the arrow has one or more inputs from outside this module.&lt;br /&gt;
&lt;br /&gt;
The '''''output arrowhead''''' shows that the node to the left of the arrow has one or more outputs outside this module.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.18.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.19.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica limits the number of open windows at each level of the model hierarchy to minimize clutter on your screen. See [[Managing windows]] in the [[Analytica User Guide]] for information on how to open more than one module [[Diagram window]] at a time.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.20.png]]&lt;br /&gt;
&lt;br /&gt;
The combined arrowhead, shown above, indicates that the node has one or more inputs from outside this module, plus the input variable in this module.&lt;br /&gt;
&lt;br /&gt;
You can also navigate the model by tracking a variable’s [[User input nodes and user output nodes|inputs or outputs]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.22.png]]&lt;br /&gt;
&lt;br /&gt;
The Out-of-pocket costs to own module diagram is brought to the front, with the Insurance node selected.&lt;br /&gt;
&lt;br /&gt;
==Help balloons==&lt;br /&gt;
[[Help balloons]] pop up when you hover over a node for about a second, and display the title, units, and description for a variable. These allow you to browse information very rapidly without having to open the object window. Balloons do not appear when objects do not have the Help or Description attribute filled in.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.24.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.23.png]]&lt;br /&gt;
&lt;br /&gt;
==Inspecting values in the Attribute panel==&lt;br /&gt;
The [[Attribute panel]] allows you to view certain attributes, such as a variable’s '''''value''''', that are not (initially) displayed in an [[Object window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.25.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.26.png]]&lt;br /&gt;
&lt;br /&gt;
If '''''Value '''''was not previously computed, Analytica computes the variable’s value '''''deterministically''''', assuming that all of the input probability distributions are fixed at their median values. [[Mid]] value is an abbreviation for this deterministically computed value.&lt;br /&gt;
&lt;br /&gt;
You can use the [[Attribute panel]] in this manner to examine the mid value of any variable in the model.&lt;br /&gt;
&lt;br /&gt;
It is faster to compute a mid (deterministic) value than an uncertain (probabilistic) value, so it is useful for conducting initial checks of a model before performing any uncertainty analysis.&lt;br /&gt;
&lt;br /&gt;
==Displaying results==&lt;br /&gt;
When you are viewing a model’s [[Diagram window|influence diagram]], you can evaluate any variable and display its value in a [[Result window]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.27.png]]&lt;br /&gt;
&lt;br /&gt;
A [[Result window]] displays the [[Probability density and mass graphs|probability density function graph]] for this variable. Analytica displays the [[Uncertainty view of a result|uncertainty view]] that was most recently selected from the [[Uncertainty views|Uncertainty View]] popup menu, or that was saved with the model.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.29-updated.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip&amp;gt;The ''Rent vs. Buy ''model uses financial flow conventions: funds flowing in (received) have positive values; funds flowing out (expended) have negative values.&amp;lt;/tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As an alternative to clicking the '''Result''' button [[File:Chapter 2.29.1.png]] and then selecting an uncertainty view, you can use the [[Result menu]] to evaluate a variable and select the [[Uncertainty view of a result|uncertainty view of the result]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.30.png]]&lt;br /&gt;
&lt;br /&gt;
The [[Result window]] appears displaying the variable’s [[Distribution_Densities_Library#Cumulative_Probability_Functions|cumulative probability distribution]].&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.31.png]]&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.33.png]]&lt;br /&gt;
&lt;br /&gt;
A single [[mid]] value appears in table view.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.34.png]]&lt;br /&gt;
&lt;br /&gt;
The [[mid]] value in [[Table view of a result|table view]] is the only result view available for a nonprobabilistic variable with a single value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.35.png]]&lt;br /&gt;
&lt;br /&gt;
Analytica tells you that this is a nonprobabilistic value.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter 2.36.png]]&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
You now have browsed the ''Rent vs. Buy'' model by examining its influence diagrams, variables, attributes, definitions, and results. These are the basic techniques for exploring any Analytica model.&lt;br /&gt;
&lt;br /&gt;
The next chapter shows you how to analyze the Rent vs. Buy model.&lt;br /&gt;
&lt;br /&gt;
You can quit Analytica at this point.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
*  [https://www.analyticacloud.com/acp/Client/AcpClient.aspx?inviteId=3&amp;amp;inviteCode=221703&amp;amp;subName=acp%20demos Play the Rent vs. Buy model in Analytica Cloud Player]  &lt;br /&gt;
* [https://www.youtube.com/watch?v=mpF4xcmKaao Exploring a model] (an explanatory video on YouTube)&lt;br /&gt;
* [[Tutorial videos]]&lt;br /&gt;
* [[Examining a Model]]&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Creating Lucid Influence Diagrams]]&lt;br /&gt;
* [[Object Window]]&lt;br /&gt;
* [[Classes of variables and other objects]]&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Attribute panel]]&lt;br /&gt;
* [[Entering Attributes using the Attribute panel]]&lt;br /&gt;
* [[Definitions]]&lt;br /&gt;
* [[Import a module or library]]&lt;br /&gt;
* [[User input nodes and user output nodes]]&lt;br /&gt;
* [[Help balloons]]&lt;br /&gt;
* [[Result Tables and Graphs]]&lt;br /&gt;
* [[Result window]]&lt;br /&gt;
* [[Managing windows]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Tutorial: Open a model to browse/ {{PAGENAME}} / Tutorial: Analyzing a model&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>KMullins</name></author>
	</entry>
</feed>