economics, intertemporal problem
- From: "Max Perez Leon" <max_perez_leon@xxxxxxxx>
- Date: Sun, 30 Sep 2007 15:36:39 +0000 (UTC)
Hello,
I study economics and i want to solve the basic
intertemporal problem of savings.
It goes like this:
Maximization: sum(from t=0 to T) of beta^(t)*(-exp(c(t)))
where c(t) represent consumption in time t.
subject to: s(t+1)=(1+r)s(t)+w(t+1)-c(t+1)
from t=0,1...(T-1)
w(t)=1 for t<R and w(t)=0 for t=>R
What is the way to approach the problem:
I have done a simple optimization of T consumption
variables. It doesnt give very exact results. I have
checked that the Euler condition (first order condition)is
not accomplished in every moment.
For solving this problem i collapse the T restrictions to
only one.
Here is my program:
clear all;clc;i=1;
T=100
R=60
beta=0.9
r=0.2
% Collapsing Restriction
for i=1:T
betas(i)=beta^(i-1)
rs(i)=(1/(1+r))^(i-1);
if i<R
Ws(i)=1;
else
Ws(i)=0;
end
end
Aeq=[rs;zeros(T-1,T)];
beq=[rs*Ws';zeros(T-1,1)];
% Maximization
lb=zeros(T,1);
options = optimset
('LargeScale','off','DiffMaxChange',0.001,'DiffMinChange',1
0^(-15),'MaxFunEvals',10000,'MaxIter',10000);
[c,fval] = fmincon(@(c) -1*betas*(-exp(-c)),c0,[],
[],Aeq,beq,lb,[],[],options);
.
- Prev by Date: More decimals?
- Next by Date: Re: More decimals?
- Previous by thread: More decimals?
- Next by thread: Executable startup/run time
- Index(es):
Relevant Pages
|