EvalFnOnAgentDist_AutoCorrTransProbs_InfHorz() is a new command for computing autocorrelations and transition probabilites.
Say you have FnsToEvaluate.A and FnsToEvaluate.E. ‘A’ is assets and takes a large number of possible values (hundreds of values), while ‘E’ is employment and takes two possible values.
If you run EvalFnOnAgentDist_AutoCorrTransProbs_InfHorz() you will get the autocorrelations for both of these. By default the only thing computed is one-period autocorrelation; it also reports the Mean, Standard Deviation and AutoCovariance, because these anyway had to be calculated as intermediate steps to get the autcorrelations.
If you set simoptions.transprobs={'E'} then you will also get the (one-period) transition probabilities between the two values of E. This should be a cell containing the names of some of the FnsToEvaluate, e.g., simoptions.transprobs={'E','K'}.
By default the command produces all the one-period correlations (and transition probabilities). You can set, e.g., simoptions.timehorizons=[5,10] to get the 5-period and 10-period correlations (and transition probabilities), this can be any vector of integers.
By default the transition probabilities are reported across all possible values. Since in this example K takes hundreds of values the transition probabilities between each individual value of K is probably useless info. You can set, e.g., simoptions.transprobquantiles=5 to get the 5x5 matrix of transition probabilities between 5 quantiles (so the quintiles) of K. Note that using this option changes the interpretations from ‘transition probabilites’ to ‘rank transition probabilities’.
If you want, e.g., the transition probabilities for E as a 2x2, as well as the quantile transitions for K (a 5x5), then you have to run the command twice. Anything you set for simoptions.transprobquantiles is applied to everything in simoptions.transprobs.
[There used to be a function called RankTransitionProbabilities. I have deleted it because this new function has more options, the old was was also based on simulations so was less accurate.]
Currently this is only available for InfHorz models. It will eventually come for FHorz and TPaths, let me know if you need this and I will prioritize.
PS. There is a separate command called
EvalFnOnAgentDist_CrossSectionCovarCorr_InfHorz()
which does the covariances and correlations between all the pairs of the FnsToEvaluate.