% Created 2011-06-08 Wed 10:17
\documentclass[presentation]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\usepackage[english]{babel} \usepackage{ae,aecompl}
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
\usepackage{listings}
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\providecommand{\alert}[1]{\textbf{#1}}

\title{}
\author{FOSSEE}
\date{}

\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
\begin{document}











\begin{frame}

\begin{center}
\vspace{12pt}
\textcolor{blue}{\huge Least Square Fit}
\end{center}
\vspace{18pt}
\begin{center}
\vspace{10pt}
\includegraphics[scale=0.95]{../images/fossee-logo.png}\\
\vspace{5pt}
\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ 
\scriptsize Funded by National Mission on Education through ICT\\
\scriptsize  MHRD,Govt. of India\\
\includegraphics[scale=0.30]{../images/iitb-logo.png}\\
\end{center}
\end{frame}
\begin{frame}
\frametitle{Objectives}
\label{sec-2}

  At the end of this tutorial, you will be able to,


\begin{itemize}
\item Generate the least square fit line for a
   given set of points.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Pre-requisite}
\label{sec-3}

  Spoken tutorial on -

\begin{itemize}
\item Using plot interactively.
\item Loading data from files.
\item Getting started with arrays.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Exercise 1}
\label{sec-4}


\begin{itemize}
\item Generate a least square fit line for l v/s t$^2$ using the data in the file
    `pendulum.txt'.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Summary}
\label{sec-5}

  In this tutorial,we have learnt to,


\begin{itemize}
\item Generate a least square fit using matrices.
\item Use the function ``lstsq()'' to generate a least square fit line.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Evaluation}
\label{sec-6}


\begin{enumerate}
\item What does ones$\_{\mathrm{like}}$([1, 2, 3]) produce
\begin{itemize}
\item array([1, 1, 1])
\item ~[1, 1, 1]~
\item ~[1.0, 1.0, 1.0]~
\item Error
\end{itemize}
\vspace{10pt}
\item The plot of ``u'' vs ``v'' is a bunch of scattered points that show a
     linear trend. How do you find the least square fit line of ``u'' v/s ``v''.
\end{enumerate}
\end{frame}
\begin{frame}
\frametitle{Solutions}
\label{sec-7}


\begin{enumerate}
\item array([1, 1, 1])
\vspace{15pt}
\item A = array(u, ones\_like(u)).T\\
     result = lstsq(A, v)\\
     m, c = result[ 0 ]\\
     lst\_line = m * u + c
\end{enumerate}
\end{frame}
\begin{frame}

  \begin{block}{}
  \begin{center}
  \textcolor{blue}{\Large THANK YOU!} 
  \end{center}
  \end{block}
\begin{block}{}
  \begin{center}
    For more Information, visit our website\\
    \url{http://fossee.in/}
  \end{center}  
  \end{block}
\end{frame}

\end{document}