\newif\iftalk
\talktrue

\documentclass[oneside]{book}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{bm}
\usepackage[noae]{Sweave}
\usepackage{lscape}
%\usepackage{tocbibind}
\usepackage{makeidx}
\usepackage{color}
\usepackage{hyperref}
\usepackage{longtable}

\let\proglang=\textsf
\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
  \hypersetup{%
    hyperindex = {true},
    colorlinks = {true},
    linktocpage = {true},
    plainpages = {false},
    linkcolor = {blue},
    citecolor = {blue},
    urlcolor = {red},
    pdfstartview = {Fit},
    pdfpagemode = {UseOutlines},
    pdfview = {XYZ null null null}
  }

\makeindex

 
% \VignetteIndexEntry{MCMCglmm CourseNotes}
%\newcommand{\begin{document}}{\chapter{}}
%\newcommand{\begin{master_document}}{\begin{document}}

\title{\Large MCMCglmm Course Notes}
\author{\Large Jarrod Hadfield (\texttt{j.hadfield@ed.ac.uk})}


\begin{document}


\maketitle

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

These are (incomplete) course notes about generalised linear mixed models (GLMM). Special emphasis is placed on understanding the underlying structure of a GLMM in order to show that slight modifications of this structure can produce a wide range of models.  These include familiar models like regression and ANOVA, but also models with intimidating names: animal models, threshold models, meta-analysis, MANCOVA and random regression \dots The primary aim of the course is to show that these models are only daunting by name. The secondary aim is to show how these models can be fitted in a Bayesian framework using Markov chain Monte Carlo (MCMC) methods in the R package \texttt{MCMCglmm}. For those not comfortable using Bayesian methods, many of the models outlined in the course notes can be fitted in \texttt{asreml} or \texttt{lmer} with little extra work. If you do use \texttt{MCMCglmm}, please, cite \citet{Hadfield.2010c}.\\

\tableofcontents


%\begin{table}[!h]
%\begin{center}
%\begin{tabular}{cc}
%\hline
%Name&symbol\\
%\hline
%fixed effect&$\beta$\\
%fixed effect design matrix&${\bf X}$\\
%random effect&$u$\\
%random effect design matrix&${\bf Z}$\\
%fixed or random effect (location effect)&$\theta$\\
%location effect design matrix&${\bf W}$\\
%relationship matrix&${\bf A}$\\
%parameter (co)variance matrix&${\bf V}$\\
%link function&$g$\\
%inverse link function&$g^{-1}$\\
%response variable&$y$\\
%latent variable&$l$\\
%density function&$f(.)$\\
%distribution function&$F(.)$\\
%\hline
%\end{tabular}
%\end{center}
%\caption{Notation used throughout the course notes\label{notation}}
%\end{table}

 
\include{Lecture1}
\include{Lecture2}
\include{Lecture3}
\include{Lecture4}
\include{Lecture5}
\include{Lecture6}
\include{Lecture7}
\include{Lecture8}
\include{Lecture9}

\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}

MCMCglmm relies heavily on sparse matrix operations facilitated by the CSparse library written by Tim Davis, whom I thank. Countless people have given me feedback, suggestions and bug reports. In particular, I'd like to thank Shinichi Nakagawa, Michael Morrissey \& Laura Ross, and also Loeske Kruuk who provided funding for this work through a Leverhulme trust award. More recently this work has been funded by NERC and the Royal Society.

\bibliographystyle{jss}
\bibliography{CourseNotes}


\printindex

\end{document}
