Model dynamics

SeedRandom[1000]

Clear[P,X,W,V,R,H,IP, IS]

(* evolution of prices *)
P[t_]:=P[t]=((X[t]+R[t]-lambda*(sigma^2)*H[t])/(1+r+delta)) +2*RandomVariate[NormalDistribution[0,1]]

(* price expectations *)
X[t_]:=X[t]=W[t-1](P[t-1]+gamma(P[t-1]-PSTAR))+(1-W[t-1])(P[t-1]+chi(PSTAR-P[t-1]))
W[t_]:=W[t]=1/(1+V[t](P[t]-PSTAR)^2)
V[t_]:=V[t]=If[P[t]-PSTAR<0, vl-cl(P[t]-PSTAR),vu+cu(P[t]-PSTAR)]

(* rent level *)
R[t_]:=R[t]=(m0/(H[t]^m))  

(* evolution of housing stock *)
H[t_]:=H[t]=(1-delta)H[t-1]+IP[t]+IS[t]
IP[t_]:=IP[t]=q0*P[t-1]^q
IS[t_]:=IS[t]=0

(* parameter setting *)
r=0.005;delta=0.005;sigma=2;lambda=0.00125;
m0=1.5*10^8;m=4;q0=5*10^-9;q=4;
gamma=0.15;chi=0.125;vl=0.01;vu=0.01;cl=0.01;cu=0;

(* fundamental steady state *)
PSTAR=HSTAR=100;
(* initial values *)
P[1]=101;H[1]=100;

(* model dynamics *)
aa=ListPlot[{Table[P[t],{t,1,200}],Table[H[t],{t,1,200}],Table[100,{200}]},Joined->True,FrameTicks->{{{{100,100},{115,115},{85,85}},None},{{{1,1},{50,50},{100,100},{150,150},{200,200}},None }},
Frame->True,PlotRange->{80,120},Axes->None,AspectRatio->0.5,FrameLabel->{"time","P,  H" },PlotStyle->{Black,Darker[Green],{Gray}}];
bb=ListPlot[Table[1-W[t],{t,1,200}],Joined->True,Frame->True,PlotRange->{-0.05,1.05},Axes->None,AspectRatio->0.5,FrameLabel->{"time","1-w"},PlotStyle->{Black},FrameTicks->{{{{0.10,"0.10"},{0.50,"0.50"},{0.90,"0.90"}},None},{{{0,0},{50,50},{100,100},{150,150},{200,200}},None }}];
cc=ListPlot[{Table[IS[t],{t,2,200}],Table[IP[t],{t,2,200}]},Joined->True,Frame->True,PlotRange->{-0.05,1.05},Axes->None,AspectRatio->0.5,FrameLabel->{"time","IS, IP" },PlotStyle->{Red,Black},FrameTicks->{{{{0.10,"0.10"},{0.50,"0.50"},{0.90,"0.90"}},None},{{{0,0},{50,50},{100,100},{150,150},{200,200}},None }}];
dd=GraphicsColumn[{aa,bb,cc},ImageSize->Large]

(* key statistics *)
Print["price distortion: ",Mean[Table[Abs[((P[t]-PSTAR)/PSTAR)],{t,2,50000}]]]
Print["housing stock distortion: ",Mean[Table[Abs[((H[t]-HSTAR)/HSTAR)],{t,2,50000}]]]
Print["average price: ",Mean[Table[P[t],{t,2,50000}]]]
Print["average housing stock: ",Mean[Table[H[t],{t,2,50000}]]]
Print["private investments: ",Mean[Table[IP[t],{t,2,50000}]]]
Print["public investment: ",Mean[Table[IS[t],{t,2,50000}]]]
Print["share of chartists: " , Mean[Table[W[t],{t,2,50000}]]]
Print["rent level: ", Mean[Table[R[t],{t,2,50000}]]]
Print["price volatility: ",Mean[Table[Abs[((P[t]-P[t-1])/P[t-1])],{t,2,50000}]]]