Hi Robert, I try to run the LifeCycleModel35.m but got the following error:
Test ValueFnIter
vfoptions =
struct with fields:
survivalprobability: 'sj'
riskyasset: 1
exoticpreferences: 'EpsteinZin'
EZpositiveutility: 0
EZriskaversion: 'phi'
aprimeFn: [function_handle]
n_u: 5
u_grid: [5×1 gpuArray]
pi_u: [5×1 gpuArray]
verbose: 1
parallel: 2
returnmatrix: 2
lowmemory: 0
paroverz: 1
divideandconquer: 0
incrementaltype: 0
polindorval: 1
outputkron: 0
policy_forceintegertype: 0
dynasty: 0
experienceasset: 0
experienceassetu: 0
residualasset: 0
vfoptions =
struct with fields:
survivalprobability: 'sj'
riskyasset: 1
exoticpreferences: 'EpsteinZin'
EZpositiveutility: 0
EZriskaversion: 'phi'
aprimeFn: [function_handle]
n_u: 5
u_grid: [5×1 gpuArray]
pi_u: [5×1 gpuArray]
verbose: 1
parallel: 2
returnmatrix: 2
lowmemory: 0
paroverz: 1
divideandconquer: 0
incrementaltype: 0
polindorval: 1
outputkron: 0
policy_forceintegertype: 0
dynasty: 0
experienceasset: 0
experienceassetu: 0
residualasset: 0
Finite horizon: 80 of 81
Error using +
Arrays have incompatible sizes for this operation.
Error in ValueFnIter_FHorz_RiskyAsset_EpsteinZin_raw (line 447)
EV1=EV(aprimeIndex+N_a*((1:1:N_z)-1)); % (d,u,z), the lower aprime
Error in ValueFnIter_Case1_FHorz_EpsteinZin_RiskyAsset (line 170)
[VKron, PolicyKron]=ValueFnIter_FHorz_RiskyAsset_EpsteinZin_raw(n_d,n_a1,n_a2,n_z,n_u, N_j, d_grid, a1_grid,a2_grid, z_gridvals_J, u_grid, pi_z_J, pi_u, ReturnFn, aprimeFn, Parameters, DiscountFactorParamNames, ReturnFnParamNames, aprimeFnParamNames, vfoptions, sj, warmglow, ezc1,ezc2,ezc3,ezc4,ezc5,ezc6,ezc7,ezc8);
Error in ValueFnIter_Case1_FHorz_RiskyAsset (line 54)
[V,Policy]=ValueFnIter_Case1_FHorz_EpsteinZin_RiskyAsset(n_d,n_a1,n_a2,n_z,n_u,N_j,d_grid,a1_grid, a2_grid, z_gridvals_J, u_grid, pi_z_J, pi_u, aprimeFn, ReturnFn, Parameters, DiscountFactorParamNames, ReturnFnParamNames, aprimeFnParamNames, vfoptions);
Error in ValueFnIter_Case1_FHorz (line 560)
[V,Policy]=ValueFnIter_Case1_FHorz_RiskyAsset(n_d,n_a1,n_a2,n_z,vfoptions.n_u, N_j, d_grid, a1_grid, a2_grid, z_gridvals_J, vfoptions.u_grid, pi_z_J, vfoptions.pi_u, ReturnFn, vfoptions.aprimeFn, Parameters, DiscountFactorParamNames, ReturnFnParamNames, vfoptions);
Error in LifeCycleModel35 (line 173)
[V, Policy]=ValueFnIter_Case1_FHorz(n_d,n_a,n_z,N_j,d_grid, a_grid, z_grid, pi_z, ReturnFn, Params, DiscountFactorParamNames, , vfoptions);
I didn’t change any parameters’ value, not sure which part goes wrong.