help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsqlin() error message


From: GoSim
Subject: Re: lsqlin() error message
Date: Sun, 7 Jul 2019 14:01:19 -0500 (CDT)

C=[1 2 3; 2 4 6;4 5 6;7 9 8; 5 6 4; 2 5 8]
D=[4   8 5 9 5 7 ]'

lsqlin(C,D,[],[])
ans =

  -1.04718
   1.44205
   0.41128


The two first rows are lin. dependent. The algorithm seems to be sensitive
to lin. dependency when there are few rows. I have noticed this in my
algorithms with this command. 

C=[1 2 3; 2 4 6;4 5 6;7 9 8; ]
D=[4   8 5 9  ]'
lsqlin(C,D,[],[])
ans =

  -3.11111
   3.22222
   0.22222


C=[1 2 3; 2 4 6;4 5 6; ]
D=[4   8 5   ]'
lsqlin(C,D,[],[])
error: __qp__: operator *: nonconformant arguments (op1 is 2x2, op2 is 3x1)
error: called from
    quadprog at line 351 column 32
    lsqlin at line 123 column 19


Here I want lsqlin to give me 3 coeffs, when it has less than 3 lin. dep.
rows it is sensitive to lin. dependency. Maybe using lsqlin with too few
rows is a stupid thing and I am just using it incorrectly.
Least squares with less lin. independent rows than sought parameters doesn't
have a solution, but it deosn't give an error if the lin. dependent rows are
removed....I don't know. I leave it to the maintainer.

The [NaN NaN 3]' result in your bugreport I can only guess about. It says it
is using the mldivide algorithm, maybe something with inverting a matrix
that doesn't work well...?



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]