After calculating the following values:
from j=1 to
n
where
is one of the
column vectors calculated by (P*v’)’ for each dimension, we can
implement speed-up algorithms in the same way as before.
opt=0 nothing added
opt=1 error bounds
opt=2 policy iterations by direct inversion
opt=3 error bounds and policy iteration
opt=4 modified policy iteration
opt=5 error bounds and modified policy iteration
We also implement collocation method but it takes up lots of memory.
We have to keep (dim x n) x sorder in addition. When sorder is high such as sorder=9,
We can only some hundreds of n in GAUSS Light.
We then generate state numbers from transition matrix as sind from 1 to dim.
We finally simulate the movement of capital on the grid by updating:
ind[t+1]=indM[ind[t],sind[t+1]];
and
ks[t+1]=k[ind[t+1]];
starting from ks[startn] where ind[1]=startn.