summaryrefslogtreecommitdiff
path: root/day1
diff options
context:
space:
mode:
authorPuneeth Chaganti2009-10-26 20:44:54 +0530
committerPuneeth Chaganti2009-10-26 20:44:54 +0530
commitf674f177e78cc8663a1a04526086dd68c5aef30b (patch)
tree04e0ca1564492b127f5b974e9b3bce4af8c93cae /day1
parentf3314051846c85c29b951671a2f9490936a97e8c (diff)
parent386bbad891f0e55d38441b9e898ac6f8ce1b2e20 (diff)
downloadworkshops-f674f177e78cc8663a1a04526086dd68c5aef30b.tar.gz
workshops-f674f177e78cc8663a1a04526086dd68c5aef30b.tar.bz2
workshops-f674f177e78cc8663a1a04526086dd68c5aef30b.zip
Merged with Mainline.
Diffstat (limited to 'day1')
-rw-r--r--day1/session3.tex224
1 files changed, 112 insertions, 112 deletions
diff --git a/day1/session3.tex b/day1/session3.tex
index 997fea3..780af01 100644
--- a/day1/session3.tex
+++ b/day1/session3.tex
@@ -126,118 +126,6 @@
%% % You might wish to add the option [pausesections]
%% \end{frame}
-\begin{frame}[fragile]
-\frametitle{Least Squares Fit}
-\vspace{-0.15in}
-\begin{figure}
-\includegraphics[width=4in]{data/least-sq-fit.png}
-\end{figure}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{Calculating $T^2$ Efficiently}
-\begin{lstlisting}
-In []: for t in T:
- ....: Tsq.append(t*t)
-\end{lstlisting}
-\begin{itemize}
-\item This is not very efficient
-\item We use arrays to make it efficient
-\end{itemize}
-\begin{lstlisting}
-In []: L = array(L)
-In []: T = array(T)
-In []: Tsq = T*T
-In []: plot(L, Tsq, 'o')
-\end{lstlisting}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{Arrays}
-\begin{itemize}
-\item \typ{T} and \typ{L} are now arrays
-\item arrays are very efficient and powerful
-\item Very easy to perform element-wise operations
-\item \typ{+, -, *, /, \%}
-\item More about arrays later
-\end{itemize}
-\end{frame}
-
-\begin{frame}
-\frametitle{Least Square Fit Curve}
-\begin{itemize}
-\item $T^2$ and $L$ have a linear relationship
-\item Hence, Least Square Fit Curve is a line
-\item we shall use the \typ{lstsq} function
-\end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{\typ{lstsq}}
-\begin{itemize}
-\item We need to fit a line through points for the equation $T^2 = m \cdot L+c$
-\item The equation can be re-written as $T^2 = A \cdot p$
-\item where A is
- $\begin{bmatrix}
- L_1 & 1 \\
- L_2 & 1 \\
- \vdots & \vdots\\
- L_N & 1 \\
- \end{bmatrix}$
- and p is
- $\begin{bmatrix}
- m\\
- c\\
- \end{bmatrix}$
-\item We need to find $p$ to plot the line
-\end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{Van der Monde Matrix}
-\begin{itemize}
-\item A is also called a Van der Monde matrix
-\item It can be generated using \typ{vander}
-\end{itemize}
-Van der Monde matrix of order M
-\begin{equation*}
- \begin{bmatrix}
- l_1^{M-1} & \ldots & l_1 & 1 \\
- l_2^{M-1} & \ldots &l_2 & 1 \\
- \vdots & \ldots & \vdots & \vdots\\
- l_N^{M-1} & \ldots & l_N & 1 \\
- \end{bmatrix}
-\end{equation*}
-\begin{lstlisting}
-In []: A = vander(L,2)
-\end{lstlisting}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{\typ{lstsq} \ldots}
-\begin{itemize}
-\item Now use the \typ{lstsq} function
-\item Along with a lot of things, it returns the least squares solution
-\end{itemize}
-\begin{lstlisting}
-In []: coef, res, r, s = lstsq(A,Tsq)
-\end{lstlisting}
-\end{frame}
-
-\begin{frame}[fragile]
-\frametitle{Least Square Fit Line \ldots}
-We get the points of the line from \typ{coef}
-\begin{lstlisting}
-In []: Tline = coef[0]*L + coef[1]
-\end{lstlisting}
-\begin{itemize}
-\item Now plot Tline vs. L, to get the Least squares fit line.
-\end{itemize}
-\begin{lstlisting}
-In []: plot(L, Tline)
-\end{lstlisting}
-\end{frame}
-
\begin{frame}
\frametitle{Statistical Analysis and Parsing}
Read the data supplied in \emph{sslc1.txt} and obtain the following statistics:
@@ -419,4 +307,116 @@ for k in data:
\end{itemize}
\end{frame}
+\begin{frame}[fragile]
+\frametitle{Least Squares Fit}
+\vspace{-0.15in}
+\begin{figure}
+\includegraphics[width=4in]{data/least-sq-fit.png}
+\end{figure}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Calculating $T^2$ Efficiently}
+\begin{lstlisting}
+In []: for t in T:
+ ....: Tsq.append(t*t)
+\end{lstlisting}
+\begin{itemize}
+\item This is not very efficient
+\item We use arrays to make it efficient
+\end{itemize}
+\begin{lstlisting}
+In []: L = array(L)
+In []: T = array(T)
+In []: Tsq = T*T
+In []: plot(L, Tsq, 'o')
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Arrays}
+\begin{itemize}
+\item \typ{T} and \typ{L} are now arrays
+\item arrays are very efficient and powerful
+\item Very easy to perform element-wise operations
+\item \typ{+, -, *, /, \%}
+\item More about arrays later
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Least Square Fit Curve}
+\begin{itemize}
+\item $T^2$ and $L$ have a linear relationship
+\item Hence, Least Square Fit Curve is a line
+\item we shall use the \typ{lstsq} function
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{\typ{lstsq}}
+\begin{itemize}
+\item We need to fit a line through points for the equation $T^2 = m \cdot L+c$
+\item The equation can be re-written as $T^2 = A \cdot p$
+\item where A is
+ $\begin{bmatrix}
+ L_1 & 1 \\
+ L_2 & 1 \\
+ \vdots & \vdots\\
+ L_N & 1 \\
+ \end{bmatrix}$
+ and p is
+ $\begin{bmatrix}
+ m\\
+ c\\
+ \end{bmatrix}$
+\item We need to find $p$ to plot the line
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Van der Monde Matrix}
+\begin{itemize}
+\item A is also called a Van der Monde matrix
+\item It can be generated using \typ{vander}
+\end{itemize}
+Van der Monde matrix of order M
+\begin{equation*}
+ \begin{bmatrix}
+ l_1^{M-1} & \ldots & l_1 & 1 \\
+ l_2^{M-1} & \ldots &l_2 & 1 \\
+ \vdots & \ldots & \vdots & \vdots\\
+ l_N^{M-1} & \ldots & l_N & 1 \\
+ \end{bmatrix}
+\end{equation*}
+\begin{lstlisting}
+In []: A = vander(L,2)
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{\typ{lstsq} \ldots}
+\begin{itemize}
+\item Now use the \typ{lstsq} function
+\item Along with a lot of things, it returns the least squares solution
+\end{itemize}
+\begin{lstlisting}
+In []: coef, res, r, s = lstsq(A,Tsq)
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Least Square Fit Line \ldots}
+We get the points of the line from \typ{coef}
+\begin{lstlisting}
+In []: Tline = coef[0]*L + coef[1]
+\end{lstlisting}
+\begin{itemize}
+\item Now plot Tline vs. L, to get the Least squares fit line.
+\end{itemize}
+\begin{lstlisting}
+In []: plot(L, Tline)
+\end{lstlisting}
+\end{frame}
+
\end{document}