Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

lsq

The method of least squares is a standard approach to the approximate solution of overdetermined systems, i.e., sets of equations in which there are more equations than unknowns.

References

lsq(M)

In statistics and mathematics, linear least squares is an approach to fitting a mathematical or statistical model to data in cases where the idealized value provided by the model for any data point is expressed linearly in terms of the unknown parameters of the model.

Argument M

Matrix

Returns 1. entry

Arguments

Example

lsq([1,6;2,5;3,7;4,10])

Computes the slope and the offset for a linear function a * x + b that should fit the points (1, 6), (2, 5), (3, 7) and (4, 10). The result is a = 1.4 and b = 3.5.

lsq(X,Y)

In statistics and mathematics, linear least squares is an approach to fitting a mathematical or statistical model to data in cases where the idealized value provided by the model for any data point is expressed linearly in terms of the unknown parameters of the model.

Argument X

Matrix

Argument Y

Matrix

Returns 1. entry

Arguments

Example

lsq([1, 2, 3, 4], [6, 5, 7, 10])

Computes the slope and the offset for a linear function a * x + b that should fit the points (1, 6), (2, 5), (3, 7) and (4, 10). The result is a = 1.4 and b = 3.5.

Clone this wiki locally