Error in simoptions.whichstats

Hi Robert,

When I used simoptions.whichstats=[1,0,0,0,0,0,0] (it worked before), I got the following error messages:

Error in StatsFromWeightedGrid (line 84)
if SortedValues(1)==SortedValues(end) || all(CumSumSortedWeights==1)

Error in LifeCycleProfiles_FHorz_Case1 (line 456)
tempStats=StatsFromWeightedGrid(Values,StationaryDistVec_kk,simoptions.npoints,simoptions.nquantiles,simoptions.tolerance,0,simoptions.whichstats);

Also glad the forum is back.

2 Likes

Fixed. Thanks for spotting.

(I had done a check to speed things up without realizing it errored with simoptions.whichstats=[1,0,0,0,0,0,0], just pushed a trivial fix)

2 Likes

Thx. I also wonder will the feature of transition path with multiple endogenous states be added in the near future?

1 Like

What kind of model exactly are you wondering about a transition path in?

1 Like

If I understand correctly, a nice example could be the model of Chen (Red 2010) with assets and housing as a second endogenous state. We developed the steady state version some time ago.

I’m considering a model with savings and housing. Like @aledinola mentioned, Chen(2010) can be an example (i.e. generating transition path if downpayment ratio decreases). vfiToolkit will report an error if the model has more than one state variable.

1 Like

I think a transition with two endogenous state variables (a1 and a2) should in principle work because the toolkit is coded in a general way. It will probably be quite slow since it is not optimized with speed-up tricks such as divide and conquer (I think), but it should at least run.
Have you tried it and, if so, did you get an error?

Background info: I tried while ago an infinite horizon model with occupational choice, with two endogenous states. a1=assets, a2=dummy 0-1 for {worker,entrepreneur}. As far as I remember, it was ok.

1 Like

I didn’t use divide and conquer, but I still got the error. Is there any chance you could share your codes with me (if you still keep them)? I may check if there are some typo in my codes.

1 Like

I will look and see if I find them (it was an older version, hope I did not overwrite it). However, bear in mind that my model is infinite horizon, while you are interested in finite horizon.

1 Like