KronPolicyIndexes question

I have reached some new code now that my transition paths are converging to the L-infinity value.

I’m looking at KronPolicyIndexes_Case1_e but dealing with a case where my n_a includes an experience asset.

Note that to get to the point I’m at requires about 6 hours of compute, so it’s not exactly easy to change the conditions to follow an easier case to guide my journey for the case I’ve currently constructed. So I’m trying to find my answer in situ.

In the function ValueFnOnTransPath_Case1_FHorz we set the value of Policy_final :

            Policy_final=KronPolicyIndexes_FHorz_Case1_e(Policy_final,n_d,n_a,n_z,n_e,N_j, vfoptions);

That function has the comment:

% Input: Policy (l_d+l_a,n_a,n_z,n_e,N_j);
%
% Output: Policy=zeros(2,N_a,N_z,N_e,N_j); %first dim indexes the optimal choice for d and aprime rest of dimensions a,z 
%                       (N_a,N_z,N_e,N_j) if there is no d

Then we use Policy_final (which has dimension 2 in front):

    else % N_z>0
        if transpathoptions.fastOLG==0
            %% fastOLG=0, z, e
            VPath=zeros(N_a,N_z,N_e,N_j,T,'gpuArray');
            VPath(:,:,:,:,T)=V_final;
            PolicyPath=zeros(l_d+l_a+(vfoptions.gridinterplayer>0),N_a,N_z,N_e,N_j,T,'gpuArray'); %Periods 1 to T-1
            PolicyPath(:,:,:,:,:,T)=Policy_final;

But note that PolicyPath has dimension l_d+l_a+0 in this case. Now, with an experience asset I know that I need to work with l_aprime, not l_a, but I don’t see how to square the limited dimension of Policy_final with the larger dimension expected by PolicyPath.

What am I missing?

The problem can be reproduced by altering VFIWorkshop2025\Part5\WorkshopOLGTPath5.m to have additional asset grids (I created two extra column vectors of length 2 each, and modified the FnsToEvaluate to have a1prime,a2prime,a3prime,a1,a2,a3 instead of a,aprime).

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

Error in ValueFnOnTransPath_Case1_FHorz (line 238)
            PolicyPath(:,:,:,:,T)=Policy_final;
            ^^^^^^^^^^^^^^^^^^^^^
Error in WorkshopOLGTPath5 (line 301)
[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);
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
1 Like

Not an easy question. Will take me a day or three to respond.