c++ - Alglib: solving A * x = b in a least squares sense -
i have complicated algorithm requires fitting of quadric set of points. quadric given parametrization (u, v, f(u,v))
, f(u,v) = au^2+bv^2+cuv+du+ev+f
. coefficients of f(u,v)
function need found since have set of 6 constraints function should obey. problem set of constraints, although yielding problem a*x = b
, not behaved guarantee unique solution.
thus, cut short, i'd use alglib's facilities somehow either determine a
's pseudoinverse or directly find best fit x
vector.
apart computing svd, there more direct algorithm implemented in library can solve system in least squares sense (again, apart svd or using naive inv(transpose(a)*a)*transpose(a)*b
formula general least squares problems not square matrix?
found answer through careful documentation browsing:
rmatrixsolvels( a, norows, nocols, b, singularvaluethreshold, info, solverreport, x)
the documentation states the singular value threshold clamping threshold sets singular value svd decomposition s matrix 0
if value below it. should scalar between 0 , 1.
hopefully, else too.
Comments
Post a Comment