Difference between revisions of "Dynamic initial values"

(Var to Local)
 
(5 intermediate revisions by one other user not shown)
Line 3: Line 3:
  
  
A dynamic definition of var usually includes the expression Self[Time-k] or var[Time-k],
+
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.
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
+
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:
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:
 
  
Insurance:
+
:<code>Variable Insurance :=</code>
Dynamic(600, 700, Insurance[Time - 2]*1.05) &rarr;
+
:<code>Dynamic(600, 700, Insurance[Time - 2]*1.05) &rarr;</code>
  
[[File:Chapter17_10.png]]
+
:[[File:Chapter17_10.png]]
 +
 
 +
==See Also==
 +
* [[Dynamic]]
 +
* [[Time]]
 +
* [[Self]]
 +
* [[Local]]
  
  
==See Also==
 
 
<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) →
Chapter17 10.png

See Also


Comments


You are not allowed to post comments.