BSTA 670 – Statistical Computing

1 / 54

# BSTA 670 – Statistical Computing - PowerPoint PPT Presentation

BSTA 670 – Statistical Computing. Lecture 4, Extra Material: A Brief Introduction to LaTeX. What are TeX and LaTeX?. TeX (tau epsilon chi) is a computer language designed for typesetting, especially math.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' BSTA 670 – Statistical Computing' - chaim-day

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

BSTA 670 – Statistical Computing

Lecture 4, Extra Material:

A Brief Introduction to LaTeX

What are TeX and LaTeX?
• TeX (tau epsilon chi) is a computer language designed for typesetting, especially math.
• TeX was developed by Donald Knuth, a Mathematician/Computer Scientist, and others in late 1970s. He was dissatisfied with the typesetting from the publisher of his book “The Art of Computer Programming”. The development took about 10 years.
• TeX is an interpreter language, accepting commands based on markup language, written in ascii files.
What are TeX and LaTeX?
• TeX is portable, producing the same output on any computer.
• TeX is a very low level language directing where and what to place on a page. For example: move a specific distance to the left, right, up, or down ; change font; write a string of words, possibly containing math expressions, to a paragraph, etc.
What are TeX and LaTeX?
• TeX processes the input commands and produces a device independent file (dvi). This file then gets translated for the particular output device; screen, pdf, postscript (.ps).
• TeX requires a set of fonts. Donald Knuth also developed a font creation program called Metafont. All TeX installations have a basic set of fonts, other fonts can be generated or added, included commercially available fonts.
What are TeX and LaTeX?
• Macro commands can be defined to build the low level commands into high level command interfaces. For example, a macro to create a title page and to set up sections and subsections, etc.
• LaTeX is a variation of TeX that is easier to use than basic TeX. It is essentially a macro package that runs using TeX. The macros provide many useful features including the ability to create documents with sections and chapters, bibliography macros.
What are TeX and LaTeX?
• Essentially, LaTeX provides easier document style implementation, while also providing the ease of math typesetting.
• LaTeX also provides the ability to include graphics in documents, although in some implementations of LaTeX it is not easy to do so.
• LaTeX style files have been created to format common document features, such as paragraphing, margins, footnotes, headers, etc.
What are TeX and LaTeX?
• LaTeX style files include: letter, book, article, and report.
• A style file can be written for any use such as for formatting a Ph.D. thesis. The thesis formats for Penn are available at: http://www.math.upenn.edu/grad/thesisstyle.html
• TeX/LaTeX is available for Windows, Unix, Linux, and Mac OS. It can be obtained for free or commercially.
What are TeX and LaTeX?
• The Comprehensive TeX Archive Network (CTAN) is the most comprehensive site. http://www.ctan.org/
• Some info on LaTeX: http://www.latex-project.org/
• Free versions include: Windows (proTeXt, MiKTeX), Unix/Linux (TeX Live), Mac (gwTeX). There are many others.
• Commercial versions: Windows (PCTeX, TurboTeX), Mac (Textures).
What are TeX and LaTeX?
• TeX is not WYSIWYG (What you see is what you get).
• MS WORD and WordPerfect are WYSIWYG.
• In WYSIWYG text processors: what you see on the screen as you edit is the final product, formatting commands are not visible.
• LaTex and Tex are not word processors. Rather, they are text formatters. The formatting commands are visible (in a command file). The command file defines the structure of the final product and a compiler is needed to process the commands.

LaTeX

• LaTeX has two modes for the typed characters: Math Mode and Text Mode. The mode determines how LaTeX responds to the entered text.
• Default is text mode.

