How do I create an iterated or recursive formula that includes the product of a sequence?
Show older comments
I am new to matlab, so I apologize if my code is quite poor, but that's why I'm here!
I'm attempting to create the recursive formula below (it is formatted for LaTeX, which I don't think renders on this site, but I have attached an image of it as well):
$k_{T+1}=(1-\delta)k_T+k_{T}^\alpha-\beta^(T/\gamma)g^Tc_0\prod\limits_{t=1}^{T}R_t$\ where $R_t=\alpha k_t^{\alpha-1}+1-\delta$
The code I have attempted is below, but it is clearly incorrect as it does not like what I've tried (I have defined the variables being referred to with specific values, but I did not include those in this code sample):
t=1;
k(1)=kyratio^(1/(1-alpha));
R(1)=alpha*k(1)^(alpha-1)+1-delta
for t=2:105 j=1:105;
k(t+1)=(1-delta)*k(t)+k(t)^alpha-(beta^(1/gamma)*symprod(R(j+1),j,1,t))*czero*gstar^(-(t-1)) ;
R(j)=alpha*k(t)^(alpha-1)+1-delta ;
end
Thanks in advance for any resources you can point me towards, or any advice you give me!

2 Comments
Walter Roberson
on 16 Oct 2015
Please explain what you intended by
for t=2:105 j=1:105;
jlpva
on 16 Oct 2015
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!