# Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.960849e-21

**URL:** <https://forum.dynare.org/t/warning-matrix-is-close-to-singular-or-badly-scaled-results-may-be-inaccurate-rcond-2-960849e-21/19881>\
**Category:** Steady state\
**Created:** [26 February 2022 07:42 UTC](https://forum.dynare.org/t/warning-matrix-is-close-to-singular-or-badly-scaled-results-may-be-inaccurate-rcond-2-960849e-21/19881 "2022-02-26T07:42:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duan](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@Duan](https://forum.dynare.org/u/Duan)\
**Post date:** [26 February 2022 07:42 UTC](https://forum.dynare.org/t/warning-matrix-is-close-to-singular-or-badly-scaled-results-may-be-inaccurate-rcond-2-960849e-21/19881/1 "2022-02-26T07:42:47Z")

</div>

Hello! I try to solve a small scale DSGE model by dynare and have get the STEADY-STATE RESULTS. However, there is a warning when I run the code, and I can’t solve the problem. Looking forward to reply, thanks very much!

[code0226.mod](https://forum.dynare.org/uploads/short-url/1pdMlRTOGpgOJ3od5n1yHEuDDjh.mod) (2.2 KB)

````auto
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file ...
Found 16 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 1).
Processing outputs ...
done
Preprocessing completed.

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.960849e-21. 
> In trust_region>dogleg (line 198)
  In trust_region (line 115)
  In dynare_solve (line 255)
  In evaluate_steady_state (line 221)
  In steady_ (line 55)
  In steady (line 80)
  In code1A.driver (line 362)
  In dynare (line 293)
 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.960849e-21. 
> In trust_region>dogleg (line 198)
  In trust_region (line 115)
  In dynare_solve (line 255)
  In evaluate_steady_state (line 221)
  In steady_ (line 55)
  In steady (line 80)
  In code1A.driver (line 362)
  In dynare (line 293)
 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.960849e-21. 
> In trust_region>dogleg (line 198)
  In trust_region (line 115)
  In dynare_solve (line 255)
  In evaluate_steady_state (line 221)
  In steady_ (line 55)
  In steady (line 80)
  In code1A.driver (line 362)
  In dynare (line 293)
 

STEADY-STATE RESULTS:

c 1.57129
la 0.881485
i 0.328441
w 1.36172
r_k 0.0450013
k 13.1376
Q -0.636419
a 1
mc 0.833343
p_star 1.0003
x1 5.31307
x2 4.42756
s 1
pi 1.0001
y 2.14983
g 0.2501
MODEL_DIAGNOSTICS: No obvious problems with this mod-file were detected.

EIGENVALUES:
         Modulus Real Imaginary

       1.589e-07 1.589e-07 0
          0.7531 0.7531 0
             0.8 0.8 0
          0.9529 0.9529 0
           1.079 1.079 0
           1.318 1.318 0
           1.346 1.346 0
       4.771e+06 4.771e+06 0
       1.553e+19 1.553e+19 0
             Inf Inf 0
             Inf Inf 0
             Inf Inf 0

There are 8 eigenvalue(s) larger than 1 in modulus 
for 8 forward-looking variable(s)

The rank condition is verified.

Residuals of the static equations:

Equation number 1 : 0 : 1
Equation number 2 : 0 : k
Equation number 3 : 0 : 3
Equation number 4 : 0 : 4
Equation number 5 : 0 : mc
Equation number 6 : 0 : 6
Equation number 7 : 0 : la
Equation number 8 : 0 : 8
Equation number 9 : -2.0892e-06 : x1
Equation number 10 : -2.4644e-06 : x2
Equation number 11 : -4.0538e-07 : 11
Equation number 12 : -5.7472e-07 : s
Equation number 13 : 0 : y
Equation number 14 : 0 : g
Equation number 15 : 0 : 15
Equation number 16 : 0 : 16

MODEL SUMMARY

  Number of variables: 16
  Number of stochastic shocks: 1
  Number of state variables: 4
  Number of jumpers: 8
  Number of static variables: 5

MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS
Variables e_a
e_a 1.000000

POLICY AND TRANSITION FUNCTIONS
                                   c la i w r_k k Q a mc p_star x1 x2 s pi y g
Constant 1.571293 0.881485 0.328441 1.361722 0.045001 13.137649 -0.636419 1.000000 0.833343 1.000297 5.313070 4.427559 1.000000 1.000099 2.149834 0.250100
k(-1) 0.049293 -0.002396 -0.005034 0.035427 -0.002377 0.969966 0.025839 0 0 0 -0.056598 -0.047165 0 0 0.050086 0.005827
a(-1) 1.270018 -0.003183 0.245183 1.090944 0.035890 0.245183 0.063678 0.800000 -0.000035 0 0.513268 0.427723 0 0 1.714666 0.199465
s(-1) -1040.680710 -1631.581208 -84.878676 -5867.210944 -277.190689 -84.878676 -4.956005 0 -4099.616122 -1264.930889 32726.818656 27272.348880 0 -420.725697 -2666.080953 -1540.521567
i(-1) -0.544280 0.132786 0.735996 -0.067584 0.004545 0.735996 0.042974 0 0.000066 0 1.280002 1.066669 0 0 0.216978 0.025262
e_a 1.587523 -0.003979 0.306479 1.363679 0.044863 0.306479 0.079598 1.000000 -0.000043 0 0.641585 0.534654 0 0 2.143333 0.249331

THEORETICAL MOMENTS
VARIABLE MEAN STD. DEV. VARIANCE
c 1.5713 2.5043 6.2716
la 0.8815 0.1707 0.0291
i 0.3284 1.3982 1.9549
w 1.3617 2.4374 5.9408
r_k 0.0450 0.0798 0.0064
k 13.1376 17.9615 322.6170
Q -0.6364 0.5449 0.2970
a 1.0000 1.6667 2.7778
mc 0.8333 0.0001 0.0000
p_star 1.0003 0.0000 0.0000
x1 5.3131 2.4830 6.1651
x2 4.4276 2.0691 4.2813
s 1.0000 0.0000 0.0000
pi 1.0001 0.0000 0.0000
y 2.1498 4.1084 16.8788
g 0.2501 0.4779 0.2284

MATRIX OF CORRELATIONS
Variables c la i w r_k k Q a mc x1 x2 y g
c 1.0000 0.4261 0.7073 0.9812 0.6516 0.5423 0.7128 0.9349 -0.1336 0.5879 0.5879 0.9622 0.9622
la 0.4261 1.0000 0.9409 0.5925 0.6102 0.1959 0.3702 0.6406 0.6229 0.9246 0.9246 0.6563 0.6563
i 0.7073 0.9409 1.0000 0.8304 0.7208 0.3561 0.5561 0.8506 0.4366 0.9426 0.9426 0.8731 0.8731
w 0.9812 0.5925 0.8304 1.0000 0.7102 0.5246 0.7136 0.9690 0.0138 0.7205 0.7205 0.9967 0.9967
r_k 0.6516 0.6102 0.7208 0.7102 1.0000 -0.2179 0.0287 0.8622 -0.2397 0.8660 0.8660 0.7271 0.7270
k 0.5423 0.1959 0.3561 0.5246 -0.2179 1.0000 0.9691 0.3010 0.4408 0.0255 0.0255 0.5112 0.5112
Q 0.7128 0.3702 0.5561 0.7136 0.0287 0.9691 1.0000 0.5235 0.4108 0.2541 0.2541 0.7059 0.7059
a 0.9349 0.6406 0.8506 0.9690 0.8622 0.3010 0.5235 1.0000 -0.0743 0.8225 0.8225 0.9725 0.9725
mc -0.1336 0.6229 0.4366 0.0138 -0.2397 0.4408 0.4108 -0.0743 1.0000 0.2777 0.2777 0.0760 0.0761
x1 0.5879 0.9246 0.9426 0.7205 0.8660 0.0255 0.2541 0.8225 0.2777 1.0000 1.0000 0.7685 0.7686
x2 0.5879 0.9246 0.9426 0.7205 0.8660 0.0255 0.2541 0.8225 0.2777 1.0000 1.0000 0.7685 0.7686
y 0.9622 0.6563 0.8731 0.9967 0.7271 0.5112 0.7059 0.9725 0.0760 0.7685 0.7685 1.0000 1.0000
g 0.9622 0.6563 0.8731 0.9967 0.7270 0.5112 0.7059 0.9725 0.0761 0.7686 0.7686 1.0000 1.0000

COEFFICIENTS OF AUTOCORRELATION
Order 1 2 3 4 5
c 0.7669 0.6094 0.5041 0.4346 0.3892
la 0.9540 0.8619 0.7474 0.6257 0.5065
i 0.9616 0.8793 0.7752 0.6637 0.5536
w 0.8276 0.6959 0.5947 0.5162 0.4547
r_k 0.8201 0.6608 0.5223 0.4036 0.3031
k 0.9972 0.9891 0.9761 0.9590 0.9383
Q 0.9886 0.9745 0.9574 0.9376 0.9153
a 0.8000 0.6400 0.5120 0.4096 0.3277
mc 0.6987 0.4805 0.3224 0.2085 0.1269
x1 0.9523 0.8589 0.7434 0.6211 0.5014
x2 0.9523 0.8589 0.7434 0.6211 0.5014
y 0.8529 0.7315 0.6313 0.5483 0.4794
g 0.8529 0.7316 0.6313 0.5483 0.4794
Total computing time : 0h00m02s
Note: warning(s) encountered in MATLAB/Octave code
```
````

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [27 February 2022 08:33 UTC](https://forum.dynare.org/t/warning-matrix-is-close-to-singular-or-badly-scaled-results-may-be-inaccurate-rcond-2-960849e-21/19881/2 "2022-02-27T08:33:19Z")

</div>

In Dynare 5.0 I don’t get a warning. It derives from steady state finding. As long as the steady state is found, you can ignore such warnings. That being said, your initial values that are supposed to be steady state values shows residuals in

```auto
Equation number 9 : 0.78162 : x1
Equation number 10 : 0.65135 : x2

```

Check whether that is intended.

---

<div class="post-metadata">

**Author:** ![Duan](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@Duan](https://forum.dynare.org/u/Duan)\
**Post date:** [27 February 2022 08:46 UTC](https://forum.dynare.org/t/warning-matrix-is-close-to-singular-or-badly-scaled-results-may-be-inaccurate-rcond-2-960849e-21/19881/3 "2022-02-27T08:46:41Z")

</div>

Thank you very much!
