 <?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=Lchrisman+TryNew</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=Lchrisman+TryNew"/>
	<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php/Special:Contributions/Lchrisman_TryNew"/>
	<updated>2026-05-25T08:44:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62331</id>
		<title>DetermTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62331"/>
		<updated>2025-02-28T15:22:49Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: /* Subscript Equivalence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[category:User-interface functions]]&lt;br /&gt;
[[category:Functions that create arrays]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
A [[DetermTable]] provides an input view just like that of an [[Table|edit table]], allowing you to specify values or expressions in each cell for all index combinations; however, unlike a [[Table|table]], the evaluation of a determtable conditionally returns only selected values from the table. It is called a determtable because it acts as a deterministic function of one or more ''selector variables''. You can conceptualize a determtable as a multi-dimensional generalization of a select-case statement found in many programming languages, or as a value that varies with the path down a decision tree.&lt;br /&gt;
&lt;br /&gt;
To use a [[DetermTable]], one or more of its table indexes should be discrete variables whose domain attribute has a list of possible values (''selector variables'').  The domain can be either a List, List of Labels, Index domain (in the case of an index domain, the possible values are taken from an index elsewhere in the model), or an expression that returns a list.  These domain values serve as the index for the [[DetermTable]]'s input view.&lt;br /&gt;
&lt;br /&gt;
The value of the selector variable specifies which slice of the [[DetermTable]] should be selected in the result.  Only that row is returned.  This can be contrasted to a normal [[Table|edit table]], in which the entire table (based on the discrete variable's domain) would be returned.&lt;br /&gt;
&lt;br /&gt;
Normal indexes (non-selector indexes) simply add indexes to the table in the same way they do with a [[Table]]. Hence, when a [[DetermTable]] has no selector variables, only normal indexes, it behaves identically to a [[Table]]. It can be useful to use [[DetermTable]] instead of [[Table]] even in that case since it gives you flexibility to change an index to a selector variable in the future without having to modify the definition.&lt;br /&gt;
&lt;br /&gt;
You can always accomplish the same thing as a determtable by using two variable nodes, the first being a table, the second being a subscript expression. &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Here &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is a discrete variable.  Its domain specifies the possible values, while its actual value is just one of those possible values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Scenario object window.png]] {{Assista||(Image of Object Window for Scenario. Its Domain is [1,2,3,4] and its Definition is 3)}}&lt;br /&gt;
&lt;br /&gt;
Because of the discrete domain, &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as both an index and value (its [[IndexValue]] is &amp;lt;code&amp;gt;[1, 2, 3, 4]&amp;lt;/code&amp;gt;, while its value is 3).  We can use it as an index for a [[DetermTable]]:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example.png]] {{Assista||(Image of an Edit table for Economic_Outlook. It is indexed by Scenario with cell values 'Rosy', 'Rosy', 'Mild' and 'Bad')}}&lt;br /&gt;
&lt;br /&gt;
When viewed in input mode, the [[DetermTable]] ''Economic Outlook'' appears as above, and you can change the values in each cell.  When evaluated, only the row selected by &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is returned:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable result.png]] {{Assista||(Image of result for Economic_Outlook with the value 'Mild')}}&lt;br /&gt;
&lt;br /&gt;
== Creating a DetermTable ==&lt;br /&gt;
You can either create a [[DetermTable]] using the GUI or by typing it in as an expression.&lt;br /&gt;
&lt;br /&gt;
To use the GUI, create a variable node and select '''Other...''' from the ''Definition type'' pulldown.  If asked whether you intend to replace the definition, press '''OK'''.  Then navigate to the Array library and select ''DetermTable''.  Press the '''Indexes''' button, which displays the index chooser, and select the index or indexes for your determtable.  Then press '''OK''' twice to leave the wizards.&lt;br /&gt;
&lt;br /&gt;
To type it as an expression, type:&lt;br /&gt;
:&amp;lt;code&amp;gt;DetermTable(I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; are the indexes and discrete variables for your determtable.  You may have between 1 and 15 discrete variables and indexes.  After entering this definition, the definition converts to a [[DetermTable]] button, which you can press to fill in the cell values.&lt;br /&gt;
&lt;br /&gt;
== Converting an existing Table to a DetermTable ==&lt;br /&gt;
&lt;br /&gt;
The expression syntax for a [[DetermTable]] is identical to that of [[Table]].  Thus, one quick and easy way to convert an existing [[Table]] is to view the definition in expression view and change the first word from [[Table]] to [[DetermTable]].&lt;br /&gt;
:&amp;lt;code&amp;gt;''Before:'' Table(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;''After:'' DetermTable(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are converting a huge table (where the expression view contains more than 32000 characters), then Analytica will not allow you to edit the definition in expression view, so the above technique cannot be used.  &lt;br /&gt;
&lt;br /&gt;
A second method is to change the definition using the ''Object Finder''.  From the object window or attribute pane of the node currently defined as an [[Table|edit table]], view the definition attribute.  Using the ''definition type pulldown'', select &amp;quot;Other...&amp;quot;.  You'll be asked if you want to replace the current definition, which you do so press '''OK'''.  The object finder appears, from you you should locate and select [[DetermTable]] from within the ''Array library''.  Press '''OK''' and your [[Table]] is converted to a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
=== Discrete Probabilistic Models ===&lt;br /&gt;
[[DetermTable]]s provide a natural mechanism for encoding utility (or cost) values in a discrete probabilistic model.  This coordinates nicely with the use of [[ProbTable]]s for encoding the uncertainties in discrete variables.&lt;br /&gt;
&lt;br /&gt;
For an example of this use, see the &amp;lt;code&amp;gt;Two Branch Party Problem.ana&amp;lt;/code&amp;gt; example model, included in the ''Example Models\Decision Analysis'' folder with the Analytica installation, where ''Value to author'' is defined as a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
=== Selective Parametric Analysis ===&lt;br /&gt;
When you want to evaluate your model for many different possible values on many different inputs, the very large parametric analysis that results may exceed available memory.  Each time you convert an input value to a list of possible values, the computation and memory requirements increase multiplicatively.  You may also have more than 15 inputs as potential parametric candidates, which exceeds the maximum dimensionality allowed by Analytica, even if you could fit it all in available memory.&lt;br /&gt;
&lt;br /&gt;
To handle such large parametric analyses, you can utilize [[DetermTable]]s to conduct [[Selective Parametric Analysis]].  You configure your model so that you can easily set only a subset of parametric inputs to lists -- the remainder are set to single values.  After computing and viewing the result, then you can change to a different subset of parametric inputs.  So for any given evaluation, you keep your dimensionality under control.  For details on configuring a model in this fashion, see [[Selective Parametric Analysis]].&lt;br /&gt;
&lt;br /&gt;
== Subscript Equivalence ==&lt;br /&gt;
The functionality of a [[DetermTable]] can be implemented using two variables, the first containing a normal [[Table|edit table]], and the second containing a subscript function to select out the indicated row.&lt;br /&gt;
&lt;br /&gt;
For example, to simulate the ''Economic Outlook'' [[DetermTable]] in the earlier example, we could use instead a normal [[Table]] with the values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Normal table example.png]]&lt;br /&gt;
&lt;br /&gt;
We could then define ''Economic Outlook'' as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Economic_outlook_table[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The subscript expression &amp;lt;code&amp;gt;A[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt; is saying to select the slice along the &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; index specified by the ''value'' of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  That is exactly what a [[DetermTable]] does when it evaluates.&lt;br /&gt;
&lt;br /&gt;
Using a [[DetermTable]] has the convenience of saving you an extra node, since a separate node to perform the subscripting is not necessary.  Perhaps more importantly, it is very easy to convert an existing [[Table|table]] into a [[DetermTable]] without having to introduce a new node between the table and all its existing children.&lt;br /&gt;
&lt;br /&gt;
If you ever need access to the full input table from your expressions (rather than just to the selected value), then you need to use a normal [[Table|table]] with a [[subscript]] operator as just shown here.&lt;br /&gt;
&lt;br /&gt;
There is one minor difference between using a DetermTable vs. using a Table and Subscript in two variables. When the DetermTable is evaluated, the cells that are not selected are not evaluated, whereas with the two variables, the full table would be evaluated then the second variable would ignore everything except the selected cells.  This can be leveraged to save computation time, or continue with evaluation when unused cells result in errors.&lt;br /&gt;
&lt;br /&gt;
Access to the full table for both a [[DetermTable]] and a [[ProbTable]] is possible using [[SubTable]].&lt;br /&gt;
&lt;br /&gt;
== DetermTable and Array Abstraction ==&lt;br /&gt;
[[DetermTable]]s full [[Array Abstraction|array abstract]] when a decision variable contains additional dimensions.  A very common example of this occurs when the decision variable is uncertain, so that in [[Evaluation Modes|Sample mode]], the ''probValue'' of the decision variable is indexed by [[Run]].  In this case, each Monte Carlo value separately selects its slice from the [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
In the ''Economic Outlook'' example above, suppose &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s definition was changed to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Array(I, [3, 1, 4, 4, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Scenario's'' domain remains as before.  Now &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s value is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  When the [[DetermTable]] in ''Economic_outlook'' is evaluated, [[Array Abstraction|array abstraction]] kicks in and selects the appropriate row separately for each value of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;, so that the evaluated result of ''Economic_outlook'' becomes:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example2.png]]&lt;br /&gt;
&lt;br /&gt;
The decision variable can be self-indexed, as occurs when it is defined as [[Choice]](Self,...) and '''All''' is selected.  The values from the domain are the [[IndexValues|index values]] for the discrete value.&lt;br /&gt;
&lt;br /&gt;
A variable in Analytica cannot have two separate [[IndexValue|index values]].  For a discrete variable, the domain provides the index values.  Therefore, you cannot introduce a new list of values in the definition of a discrete variable.  An attempt to define &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; as the list &amp;lt;code&amp;gt;[4, 1, 2]&amp;lt;/code&amp;gt; would result in an error, because the attempt to promote this unindexed list to a self-index would conflict with the presence of the domain attribute.  If you want to introduce a list of values, you must create an array based on a separate index.&lt;br /&gt;
&lt;br /&gt;
== Index domains for discrete variables ==&lt;br /&gt;
&lt;br /&gt;
When creating a discrete variable, you may already have the list of possible values elsewhere in your model, in another index.  There are several reasons why it may not make sense to re-enter these as a list or list-of-labels in the [[Domain Attribute|domain attribute]].  If you re-enter them, then if the set of values changes, you'll have to remember to change it in both places.  It may be tedious to re-type or copy/paste the values.  And if the set of values is computed, a list domain would not adapt if the computed list changes.&lt;br /&gt;
&lt;br /&gt;
To use a the values from an existing index as the domain values for your discrete variable, select ''Index'' in the domain type pulldown when editing the domain attribute. After selecting, you are able to select the index that contains the possible values. &lt;br /&gt;
&lt;br /&gt;
When using an [[Domain Attribute|index domain]], your discrete variable functions as a totally separate index from your source index.  &lt;br /&gt;
&lt;br /&gt;
The index domain makes it easy to encode an arbitrary &amp;quot;switch&amp;quot; statement across any existing index.  It solves the problem that your decision variable and your list of possibles values may not (initially) be the same object.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Tutorial: Decision trees#Defining_Utility_as_a_deterministic_table|Tutorial: Defining Utility as a deterministic table]]&lt;br /&gt;
* [[Analytica_User_Group/Past_Topics#Introduction_to_DetermTables|Introduction to DetermTables Webinar]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[ProbTable]]&lt;br /&gt;
* [[Choice]]&lt;br /&gt;
* [[Domain Attribute]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Subscript]]&lt;br /&gt;
* [[Slice]]&lt;br /&gt;
* [[Selective Parametric Analysis]]&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62330</id>
		<title>DetermTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62330"/>
		<updated>2025-02-28T15:20:46Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: /* Subscript Equivalence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[category:User-interface functions]]&lt;br /&gt;
[[category:Functions that create arrays]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
A [[DetermTable]] provides an input view just like that of an [[Table|edit table]], allowing you to specify values or expressions in each cell for all index combinations; however, unlike a [[Table|table]], the evaluation of a determtable conditionally returns only selected values from the table. It is called a determtable because it acts as a deterministic function of one or more ''selector variables''. You can conceptualize a determtable as a multi-dimensional generalization of a select-case statement found in many programming languages, or as a value that varies with the path down a decision tree.&lt;br /&gt;
&lt;br /&gt;
To use a [[DetermTable]], one or more of its table indexes should be discrete variables whose domain attribute has a list of possible values (''selector variables'').  The domain can be either a List, List of Labels, Index domain (in the case of an index domain, the possible values are taken from an index elsewhere in the model), or an expression that returns a list.  These domain values serve as the index for the [[DetermTable]]'s input view.&lt;br /&gt;
&lt;br /&gt;
The value of the selector variable specifies which slice of the [[DetermTable]] should be selected in the result.  Only that row is returned.  This can be contrasted to a normal [[Table|edit table]], in which the entire table (based on the discrete variable's domain) would be returned.&lt;br /&gt;
&lt;br /&gt;
Normal indexes (non-selector indexes) simply add indexes to the table in the same way they do with a [[Table]]. Hence, when a [[DetermTable]] has no selector variables, only normal indexes, it behaves identically to a [[Table]]. It can be useful to use [[DetermTable]] instead of [[Table]] even in that case since it gives you flexibility to change an index to a selector variable in the future without having to modify the definition.&lt;br /&gt;
&lt;br /&gt;
You can always accomplish the same thing as a determtable by using two variable nodes, the first being a table, the second being a subscript expression. &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Here &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is a discrete variable.  Its domain specifies the possible values, while its actual value is just one of those possible values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Scenario object window.png]] {{Assista||(Image of Object Window for Scenario. Its Domain is [1,2,3,4] and its Definition is 3)}}&lt;br /&gt;
&lt;br /&gt;
Because of the discrete domain, &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as both an index and value (its [[IndexValue]] is &amp;lt;code&amp;gt;[1, 2, 3, 4]&amp;lt;/code&amp;gt;, while its value is 3).  We can use it as an index for a [[DetermTable]]:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example.png]] {{Assista||(Image of an Edit table for Economic_Outlook. It is indexed by Scenario with cell values 'Rosy', 'Rosy', 'Mild' and 'Bad')}}&lt;br /&gt;
&lt;br /&gt;
When viewed in input mode, the [[DetermTable]] ''Economic Outlook'' appears as above, and you can change the values in each cell.  When evaluated, only the row selected by &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is returned:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable result.png]] {{Assista||(Image of result for Economic_Outlook with the value 'Mild')}}&lt;br /&gt;
&lt;br /&gt;
== Creating a DetermTable ==&lt;br /&gt;
You can either create a [[DetermTable]] using the GUI or by typing it in as an expression.&lt;br /&gt;
&lt;br /&gt;
To use the GUI, create a variable node and select '''Other...''' from the ''Definition type'' pulldown.  If asked whether you intend to replace the definition, press '''OK'''.  Then navigate to the Array library and select ''DetermTable''.  Press the '''Indexes''' button, which displays the index chooser, and select the index or indexes for your determtable.  Then press '''OK''' twice to leave the wizards.&lt;br /&gt;
&lt;br /&gt;
To type it as an expression, type:&lt;br /&gt;
:&amp;lt;code&amp;gt;DetermTable(I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; are the indexes and discrete variables for your determtable.  You may have between 1 and 15 discrete variables and indexes.  After entering this definition, the definition converts to a [[DetermTable]] button, which you can press to fill in the cell values.&lt;br /&gt;
&lt;br /&gt;
== Converting an existing Table to a DetermTable ==&lt;br /&gt;
&lt;br /&gt;
The expression syntax for a [[DetermTable]] is identical to that of [[Table]].  Thus, one quick and easy way to convert an existing [[Table]] is to view the definition in expression view and change the first word from [[Table]] to [[DetermTable]].&lt;br /&gt;
:&amp;lt;code&amp;gt;''Before:'' Table(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;''After:'' DetermTable(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are converting a huge table (where the expression view contains more than 32000 characters), then Analytica will not allow you to edit the definition in expression view, so the above technique cannot be used.  &lt;br /&gt;
&lt;br /&gt;
A second method is to change the definition using the ''Object Finder''.  From the object window or attribute pane of the node currently defined as an [[Table|edit table]], view the definition attribute.  Using the ''definition type pulldown'', select &amp;quot;Other...&amp;quot;.  You'll be asked if you want to replace the current definition, which you do so press '''OK'''.  The object finder appears, from you you should locate and select [[DetermTable]] from within the ''Array library''.  Press '''OK''' and your [[Table]] is converted to a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
=== Discrete Probabilistic Models ===&lt;br /&gt;
[[DetermTable]]s provide a natural mechanism for encoding utility (or cost) values in a discrete probabilistic model.  This coordinates nicely with the use of [[ProbTable]]s for encoding the uncertainties in discrete variables.&lt;br /&gt;
&lt;br /&gt;
For an example of this use, see the &amp;lt;code&amp;gt;Two Branch Party Problem.ana&amp;lt;/code&amp;gt; example model, included in the ''Example Models\Decision Analysis'' folder with the Analytica installation, where ''Value to author'' is defined as a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
=== Selective Parametric Analysis ===&lt;br /&gt;
When you want to evaluate your model for many different possible values on many different inputs, the very large parametric analysis that results may exceed available memory.  Each time you convert an input value to a list of possible values, the computation and memory requirements increase multiplicatively.  You may also have more than 15 inputs as potential parametric candidates, which exceeds the maximum dimensionality allowed by Analytica, even if you could fit it all in available memory.&lt;br /&gt;
&lt;br /&gt;
To handle such large parametric analyses, you can utilize [[DetermTable]]s to conduct [[Selective Parametric Analysis]].  You configure your model so that you can easily set only a subset of parametric inputs to lists -- the remainder are set to single values.  After computing and viewing the result, then you can change to a different subset of parametric inputs.  So for any given evaluation, you keep your dimensionality under control.  For details on configuring a model in this fashion, see [[Selective Parametric Analysis]].&lt;br /&gt;
&lt;br /&gt;
== Subscript Equivalence ==&lt;br /&gt;
The functionality of a [[DetermTable]] can be implemented using two variables, the first containing a normal [[Table|edit table]], and the second containing a subscript function to select out the indicated row.&lt;br /&gt;
&lt;br /&gt;
For example, to simulate the ''Economic Outlook'' [[DetermTable]] in the earlier example, we could use instead a normal [[Table]] with the values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Normal table example.png]]&lt;br /&gt;
&lt;br /&gt;
We could then define ''Economic Outlook'' as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Economic_outlook_table[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The subscript expression &amp;lt;code&amp;gt;A[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt; is saying to select the slice along the &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; index specified by the ''value'' of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  That is exactly what a [[DetermTable]] does when it evaluates.&lt;br /&gt;
&lt;br /&gt;
Using a [[DetermTable]] has the convenience of saving you an extra node, since a separate node to perform the subscripting is not necessary.  Perhaps more importantly, it is very easy to convert an existing [[Table|table]] into a [[DetermTable]] without having to introduce a new node between the table and all its existing children.&lt;br /&gt;
&lt;br /&gt;
If you ever need access to the full input table from your expressions (rather than just to the selected value), then you need to use a normal [[Table|table]] with a [[subscript]] operator as just shown here.&lt;br /&gt;
&lt;br /&gt;
Analytica 4.2 introduces one functional distinction between a determ table vs. the use of and edit table + subscript.  In Analytica 4.2, the rows of a [[DetermTable]] that are not selected are not evaluated.  This can be leveraged to save computation time, or continue with evaluation when unused cells result in errors.&lt;br /&gt;
&lt;br /&gt;
Also new to Analytica 4.2, access to the full table for both a [[DetermTable]] and a [[ProbTable]] is possible using [[SubTable]].&lt;br /&gt;
&lt;br /&gt;
== DetermTable and Array Abstraction ==&lt;br /&gt;
[[DetermTable]]s full [[Array Abstraction|array abstract]] when a decision variable contains additional dimensions.  A very common example of this occurs when the decision variable is uncertain, so that in [[Evaluation Modes|Sample mode]], the ''probValue'' of the decision variable is indexed by [[Run]].  In this case, each Monte Carlo value separately selects its slice from the [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
In the ''Economic Outlook'' example above, suppose &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s definition was changed to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Array(I, [3, 1, 4, 4, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Scenario's'' domain remains as before.  Now &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s value is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  When the [[DetermTable]] in ''Economic_outlook'' is evaluated, [[Array Abstraction|array abstraction]] kicks in and selects the appropriate row separately for each value of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;, so that the evaluated result of ''Economic_outlook'' becomes:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example2.png]]&lt;br /&gt;
&lt;br /&gt;
The decision variable can be self-indexed, as occurs when it is defined as [[Choice]](Self,...) and '''All''' is selected.  The values from the domain are the [[IndexValues|index values]] for the discrete value.&lt;br /&gt;
&lt;br /&gt;
A variable in Analytica cannot have two separate [[IndexValue|index values]].  For a discrete variable, the domain provides the index values.  Therefore, you cannot introduce a new list of values in the definition of a discrete variable.  An attempt to define &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; as the list &amp;lt;code&amp;gt;[4, 1, 2]&amp;lt;/code&amp;gt; would result in an error, because the attempt to promote this unindexed list to a self-index would conflict with the presence of the domain attribute.  If you want to introduce a list of values, you must create an array based on a separate index.&lt;br /&gt;
&lt;br /&gt;
== Index domains for discrete variables ==&lt;br /&gt;
&lt;br /&gt;
When creating a discrete variable, you may already have the list of possible values elsewhere in your model, in another index.  There are several reasons why it may not make sense to re-enter these as a list or list-of-labels in the [[Domain Attribute|domain attribute]].  If you re-enter them, then if the set of values changes, you'll have to remember to change it in both places.  It may be tedious to re-type or copy/paste the values.  And if the set of values is computed, a list domain would not adapt if the computed list changes.&lt;br /&gt;
&lt;br /&gt;
To use a the values from an existing index as the domain values for your discrete variable, select ''Index'' in the domain type pulldown when editing the domain attribute. After selecting, you are able to select the index that contains the possible values. &lt;br /&gt;
&lt;br /&gt;
When using an [[Domain Attribute|index domain]], your discrete variable functions as a totally separate index from your source index.  &lt;br /&gt;
&lt;br /&gt;
The index domain makes it easy to encode an arbitrary &amp;quot;switch&amp;quot; statement across any existing index.  It solves the problem that your decision variable and your list of possibles values may not (initially) be the same object.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Tutorial: Decision trees#Defining_Utility_as_a_deterministic_table|Tutorial: Defining Utility as a deterministic table]]&lt;br /&gt;
* [[Analytica_User_Group/Past_Topics#Introduction_to_DetermTables|Introduction to DetermTables Webinar]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[ProbTable]]&lt;br /&gt;
* [[Choice]]&lt;br /&gt;
* [[Domain Attribute]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Subscript]]&lt;br /&gt;
* [[Slice]]&lt;br /&gt;
* [[Selective Parametric Analysis]]&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62329</id>
		<title>DetermTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62329"/>
		<updated>2025-02-28T15:18:59Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[category:User-interface functions]]&lt;br /&gt;
[[category:Functions that create arrays]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
A [[DetermTable]] provides an input view just like that of an [[Table|edit table]], allowing you to specify values or expressions in each cell for all index combinations; however, unlike a [[Table|table]], the evaluation of a determtable conditionally returns only selected values from the table. It is called a determtable because it acts as a deterministic function of one or more ''selector variables''. You can conceptualize a determtable as a multi-dimensional generalization of a select-case statement found in many programming languages, or as a value that varies with the path down a decision tree.&lt;br /&gt;
&lt;br /&gt;
To use a [[DetermTable]], one or more of its table indexes should be discrete variables whose domain attribute has a list of possible values (''selector variables'').  The domain can be either a List, List of Labels, Index domain (in the case of an index domain, the possible values are taken from an index elsewhere in the model), or an expression that returns a list.  These domain values serve as the index for the [[DetermTable]]'s input view.&lt;br /&gt;
&lt;br /&gt;
The value of the selector variable specifies which slice of the [[DetermTable]] should be selected in the result.  Only that row is returned.  This can be contrasted to a normal [[Table|edit table]], in which the entire table (based on the discrete variable's domain) would be returned.&lt;br /&gt;
&lt;br /&gt;
Normal indexes (non-selector indexes) simply add indexes to the table in the same way they do with a [[Table]]. Hence, when a [[DetermTable]] has no selector variables, only normal indexes, it behaves identically to a [[Table]]. It can be useful to use [[DetermTable]] instead of [[Table]] even in that case since it gives you flexibility to change an index to a selector variable in the future without having to modify the definition.&lt;br /&gt;
&lt;br /&gt;
You can always accomplish the same thing as a determtable by using two variable nodes, the first being a table, the second being a subscript expression. &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Here &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is a discrete variable.  Its domain specifies the possible values, while its actual value is just one of those possible values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Scenario object window.png]] {{Assista||(Image of Object Window for Scenario. Its Domain is [1,2,3,4] and its Definition is 3)}}&lt;br /&gt;
&lt;br /&gt;
Because of the discrete domain, &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as both an index and value (its [[IndexValue]] is &amp;lt;code&amp;gt;[1, 2, 3, 4]&amp;lt;/code&amp;gt;, while its value is 3).  We can use it as an index for a [[DetermTable]]:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example.png]] {{Assista||(Image of an Edit table for Economic_Outlook. It is indexed by Scenario with cell values 'Rosy', 'Rosy', 'Mild' and 'Bad')}}&lt;br /&gt;
&lt;br /&gt;
When viewed in input mode, the [[DetermTable]] ''Economic Outlook'' appears as above, and you can change the values in each cell.  When evaluated, only the row selected by &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is returned:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable result.png]] {{Assista||(Image of result for Economic_Outlook with the value 'Mild')}}&lt;br /&gt;
&lt;br /&gt;
== Creating a DetermTable ==&lt;br /&gt;
You can either create a [[DetermTable]] using the GUI or by typing it in as an expression.&lt;br /&gt;
&lt;br /&gt;
To use the GUI, create a variable node and select '''Other...''' from the ''Definition type'' pulldown.  If asked whether you intend to replace the definition, press '''OK'''.  Then navigate to the Array library and select ''DetermTable''.  Press the '''Indexes''' button, which displays the index chooser, and select the index or indexes for your determtable.  Then press '''OK''' twice to leave the wizards.&lt;br /&gt;
&lt;br /&gt;
To type it as an expression, type:&lt;br /&gt;
:&amp;lt;code&amp;gt;DetermTable(I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; are the indexes and discrete variables for your determtable.  You may have between 1 and 15 discrete variables and indexes.  After entering this definition, the definition converts to a [[DetermTable]] button, which you can press to fill in the cell values.&lt;br /&gt;
&lt;br /&gt;
== Converting an existing Table to a DetermTable ==&lt;br /&gt;
&lt;br /&gt;
The expression syntax for a [[DetermTable]] is identical to that of [[Table]].  Thus, one quick and easy way to convert an existing [[Table]] is to view the definition in expression view and change the first word from [[Table]] to [[DetermTable]].&lt;br /&gt;
:&amp;lt;code&amp;gt;''Before:'' Table(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;''After:'' DetermTable(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are converting a huge table (where the expression view contains more than 32000 characters), then Analytica will not allow you to edit the definition in expression view, so the above technique cannot be used.  &lt;br /&gt;
&lt;br /&gt;
A second method is to change the definition using the ''Object Finder''.  From the object window or attribute pane of the node currently defined as an [[Table|edit table]], view the definition attribute.  Using the ''definition type pulldown'', select &amp;quot;Other...&amp;quot;.  You'll be asked if you want to replace the current definition, which you do so press '''OK'''.  The object finder appears, from you you should locate and select [[DetermTable]] from within the ''Array library''.  Press '''OK''' and your [[Table]] is converted to a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
=== Discrete Probabilistic Models ===&lt;br /&gt;
[[DetermTable]]s provide a natural mechanism for encoding utility (or cost) values in a discrete probabilistic model.  This coordinates nicely with the use of [[ProbTable]]s for encoding the uncertainties in discrete variables.&lt;br /&gt;
&lt;br /&gt;
For an example of this use, see the &amp;lt;code&amp;gt;Two Branch Party Problem.ana&amp;lt;/code&amp;gt; example model, included in the ''Example Models\Decision Analysis'' folder with the Analytica installation, where ''Value to author'' is defined as a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
=== Selective Parametric Analysis ===&lt;br /&gt;
When you want to evaluate your model for many different possible values on many different inputs, the very large parametric analysis that results may exceed available memory.  Each time you convert an input value to a list of possible values, the computation and memory requirements increase multiplicatively.  You may also have more than 15 inputs as potential parametric candidates, which exceeds the maximum dimensionality allowed by Analytica, even if you could fit it all in available memory.&lt;br /&gt;
&lt;br /&gt;
To handle such large parametric analyses, you can utilize [[DetermTable]]s to conduct [[Selective Parametric Analysis]].  You configure your model so that you can easily set only a subset of parametric inputs to lists -- the remainder are set to single values.  After computing and viewing the result, then you can change to a different subset of parametric inputs.  So for any given evaluation, you keep your dimensionality under control.  For details on configuring a model in this fashion, see [[Selective Parametric Analysis]].&lt;br /&gt;
&lt;br /&gt;
== Subscript Equivalence ==&lt;br /&gt;
The functionality of a [[DetermTable]] can be implemented using two variables, the first containing a normal [[Table|edit table]], and the second containing a subscript function to select out the indicated row.&lt;br /&gt;
&lt;br /&gt;
For example, to simulate the ''Economic Outlook'' [[DetermTable]] in the earlier example, we could use instead a normal [[Table]] with the values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Normal table example.png]]&lt;br /&gt;
&lt;br /&gt;
We could then define ''Economic Outlook'' as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Economic_outlook_table[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At first blush you might think the subscript operation is not doing anything.  It looks a lot like re-indexing an array by replacing index ''Scenario'' with index ''Scenario''.  However, that is not the case.  Remember that the discrete variable &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as either an index or a value, depending on context.  In a subscript operation, [[Subscript|A[I = x]]], «I» is interpreted as an index, and «x» as a value.  Hence, &amp;lt;code&amp;gt;A[Scenario = Scenario]&amp;lt;/code&amp;gt; is saying to select the slice along the &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; index specified by the ''value'' of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  That is exactly what a [[DetermTable]] does.&lt;br /&gt;
&lt;br /&gt;
Using a [[DetermTable]] has the convenience of saving you an extra node, since a separate node to perform the subscripting is not necessary.  Perhaps more importantly, it is very easy to convert an existing [[Table|table]] into a [[DetermTable]] without having to introduce a new node between the table and all its existing children.&lt;br /&gt;
&lt;br /&gt;
If you ever need access to the full input table from your expressions (rather than just to the selected value), then you need to use a normal [[Table|table]] with a [[subscript]] operator as just shown here.&lt;br /&gt;
&lt;br /&gt;
Analytica 4.2 introduces one functional distinction between a determ table vs. the use of and edit table + subscript.  In Analytica 4.2, the rows of a [[DetermTable]] that are not selected are not evaluated.  This can be leveraged to save computation time, or continue with evaluation when unused cells result in errors.&lt;br /&gt;
&lt;br /&gt;
Also new to Analytica 4.2, access to the full table for both a [[DetermTable]] and a [[ProbTable]] is possible using [[SubTable]].&lt;br /&gt;
&lt;br /&gt;
== DetermTable and Array Abstraction ==&lt;br /&gt;
[[DetermTable]]s full [[Array Abstraction|array abstract]] when a decision variable contains additional dimensions.  A very common example of this occurs when the decision variable is uncertain, so that in [[Evaluation Modes|Sample mode]], the ''probValue'' of the decision variable is indexed by [[Run]].  In this case, each Monte Carlo value separately selects its slice from the [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
In the ''Economic Outlook'' example above, suppose &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s definition was changed to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Array(I, [3, 1, 4, 4, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Scenario's'' domain remains as before.  Now &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s value is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  When the [[DetermTable]] in ''Economic_outlook'' is evaluated, [[Array Abstraction|array abstraction]] kicks in and selects the appropriate row separately for each value of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;, so that the evaluated result of ''Economic_outlook'' becomes:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example2.png]]&lt;br /&gt;
&lt;br /&gt;
The decision variable can be self-indexed, as occurs when it is defined as [[Choice]](Self,...) and '''All''' is selected.  The values from the domain are the [[IndexValues|index values]] for the discrete value.&lt;br /&gt;
&lt;br /&gt;
A variable in Analytica cannot have two separate [[IndexValue|index values]].  For a discrete variable, the domain provides the index values.  Therefore, you cannot introduce a new list of values in the definition of a discrete variable.  An attempt to define &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; as the list &amp;lt;code&amp;gt;[4, 1, 2]&amp;lt;/code&amp;gt; would result in an error, because the attempt to promote this unindexed list to a self-index would conflict with the presence of the domain attribute.  If you want to introduce a list of values, you must create an array based on a separate index.&lt;br /&gt;
&lt;br /&gt;
== Index domains for discrete variables ==&lt;br /&gt;
&lt;br /&gt;
When creating a discrete variable, you may already have the list of possible values elsewhere in your model, in another index.  There are several reasons why it may not make sense to re-enter these as a list or list-of-labels in the [[Domain Attribute|domain attribute]].  If you re-enter them, then if the set of values changes, you'll have to remember to change it in both places.  It may be tedious to re-type or copy/paste the values.  And if the set of values is computed, a list domain would not adapt if the computed list changes.&lt;br /&gt;
&lt;br /&gt;
To use a the values from an existing index as the domain values for your discrete variable, select ''Index'' in the domain type pulldown when editing the domain attribute. After selecting, you are able to select the index that contains the possible values. &lt;br /&gt;
&lt;br /&gt;
When using an [[Domain Attribute|index domain]], your discrete variable functions as a totally separate index from your source index.  &lt;br /&gt;
&lt;br /&gt;
The index domain makes it easy to encode an arbitrary &amp;quot;switch&amp;quot; statement across any existing index.  It solves the problem that your decision variable and your list of possibles values may not (initially) be the same object.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Tutorial: Decision trees#Defining_Utility_as_a_deterministic_table|Tutorial: Defining Utility as a deterministic table]]&lt;br /&gt;
* [[Analytica_User_Group/Past_Topics#Introduction_to_DetermTables|Introduction to DetermTables Webinar]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[ProbTable]]&lt;br /&gt;
* [[Choice]]&lt;br /&gt;
* [[Domain Attribute]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Subscript]]&lt;br /&gt;
* [[Slice]]&lt;br /&gt;
* [[Selective Parametric Analysis]]&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62328</id>
		<title>DetermTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DetermTable&amp;diff=62328"/>
		<updated>2025-02-28T15:15:55Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[category:User-interface functions]]&lt;br /&gt;
[[category:Functions that create arrays]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
A [[DetermTable]] provides an input view just like that of an [[Table|edit table]], allowing you to specify values or expressions in each cell for all index combinations; however, unlike a [[Table|table]], the evaluation of a determtable conditionally returns only selected values from the table. It is called a determtable because it acts as a deterministic function of one or more ''selector variables''. You can conceptualize a determtable as a multi-dimensional generalization of a select-case statement found in many programming languages, or as a value that varies with the path down a decision tree.&lt;br /&gt;
&lt;br /&gt;
To use a [[DetermTable]], one or more of its table indexes should be discrete variables whose domain attribute has a list of possible values (''selector variables'').  The domain can be either a List, List of Labels, Index domain (in the case of an index domain, the possible values are taken from an index elsewhere in the model), or an expression that returns a list.  These domain values serve as the index for the [[DetermTable]]'s input view.&lt;br /&gt;
&lt;br /&gt;
The value of the selector variable specifies which slice of the [[DetermTable]] should be selected in the result.  Only that row is returned.  This can be contrasted to a normal [[Table|edit table]], in which the entire table (based on the discrete variable's domain) would be returned.&lt;br /&gt;
&lt;br /&gt;
Normal indexes (non-selector indexes) simply add indexes to the table in the same way they do with a [[Table]]. Hence, when a [[DetermTable]] has no selector variables, only normal indexes, it behaves identically to a [[Table]]. It can be useful to use [[DetermTable]] instead of [[Table]] even in that case since it gives you flexibility to change an index to a selector variable in the future without having to modify the definition.&lt;br /&gt;
&lt;br /&gt;
You can always accomplish the same thing as a determtable by using two variable nodes, the first being a table, the second being a subscript expression. &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Here &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is a discrete variable.  Its domain specifies the possible values, while its actual value is just one of those possible values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Scenario object window.png]]&lt;br /&gt;
&lt;br /&gt;
Because of the discrete domain, &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as both an index and value (its [[IndexValue]] is &amp;lt;code&amp;gt;[1, 2, 3, 4]&amp;lt;/code&amp;gt;, while its value is 3).  We can use it as an index for a [[DetermTable]]:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example.png]]&lt;br /&gt;
&lt;br /&gt;
When viewed in input mode, the [[DetermTable]] ''Economic Outlook'' appears as above, and you can change the values in each cell.  When evaluated, only the row selected by &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; is returned:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable result.png]]&lt;br /&gt;
&lt;br /&gt;
== Creating a DetermTable ==&lt;br /&gt;
You can either create a [[DetermTable]] using the GUI or by typing it in as an expression.&lt;br /&gt;
&lt;br /&gt;
To use the GUI, create a variable node and select '''Other...''' from the ''Definition type'' pulldown.  If asked whether you intend to replace the definition, press '''OK'''.  Then navigate to the Array library and select ''DetermTable''.  Press the '''Indexes''' button, which displays the index chooser, and select the index or indexes for your determtable.  Then press '''OK''' twice to leave the wizards.&lt;br /&gt;
&lt;br /&gt;
To type it as an expression, type:&lt;br /&gt;
:&amp;lt;code&amp;gt;DetermTable(I, J, K)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt; are the indexes and discrete variables for your determtable.  You may have between 1 and 15 discrete variables and indexes.  After entering this definition, the definition converts to a [[DetermTable]] button, which you can press to fill in the cell values.&lt;br /&gt;
&lt;br /&gt;
== Converting an existing Table to a DetermTable ==&lt;br /&gt;
&lt;br /&gt;
The expression syntax for a [[DetermTable]] is identical to that of [[Table]].  Thus, one quick and easy way to convert an existing [[Table]] is to view the definition in expression view and change the first word from [[Table]] to [[DetermTable]].&lt;br /&gt;
:&amp;lt;code&amp;gt;''Before:'' Table(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;''After:'' DetermTable(Scenario)('Rosy', 'Rosy', 'Mild', 'Bad')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are converting a huge table (where the expression view contains more than 32000 characters), then Analytica will not allow you to edit the definition in expression view, so the above technique cannot be used.  &lt;br /&gt;
&lt;br /&gt;
A second method is to change the definition using the ''Object Finder''.  From the object window or attribute pane of the node currently defined as an [[Table|edit table]], view the definition attribute.  Using the ''definition type pulldown'', select &amp;quot;Other...&amp;quot;.  You'll be asked if you want to replace the current definition, which you do so press '''OK'''.  The object finder appears, from you you should locate and select [[DetermTable]] from within the ''Array library''.  Press '''OK''' and your [[Table]] is converted to a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
=== Discrete Probabilistic Models ===&lt;br /&gt;
[[DetermTable]]s provide a natural mechanism for encoding utility (or cost) values in a discrete probabilistic model.  This coordinates nicely with the use of [[ProbTable]]s for encoding the uncertainties in discrete variables.&lt;br /&gt;
&lt;br /&gt;
For an example of this use, see the &amp;lt;code&amp;gt;Two Branch Party Problem.ana&amp;lt;/code&amp;gt; example model, included in the ''Example Models\Decision Analysis'' folder with the Analytica installation, where ''Value to author'' is defined as a [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
=== Selective Parametric Analysis ===&lt;br /&gt;
When you want to evaluate your model for many different possible values on many different inputs, the very large parametric analysis that results may exceed available memory.  Each time you convert an input value to a list of possible values, the computation and memory requirements increase multiplicatively.  You may also have more than 15 inputs as potential parametric candidates, which exceeds the maximum dimensionality allowed by Analytica, even if you could fit it all in available memory.&lt;br /&gt;
&lt;br /&gt;
To handle such large parametric analyses, you can utilize [[DetermTable]]s to conduct [[Selective Parametric Analysis]].  You configure your model so that you can easily set only a subset of parametric inputs to lists -- the remainder are set to single values.  After computing and viewing the result, then you can change to a different subset of parametric inputs.  So for any given evaluation, you keep your dimensionality under control.  For details on configuring a model in this fashion, see [[Selective Parametric Analysis]].&lt;br /&gt;
&lt;br /&gt;
== Subscript Equivalence ==&lt;br /&gt;
The functionality of a [[DetermTable]] can be implemented using two variables, the first containing a normal [[Table|edit table]], and the second containing a subscript function to select out the indicated row.&lt;br /&gt;
&lt;br /&gt;
For example, to simulate the ''Economic Outlook'' [[DetermTable]] in the earlier example, we could use instead a normal [[Table]] with the values:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Normal table example.png]]&lt;br /&gt;
&lt;br /&gt;
We could then define ''Economic Outlook'' as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Economic_outlook_table[Domain of Scenario = Scenario]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At first blush you might think the subscript operation is not doing anything.  It looks a lot like re-indexing an array by replacing index ''Scenario'' with index ''Scenario''.  However, that is not the case.  Remember that the discrete variable &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; can serve as either an index or a value, depending on context.  In a subscript operation, [[Subscript|A[I = x]]], «I» is interpreted as an index, and «x» as a value.  Hence, &amp;lt;code&amp;gt;A[Scenario = Scenario]&amp;lt;/code&amp;gt; is saying to select the slice along the &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; index specified by the ''value'' of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  That is exactly what a [[DetermTable]] does.&lt;br /&gt;
&lt;br /&gt;
Using a [[DetermTable]] has the convenience of saving you an extra node, since a separate node to perform the subscripting is not necessary.  Perhaps more importantly, it is very easy to convert an existing [[Table|table]] into a [[DetermTable]] without having to introduce a new node between the table and all its existing children.&lt;br /&gt;
&lt;br /&gt;
If you ever need access to the full input table from your expressions (rather than just to the selected value), then you need to use a normal [[Table|table]] with a [[subscript]] operator as just shown here.&lt;br /&gt;
&lt;br /&gt;
Analytica 4.2 introduces one functional distinction between a determ table vs. the use of and edit table + subscript.  In Analytica 4.2, the rows of a [[DetermTable]] that are not selected are not evaluated.  This can be leveraged to save computation time, or continue with evaluation when unused cells result in errors.&lt;br /&gt;
&lt;br /&gt;
Also new to Analytica 4.2, access to the full table for both a [[DetermTable]] and a [[ProbTable]] is possible using [[SubTable]].&lt;br /&gt;
&lt;br /&gt;
== DetermTable and Array Abstraction ==&lt;br /&gt;
[[DetermTable]]s full [[Array Abstraction|array abstract]] when a decision variable contains additional dimensions.  A very common example of this occurs when the decision variable is uncertain, so that in [[Evaluation Modes|Sample mode]], the ''probValue'' of the decision variable is indexed by [[Run]].  In this case, each Monte Carlo value separately selects its slice from the [[DetermTable]].&lt;br /&gt;
&lt;br /&gt;
In the ''Economic Outlook'' example above, suppose &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s definition was changed to:&lt;br /&gt;
:&amp;lt;code&amp;gt;Array(I, [3, 1, 4, 4, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''Scenario's'' domain remains as before.  Now &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;'s value is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  When the [[DetermTable]] in ''Economic_outlook'' is evaluated, [[Array Abstraction|array abstraction]] kicks in and selects the appropriate row separately for each value of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;, so that the evaluated result of ''Economic_outlook'' becomes:&lt;br /&gt;
&lt;br /&gt;
:[[Image:DetermTable example2.png]]&lt;br /&gt;
&lt;br /&gt;
The decision variable can be self-indexed, as occurs when it is defined as [[Choice]](Self,...) and '''All''' is selected.  The values from the domain are the [[IndexValues|index values]] for the discrete value.&lt;br /&gt;
&lt;br /&gt;
A variable in Analytica cannot have two separate [[IndexValue|index values]].  For a discrete variable, the domain provides the index values.  Therefore, you cannot introduce a new list of values in the definition of a discrete variable.  An attempt to define &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; as the list &amp;lt;code&amp;gt;[4, 1, 2]&amp;lt;/code&amp;gt; would result in an error, because the attempt to promote this unindexed list to a self-index would conflict with the presence of the domain attribute.  If you want to introduce a list of values, you must create an array based on a separate index.&lt;br /&gt;
&lt;br /&gt;
== Index domains for discrete variables ==&lt;br /&gt;
&lt;br /&gt;
When creating a discrete variable, you may already have the list of possible values elsewhere in your model, in another index.  There are several reasons why it may not make sense to re-enter these as a list or list-of-labels in the [[Domain Attribute|domain attribute]].  If you re-enter them, then if the set of values changes, you'll have to remember to change it in both places.  It may be tedious to re-type or copy/paste the values.  And if the set of values is computed, a list domain would not adapt if the computed list changes.&lt;br /&gt;
&lt;br /&gt;
To use a the values from an existing index as the domain values for your discrete variable, select ''Index'' in the domain type pulldown when editing the domain attribute. After selecting, you are able to select the index that contains the possible values. &lt;br /&gt;
&lt;br /&gt;
When using an [[Domain Attribute|index domain]], your discrete variable functions as a totally separate index from your source index.  &lt;br /&gt;
&lt;br /&gt;
The index domain makes it easy to encode an arbitrary &amp;quot;switch&amp;quot; statement across any existing index.  It solves the problem that your decision variable and your list of possibles values may not (initially) be the same object.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Tutorial: Decision trees#Defining_Utility_as_a_deterministic_table|Tutorial: Defining Utility as a deterministic table]]&lt;br /&gt;
* [[Analytica_User_Group/Past_Topics#Introduction_to_DetermTables|Introduction to DetermTables Webinar]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[ProbTable]]&lt;br /&gt;
* [[Choice]]&lt;br /&gt;
* [[Domain Attribute]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Subscript]]&lt;br /&gt;
* [[Slice]]&lt;br /&gt;
* [[Selective Parametric Analysis]]&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Area&amp;diff=2524</id>
		<title>Area</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Area&amp;diff=2524"/>
		<updated>2007-02-01T23:40:44Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Array-reducing functions]]&lt;br /&gt;
&lt;br /&gt;
 Area(R,I,X1,X2)&lt;br /&gt;
Returns the area (sum of trapezoids) under array R across index I between X1 and X2. X1 and X2 are optional.&lt;br /&gt;
&lt;br /&gt;
= Declaration =&lt;br /&gt;
 Area( R : Numeric[J] ; I : ascending Numeric[J] ; X1,X2 : opt numeric atomic ; J : opt hidden IndexType = I )&lt;br /&gt;
&lt;br /&gt;
= Simplest Usage =&lt;br /&gt;
&lt;br /&gt;
In the simple usage, the second parameter, I, is an index with increasing numeric values, and R is indexed by I.  You can visualize R as a function of I, and Area returns the area under the curve obtained when I is plotted on the X-axis and R on the Y-axis.&lt;br /&gt;
&lt;br /&gt;
= Using an array for I =&lt;br /&gt;
&lt;br /&gt;
(new to 4.0).&lt;br /&gt;
When your X-axis values are in an array, e.g., X and Y are both arrays indexed by In1, you can use:&lt;br /&gt;
 Area( Y,X,X1,X2,In1 )&lt;br /&gt;
&lt;br /&gt;
Here the x-axis values are taken from the X-array rather than from the index.  If X1 and X2 are omitted, you can write&lt;br /&gt;
 Area( R:Y,I:X,J:In1 )&lt;br /&gt;
or equivalently&lt;br /&gt;
 Area( Y,X, J:In1 )&lt;br /&gt;
&lt;br /&gt;
When using an array of values for the X-axis, the index, J, may contain arbitrary values, but X must contain values that are in ascending order.&lt;br /&gt;
&lt;br /&gt;
If X is a self-indexed array, and Y is indexed by X, and the J parameter is omitted, then the values of X are used and the self-index of X is used.&lt;br /&gt;
&lt;br /&gt;
= Details =&lt;br /&gt;
&lt;br /&gt;
Some notes: J is hidden from the user, since the main concern was fixing several bugs with the function while maintaining backward compatibility.  However, as the above example shows, it can be useful.  The second parameter is named I for legacy reasons, but it would be better named X with the J parameter named I.  Consider this change when updating manuals.&lt;br /&gt;
&lt;br /&gt;
Another difference relative to 3.1 is that X2 (upper bound) can be specified while not specifying X1 (lower bound).  So, for example, you could find the area up to a given point, e.g.:&lt;br /&gt;
 var dens := Pdf(Ch1);&lt;br /&gt;
 Area( dens, dens.Step, X2:x )&lt;br /&gt;
&lt;br /&gt;
= See Also = &lt;br /&gt;
&lt;br /&gt;
* [[Integrate]]&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Area&amp;diff=2523</id>
		<title>Area</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Area&amp;diff=2523"/>
		<updated>2007-02-01T23:40:14Z</updated>

		<summary type="html">&lt;p&gt;Lchrisman TryNew: Cleaned up a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Array-reducing functions]]&lt;br /&gt;
&lt;br /&gt;
 Area(R,I,X1,X2)&lt;br /&gt;
Returns the area (sum of trapezoids) under array R across index I between X1 and X2. X1 and X2 are optional.&lt;br /&gt;
&lt;br /&gt;
= Declaration =&lt;br /&gt;
 Area( R : Numeric[J] ; I : ascending Numeric[J] ; X1,X2 : opt numeric atomic ; J : opt hidden IndexType = I )&lt;br /&gt;
&lt;br /&gt;
= Simplest Usage =&lt;br /&gt;
&lt;br /&gt;
In the simple usage, the second parameter, I, is an index with increasing numeric values, and R is indexed by I.  You can visualize R as a function of I, and Area returns the area under the curve obtained when I is plotted on the X-axis and R on the Y-axis.&lt;br /&gt;
&lt;br /&gt;
= Using an array for I =&lt;br /&gt;
&lt;br /&gt;
(new to 4.0).&lt;br /&gt;
When your X-axis values are in an array, e.g., X and Y are both arrays indexed by In1, you can use:&lt;br /&gt;
 Area( Y,X,X1,X2,In1 )&lt;br /&gt;
&lt;br /&gt;
Here the x-axis values are taken from the X-array rather than from the index.  If X1 and X2 are omitted, you can write&lt;br /&gt;
 Area( R:Y,I:X,J:In1 )&lt;br /&gt;
or equivalently&lt;br /&gt;
 Area( Y,X, J:In1 )&lt;br /&gt;
&lt;br /&gt;
When using an array of values for the X-axis, the index, J, may contain arbitrary values, but X must contain values that are in ascending order.&lt;br /&gt;
&lt;br /&gt;
If X is a self-indexed array, and Y is indexed by X, and the J parameter is omitted, then the values of X are used and the self-index of X is used.&lt;br /&gt;
&lt;br /&gt;
= Details =&lt;br /&gt;
&lt;br /&gt;
Some notes: J is hidden from the user, since the main concern was fixing several bugs with the function while maintaining backward compatibility.  However, as the above example shows, it can be useful.  The second parameter is named I for legacy reasons, but it would be better named X with the J parameter named I.  Consider this change when updating manuals.&lt;br /&gt;
&lt;br /&gt;
Another difference relative to 3.1 is that X2 (upper bound) can be specified while not specifying X1 (lower bound).  So, for example, you could find the area up to a given point, e.g.:&lt;br /&gt;
 var dens := Pdf(Ch1);&lt;br /&gt;
 Area( dens, dens.Step, X2:x )&lt;/div&gt;</summary>
		<author><name>Lchrisman TryNew</name></author>
	</entry>
</feed>