diff options
-rw-r--r-- | lstsq/quickref.tex | 20 | ||||
-rw-r--r-- | lstsq/script.rst | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lstsq/quickref.tex b/lstsq/quickref.tex index a0212b3..e057739 100644 --- a/lstsq/quickref.tex +++ b/lstsq/quickref.tex @@ -1,11 +1,15 @@ -Creating a tuple:\\ -{\ex \lstinline| t = (1, "hello", 2.5)|} +Creating a matrix with all ones:\\ +{\ex \lstinline| o = ones_like(l)|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Creating the A matrix:\\ +{\ex \lstinline| A = array(l, ones_like(l)).T|} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} +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|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} diff --git a/lstsq/script.rst b/lstsq/script.rst index 59f1809..a53524e 100644 --- a/lstsq/script.rst +++ b/lstsq/script.rst @@ -1,11 +1,6 @@ .. Objectives .. ---------- -.. A - Students and teachers from Science and engineering backgrounds - B - - C - - D - - .. Plotting a least square fit line .. Prerequisites @@ -13,6 +8,7 @@ .. 1. Basic Plotting .. 2. Arrays +.. 3. Loading data from files .. Author : Nishanth Amuluru Internal Reviewer : |