Page 1 of 1

ERFC(x)

PostPosted: Wed Mar 25, 2015 5:02 pm
by hodabbbb
I have a problem with the steady state. I am using the ''normcdf'' function in my ss file.
it used to work well in my previous model.
I modified the model and now this is the error I get . Any idea what should I check ???
thnx in advance

Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using
Levenberg-Marquardt algorithm instead.
> In fsolve at 285
In AGKbgg_steadystate at 25
In evaluate_steady_state_file at 49
In evaluate_steady_state at 58
In steady_ at 54
In steady at 81
In AGKbgg at 630
In dynare at 180
Error using erfc
Input must be real and full.

Error in normcdf>localnormcdf (line 124)
p(todo) = 0.5 * erfc(-z ./ sqrt(2));

Error in normcdf (line 46)
[varargout{1:max(1,nargout)}] = localnormcdf(uflag,x,varargin{:});

Re: ERFC(x)

PostPosted: Fri Mar 27, 2015 8:06 am
by jpfeifer
I need to see the file, but my guess is that you are not correctly filtering out an exception that occurs earlier so that the input provided to the normcdf function is invalid.

Re: ERFC(x)

PostPosted: Fri Mar 27, 2015 10:31 am
by hodabbbb
Thanks for the comment.
please find attached the file
obviously the problem is from including the NORMCDF command in ''fun'' file

Re: ERFC(x)

PostPosted: Fri Mar 27, 2015 1:57 pm
by jpfeifer
You need to tell your solver that psi cannot be negative as you are taking the log of it. Use an exp() tranformation for this.

Re: ERFC(x)

PostPosted: Fri Mar 27, 2015 2:37 pm
by hodabbbb
Thanks a lot Mr. Pfeifer for taking your time.
Very much appreciated .