Question: Solving "least square" with maple - how?

hi,

tried to solve a least square problem with maple.

i've n=3 measured data

xi = 1, 4, 6

yi = 2, 4, 8

and have to create a optimised function of the type y=f(x) = px + q

i gave maple this input:

y := <2,4,8>;

x := <1,4,6>;

with(Student[LinearAlgebra]):

LeastSquares(x,y);

the error-message i receive is
error, (in Student:-LinearAlgebra:-LeastSquares) invalid input: LinearAlgebra:-LeastSquares expects its 1st argument, A, to be of type {Matrix, list, set(equation)} but received Vector(3, {(1) = 1, (2) = 4, (3) = 6})

can someone tell me what i ve to do to make maple solve this problem?

 

Please Wait...