Skip to main content
2 of 4
added 1026 characters in body

While-Loop Linear Projection

I'm would like to do a linear progression for a recursive relation of a consumption function. Combining my program skills and my sparse knowledge of mathematica, I was thinking about doing it in a while-loop as follows:

 While[\[CapitalDelta]Cp < 1,
 Cp = 0.4 \[CapitalDelta]Y + 
   0.407 (0.9 Subscript[Yl, -1] + 0.1 Subscript[Wl, -1] - Subscript[
      Cp, -1]) + Subscript[Cp, -1];
 \[CapitalDelta]Cp = Cp - Subscript[Cp, -1];
 W = Subscript[Wl, -1] + (\[CapitalDelta]Y + Subscript[Yl, -1]) - Cp;
 Subscript[Wl, -1] = W;
 Subscript[Cp, -1] = Cp;
 ]

Though, it doesn't work.

EDIT: Clearifying----

I have to functions, one that determines consumption (Cp) and one that determines the fortune (Wp). They are recursive in that I need to determine the consumption before I can determine the fortune.

$$ Cp=0.4\Delta Y+0.407(0.9Y_{-1}+0.1Wp_{-1}-Cp_{-1})\\ Wp=Wp_{-1}+Y-C $$

The symbol $_{-1}$ states that the data are lagged meaning that it is last years value.

Initially I append the following data to the variables in order for the loop to start, since I would like to project the value of Cp and Wp ten year ahead.

$$ Y_{-1}=1\\ Wp_{-1}=1\\ Cp_{-1}=1\\ \Delta Y=1\\ $$

Then I would like to make a loop that iterates through the functions 10 times, whereas they after each iteration automatically assign the newly calculated value to the lagged variables, being:

$$ Y_{-1}=Y\\ Wp_{-1}=Wp\\ \vdots $$

I would like for $\Delta Y$ to increment by 1% each year automatically as well. How is this possible? Please ask if the question is still unclear.

----EDIT END

How can I solve this? Best regards, Brinck10