Difference between revisions of "Dynamic initial values"
(Var to Local) |
|||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
− | A [[dynamic]] definition of <code>var</code> usually includes the expression <code>Self[Time - k]</code> or <code>var[Time - k]</code>, where <code>k</code> is the number of time periods to subtract from the current | + | A [[dynamic]] definition of <code>var</code> usually includes the expression <code>Self[Time - k]</code> or <code>var[Time - k]</code>, where <code>k</code> is the number of time periods to subtract from the current [[Time]] value. It is typically the case that at least ''1'' initial value is supplied. |
As an example, when <code>k</code> in <code>[Time - k]</code> is greater than ''1'', suppose your car insurance policy depends on the premium you paid two years ago. To calculate your payments in 1992, you must refer to the amount paid in 1990. A dynamic variable representing such a rate for insurance needs two initial values for [[Time]], such as: | As an example, when <code>k</code> in <code>[Time - k]</code> is greater than ''1'', suppose your car insurance policy depends on the premium you paid two years ago. To calculate your payments in 1992, you must refer to the amount paid in 1990. A dynamic variable representing such a rate for insurance needs two initial values for [[Time]], such as: | ||
Line 11: | Line 11: | ||
:[[File:Chapter17_10.png]] | :[[File:Chapter17_10.png]] | ||
− | |||
==See Also== | ==See Also== | ||
Line 17: | Line 16: | ||
* [[Time]] | * [[Time]] | ||
* [[Self]] | * [[Self]] | ||
− | * [[ | + | * [[Local]] |
<footer>Time index details / {{PAGENAME}} / Dynamic using arrays</footer> | <footer>Time index details / {{PAGENAME}} / Dynamic using arrays</footer> |
Latest revision as of 00:03, 9 October 2021
A dynamic definition of var
usually includes the expression Self[Time - k]
or var[Time - k]
, where k
is the number of time periods to subtract from the current Time value. It is typically the case that at least 1 initial value is supplied.
As an example, when k
in [Time - k]
is greater than 1, suppose your car insurance policy depends on the premium you paid two years ago. To calculate your payments in 1992, you must refer to the amount paid in 1990. A dynamic variable representing such a rate for insurance needs two initial values for Time, such as:
Variable Insurance :=
Dynamic(600, 700, Insurance[Time - 2]*1.05) →
See Also
Comments
Enable comment auto-refresher