(\tilde{\bm\theta}_{(K)}-\bm\theta_K)$, where$\alpha\in[0,2]$, to find the next$\bm\theta_K$. \item Repeat until convergence. \end{itemize} \end{frame} Beamer_ex1.tex (2 of 3) Example of Slides in LaTeX using Beamer \begin{frame} \frametitle{A Model Problem: Widow\'s Pension Fund} \begin{itemize} \item We will demonstrate several of the optimization methods discussed on the widow\'s pension fund problem that we used earlier for root finding. \item Recall that this problem was to determine the parameters of a mixed model: the mixture parameter$\xi$and the Poisson intensity$\lambda$. \item The log likelihood for this problem was {\footnotesize \begin{eqnarray*} \ell (\xi , \lambda) & = & n_0 \log \left( \xi + (1-\xi) e^{-\lambda} \right) + (N-n_0) \left[\log(1-\xi)-\lambda\right] \\ & + & \sum_{i=1}^{\infty} i \,\ n_i \log\lambda \quad. \end{eqnarray*} } \end{itemize} \end{frame} \end{document} Beamer_ex1.tex (3 of 3) Example 2 of Slides in LaTeX using Beamer Berkeley Theme Slides \documentclass[pdf,t]{beamer} \usetheme{Berkeley} \usepackage{graphicx} \usepackage{bm} \setbeamertemplate{footline}[page number] \title{BSTA 670 (Fall 2008) - Statistical Computing \\ \vskip2ex Lecture 9\\ \vskip2ex Optimization II} \author{} \date{} \begin{document} \maketitle \begin{frame} \frametitle{Nelder-Mead Simplex Method} Beamer_ex1.tex (1 of 3) Other Presentation Themes for Beamer Without Navigation Bars: default, Bergen, Boadilla, Madrid, AnnArbor, CambridgeUS, Pittsburgh, Rochester With a Navigation Bar: Antibes, JuanLesPins, Montpellier With a table of contents: Berkeley, PaloAlto, Goettingen, Marburg, Hannover With Mini Frame Navigation: Berlin, Ilmenau, Dresden, Darmstadt, Frankfurt, Singapore, Szeged With Section and Subsection Table: Copenhagen, Luebeck, Malmoe, Warsaw Beamer_ex2.tex Output Example 3 of Slides in LaTeX using Beamer \documentclass[pdf,t]{beamer} \usepackage{graphicx} \usepackage{bm} \setbeamertemplate{footline}[page number] \setbeamercolor{normal text}{bg=yellow!25} \title{BSTA 670 (Fall 2008) - Statistical Computing\\ \vskip2ex Lecture 9\\ \vskip2ex \textcolor{brown}{Optimization II}} \author{} \date{} \begin{document} \maketitle Beamer_ex3.tex (1 of 3) Example 3 of Slides in LaTeX using Beamer \begin{frame} \frametitle{Nelder-Mead Simplex Method} \begin{itemize} \item The vector of \textcolor{green}{parameters in K dimensions} ,$\bm\theta$is to be minimized. A K-dimensional simplex, K-simplex, is defined byK+1 points in K-space (in 1D, a line segment is defined by 2points). \item Select a starting point for$\bm\theta$,$\bm\theta_0$. \item Compute the centroid (average of the points of the K-simplex ORcenter of mass of the K-simplex). \tilde{\bm\theta}_{(0)} = \frac{1}{K+1} \sum_{i=0}^{K} \bm\theta_{0i} \quad.\nonumber \item Do a 1-D search over$\bm\theta_K + \alpha

(\tilde{\bm\theta}_{(K)}-\bm\theta_K)$, where$\alpha\in[0,2]$, to find the next$\bm\theta_K$. \item \textcolor{blue}{Repeat until convergence}. \end{itemize} \end{frame} Beamer_ex3.tex (2 of 3) Example 3 of Slides in LaTeX using Beamer \begin{frame} \frametitle{A Model Problem: Widow\'s Pension Fund} \begin{itemize} \item We will demonstrate several of the optimization methods discussed on the widow\'s pension fund problem that we used earlier for root finding. \item Recall that this problem was to determine the parameters of a mixed model: the mixture parameter$\xi$and the Poisson intensity$\lambda\$.

\item The log likelihood for this problem was

\textcolor{red}{

{\footnotesize

\begin{eqnarray*}

\ell (\xi , \lambda)

& = & n_0 \log \left( \xi + (1-\xi) e^{-\lambda} \right)

+ (N-n_0) \left[\log(1-\xi)-\lambda\right] \\

& + & \sum_{i=1}^{\infty} i \,\ n_i \log\lambda \quad.

\end{eqnarray*}

}

}

\end{itemize}

\end{frame}

\end{document}

Beamer_ex3.tex (3 of 3)