Errors running the JQ_RBC

Hi! I try to run JQ2012 in your github. however when i run the construct_data.m. the matlab reports:
Table 1
Error using nanmean
Too many input arguments.
Error in nanvar (line 63)
x0 = x - repmat(nanmean(x, dim),
tile);
Error in nanstd (line 28)
y = sqrt(nanvar(varargin{:}));
Error in construct_data (line 59)
fprintf(‘Estimated Standard deviation of
Equity: %4.3f\n’,
nanstd(equity_payout_filtered(timeline>start_date,:)*100));
how can i fix it? thanks a lot!

That function is part of the statistics toolbox. If you don’t have that function, you may be able to use https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/63358/versions/5/previews/nanmean.m/index.html?access_key=

1 Like