Dear Robert,
Thanks for your prompt reply!
For point 2, I have
1 1
1 1 after running ones(2,2,‘gpuArray’) on my laptop. Further I switched to a desktop and it works. Though I still dont know why…
For point 3, if I use parallel CPU (not GPU) and vfoptions.lowmemory=1, I have the following:
WARNING: ValueFnIter_Case1_LowMem_NoD_Par1_raw is out of date
Undefined function or variable ‘n_d’.
Error in ValueFnIter_Case1_LowMem_NoD_Par1_raw (line 18)
d_gridvals=CreateGridvals(n_d,d_grid,1);
Error in ValueFnIter_Case1 (line 267)
[VKron,Policy]=ValueFnIter_Case1_LowMem_NoD_Par1_raw(V0Kron, n_a, n_z, a_grid, z_grid, pi_z,
DiscountFactorParamsVec, ReturnFn, ReturnFnParamsVec, vfoptions.howards, vfoptions.maxhowards,
vfoptions.tolerance, vfoptions.verbose);
For your last comment, as the model requires several facts such as occasionally binding, (though there are some toolkits that solve it, such as occbin with dynare), I would like to implement it with global solutions, thus your toolkit seems necessary.
- Following that, I notice on your original paper you mention lowmemory option being 2, I do find it in your toolkit. However, is the only difference between it and option being 1 is: 2 is slower, but allows larger size?
- When I got ‘Policy’, I now have some index being 1.000, some being 1. This causes problems when later doing ‘TimeSeriesIndexes=SimTimeSeriesIndexes_Case1(Policy,n_d,n_a,n_z,pi_z,simoptions);’ with two endogenous states, it is fine. however, with three states, it got stuck and saying ‘the index has to be positive integer or logic value’. I then use 'policy=round(Policy);'and it works. I wonder if this way is reasonable?
Additionally, I check the toolkit with my originally written code, it seems that, for a low size grid, the policy functions are the same, but the value functions are different, i wonder if you have any idea why so?
Sorry for so many questions! thanks very much!