lstsq/quickref.tex
author Puneeth Chaganti <punchagan@fossee.in>
Tue, 09 Nov 2010 17:15:49 +0530
changeset 428 0385c3157fd1
parent 330 efb8ddf26aff
permissions -rw-r--r--
Changes to progress.org.

Creating a matrix with all ones:\\
{\ex \lstinline|    o = ones_like(l)|}

Creating the A matrix:\\
{\ex \lstinline|    A = array(l, ones_like(l)).T|}

Computing least square:\\
{\ex \lstinline|    result = lstsq(A, tsq)|}

Obtaining the m and c values:\\
{\ex \lstinline|    m, c = result[0]|}

Computing the least square fit line:\\
{\ex \lstinline|    lst_line = m * l + c|}