LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The non-linear Lev-Mar fit sometimes returns error -20041 ("Analysis: The system of equations cannot be solved because the input matrix is singular." Who knows what this means?

I simply use y(x,a0,a1,a2), and give the derivatives and a good estimation.
0 Kudos
Message 1 of 4
(7,934 Views)
It means that the determinate of the matrix is zero or really close to zero because of the rounding of floating point numbers.

The algorithm works in an iterative fashion and it bases some of its calculations on the determinate. Matricies with determinates that start close to zero tend to zero with repeated iterations. This messes up the estimation of the parameters for the next iteration of the algorithm which is where you got the error. I believe the algorithm is written in LabVIEW so you can dig in the code to see exactly what is happening.
Message 2 of 4
(7,934 Views)
It could also mean that two or more parameters are strongly dependent. For example if your function would be:

y=a0*SQRT(x) + a1 + a2

you would get a singular matrix because any change in a1 can be completely compensated with an opposite change in a2, thus there is an infinite number of equally good solutions to the problem.

Also watch for functions that that have limited valid ranges, e.g. if you use logarithms make sure that calls with negative X cannot occur during the search.

Sometimes, you can re-parametrize the problem in a different form so it converges better.

What is your function?
Message 3 of 4
(7,934 Views)
Thanks, this is interesting! However, I noticed that my initial guess for the parameters was scaled wrongly. It works now.

My function is:

y=a0/sqrt((w-a1)^2*(w+a1)^2+4*a2^2*w^2);
(amplitude of a damped oscillator)

so it survives your criteria.

Your suggestion will certainly be helpful in the future!
0 Kudos
Message 4 of 4
(7,934 Views)