Hi Robert,
recently I tried to redo the OLG transition path (using OLG Model 6 Stochastic OLG Model as the basic framework to analyze the change of [parameter alpha). I got the following error message:
Error using gpuArray/reshape
Sparse gpuArray matrices are not supported for this function.
Error in AgentDist_FHorz_TPath_SingleStep_IterFast_raw (line 21)
AgentDist_tt=reshape(Gammatranspose*AgentDist_tt,[N_a,(N_j-1)*N_z]);
Error in AgentDistOnTransPath_Case1_FHorz (line 632)
AgentDist=AgentDist_FHorz_TPath_SingleStep_IterFast_raw(AgentDist,Policy_aprimejz,N_a,N_z,N_j,pi_z_J_sim,II1,II2,exceptlastj,exceptfirstj,justfirstj,jequaloneDist);
Error in transition_test (line 218)
AgentDistPath=AgentDistOnTransPath_Case1_FHorz(StationaryDist_init, jequaloneDist, PricePath, ParamPath, PolicyPath, AgeWeightParamNames,n_d,n_a,n_z,N_j,pi_z,T,Params, transpathoptions, simoptions);
I use the following codes to calculate the path. It can generate the figure of the interest rate path, but not the agg variable K. I think they worked before.
T=50;
ParamPath.alpha=0.4* ones(T,1);
PricePath0.r=[linspace(p_eqm_init.r, p_eqm_final.r, floor(T/2))‘; p_eqm_final.r* ones(T-floor(T/2),1)];
PricePath0.AccidentBeq=[linspace(p_eqm_init.AccidentBeq, p_eqm_final.AccidentBeq, floor(T/2))’; p_eqm_final.AccidentBeqones(T-floor(T/2),1)];
TransPathGeneralEqmEqns.capitalmarket = @(r,K,L,alpha,delta,A) r-alpha A* (K^(alpha-1))* (L^(1-alpha));
TransPathGeneralEqmEqns.bequests = @(AccidentalBeqLeft,AccidentBeq,n) AccidentalBeqLeft/(1+n)-AccidentBeq;
vfoptions.divideandconquer=1;
vfoptions.level1n=11;
vfoptions.fastOLG=1;
transpathoptions.weightscheme=1;
transpathoptions.verbose=1;
transpathoptions.GEnewprice=3;
transpathoptions.GEnewprice3.howtoupdate={…
‘capitalmarket’,‘r’,0,0.03;…
‘bequests’,‘AccidentBeq’,1,0.05;…
};
PricePath=TransitionPath_Case1_FHorz(PricePath0, ParamPath, T, V_final, StationaryDist_init, jequaloneDist,n_d, n_a, n_z, N_j, d_grid,a_grid,z_grid, pi_z, ReturnFn, FnsToEvaluate, TransPathGeneralEqmEqns, Params, DiscountFactorParamNames, AgeWeightParamNames, transpathoptions, simoptions, vfoptions);
figure(1)
plot(0:1:T, [p_eqm_init.r,PricePath.r])
title(‘interest rate path for transtion’)
[VPath,PolicyPath]=ValueFnOnTransPath_Case1_FHorz(PricePath, ParamPath, T, V_final, Policy_final, Params, n_d, n_a, n_z, N_j, d_grid, a_grid,z_grid, pi_z, DiscountFactorParamNames, ReturnFn, transpathoptions, vfoptions);
AgentDistPath=AgentDistOnTransPath_Case1_FHorz(StationaryDist_init, jequaloneDist, PricePath, ParamPath, PolicyPath, AgeWeightParamNames,n_d,n_a,n_z,N_j,pi_z,T,Params, transpathoptions, simoptions);
AggVarsPath=EvalFnOnTransPath_AggVars_Case1_FHorz(FnsToEvaluate,AgentDistPath,PolicyPath,PricePath,ParamPath, Params, T, n_d, n_a, n_z, N_j, d_grid, a_grid,z_grid,transpathoptions, simoptions);
figure(2)
plot(0:1:T, [AggVars_init.K.Mean, AggVarsPath.K.Mean])
title(‘path of transtion for capital’)