Error message of Life Cycle Model 35

Yes, you are absolutely correct! I checked again now and it is fine.

Hi Aledinola, I try to run the LifeCycleModel35.m but got the following error:LifeCycleModel35

ReturnFn =

包含以下值的 function_handle:

@(savings,riskyshare,hprime,h,a,z,w,sigma,agej,Jr,pension,kappa_j,sigma_h,f_htc,minhouse,rentprice,f_coll,houseservices)LifeCycleModel35_ReturnFn(savings,riskyshare,hprime,h,a,z,w,sigma,agej,Jr,pension,kappa_j,sigma_h,f_htc,minhouse,rentprice,f_coll,houseservices)

Test ValueFnIter

vfoptions =

包含以下字段的 struct:

    survivalprobability: 'sj'
             riskyasset: 1
      exoticpreferences: 'EpsteinZin'
      EZpositiveutility: 0
         EZriskaversion: 'phi'
               aprimeFn: @(savings,riskyshare,u,r)LifeCycleModel31_aprimeFn(savings,riskyshare,u,r)
                    n_u: 5
                 u_grid: [5×1 double]
                   pi_u: [5×1 double]
                verbose: 1
               parallel: 1
           returnmatrix: 0
              lowmemory: 0
               paroverz: 1
       divideandconquer: 0
        incrementaltype: 0
            polindorval: 1
             outputkron: 0
policy_forceintegertype: 0
                dynasty: 0
        experienceasset: 0
       experienceassetu: 0
          residualasset: 0

函数或变量 ‘z_gridvals_J’ 无法识别。

出错 ValueFnIter_Case1_FHorz (第 563 行)
[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);

出错 LifeCycleModel35 (第 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);

Caught “std::exception” Exception message is:
Invalid character code sequence detected.

I use the latest code,I don’t know hou to solve it.

1 Like

Roughly what does “函数或变量 ‘z_gridvals_J’ 无法识别。” translate as?

(and try ‘clear all’ before you run)

1 Like

Hi @Fenfang, I’ve run the code and it works on my computer.

1 Like