least_square_fit/quickref.tex
author Puneeth Chaganti <punchagan@fossee.in>
Wed, 01 Dec 2010 16:51:35 +0530
changeset 522 d33698326409
permissions -rw-r--r--
Renamed all LOs to match with their names in progress.org.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
522
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
Creating a matrix with all ones:\\
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
{\ex \lstinline|    o = ones_like(l)|}
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
Creating the A matrix:\\
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
{\ex \lstinline|    A = array(l, ones_like(l)).T|}
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
Computing least square:\\
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
{\ex \lstinline|    result = lstsq(A, tsq)|}
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
Obtaining the m and c values:\\
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
{\ex \lstinline|    m, c = result[0]|}
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
Computing the least square fit line:\\
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
{\ex \lstinline|    lst_line = m * l + c|}
d33698326409 Renamed all LOs to match with their names in progress.org.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15