# Warnings

I have a model that works well for some parameters. However, I frequently receive the following Warnings for some parameter changes:

-> Warning 1: “Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.” RCOND = 3.246774e-18.

It is a deterministic model with simul(periods=3000,maxit=30);

I receive the Warning above repeatedly. The RCOND continues to fall until 2.295887e-41. After this point, the warning changes to

-> Warning 2: “Warning: Matrix is singular to working precision.”

I can usually circumvent these warnings with different guesses for the steady state and changing the way in which the model equations are written. However, there is a parameter that I need to increase, but that I could not find a solution. I also want to write the equations of the model in a more robust way.

My questions are:

1. In which moment of the Dynare processing I receive the warnings above. Is it because Dynare cannot find the transition path, at the simul() command?

2. If I use “exp(x)” instead of “x” for the endogenous variables, will it smooth the equations in a way that I do not receive these Warnings?

3. If I linearize the more complex equations of the model, will it solve the problem?

Thank you!

1. Think about the exercise as finding the root of a nonlinear equation. In a Newton type solver you need to invert matrices. If the matrix is close to singular, the warning will pop up.
2. That can be, but is not a general property. In some cases using a log transformation will make the problem more well-behaved in others it makes it worse.
3. Yes, it will. Solving a linear system of equations is straightforward. But when doing so you incur an approximation error. This the cost of replacing a nonlinear problem with a linear one.

That’s great, thank you for your reply. I will implement the steps above, then. It seems that this is the right direction. Is RCOND the determinant of the matrix to be inverted?

[quote=“jpfeifer”]1. Think about the exercise as finding the root of a nonlinear equation. In a Newton type solver you need to invert matrices. If the matrix is close to singular, the warning will pop up.
2. That can be, but is not a general property. In some cases using a log transformation will make the problem more well-behaved in others it makes it worse.
3. Yes, it will. Solving a linear system of equations is straightforward. But when doing so you incur an approximation error. This the cost of replacing a nonlinear problem with a linear one.[/quote]

It’s the reciprocal condition number of the matrix to be inverted. See de.mathworks.com/help/matlab/ref/rcond.html?refresh=true

Thank you. It is a good explanation about the rcond function and the reciprocal conditional number in MatLab. Thanks