Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Nov 23, 2024
1 parent 546151c commit 9a9fb5c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 19 deletions.
Binary file modified slides/BDA_lecture_11a.pdf
Binary file not shown.
55 changes: 46 additions & 9 deletions slides/BDA_lecture_11a.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,38 @@
% \usepackage{amsbsy}
% \usepackage{eucal}
\usepackage{rotating}
\usepackage{listings}
\usepackage{lstbayes}
\usepackage[all,poly,ps,color]{xy}
\usepackage{eurosym}

% minted
\usepackage{minted}
\setminted{highlightcolor=yellow!25}
\newmintinline{r}{}
% The following is adjusted from
% https://tex.stackexchange.com/questions/548592/changing-all-colors-to-black-white-using-minted-sty
\makeatletter
\newcommand{\minted@style@bw}{%
\renewcommand\fcolorbox[3][]{##3}%
\renewcommand\textcolor[3][]{##3}%
\color{gray}
}
% define new minted option "gray"
\minted@def@opt@switch{gray}
\fvset{formatcom*={%
\ifthenelse{\equal{\minted@get@opt{gray}{true}}{true}}
{\minted@style@bw}{}%
}}
\makeatother
% The following is ajusted from
% https://tex.stackexchange.com/questions/74459/remove-space-before-colorbox
\newcommand{\reducedstrut}{\vrule width 0pt height .9\ht\strutbox depth .9\dp\strutbox\relax}
\newcommand{\highlight}[1]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\colorbox{yellow!30}{\reducedstrut\detokenize{#1}\/}%
\endgroup
}

\usepackage{natbib}
\bibliographystyle{apalike}

Expand All @@ -33,7 +60,7 @@
\setbeamertemplate{headline}[default]{}
\setbeamertemplate{footline}[split]
% \setbeamertemplate{headline}[text line]{\insertsection}
% \setbeamertemplate{footline}[frame number]
\setbeamertemplate{footline}[frame number]
}

\pdfinfo{
Expand Down Expand Up @@ -815,7 +842,7 @@

\begin{itemize}
\item \texttt{projpred} supports also hierarchical models in \texttt{brms}\\
{\footnotesize Catalina, Bürkner, and Vehtari (2022). Projection predictive inference for generalized linear and additive multilevel models. \textit{Proceedings of the 24th International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR} 151:4446–4461. \url{https://proceedings.mlr.press/v151/catalina22a.html}}
{\small Catalina, Bürkner, and Vehtari (2022). Projection predictive inference for generalized linear and additive multilevel models. \textit{Proceedings of the 24th International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR} 151:4446–4461. \url{https://proceedings.mlr.press/v151/catalina22a.html}}
\end{itemize}

\end{frame}
Expand Down Expand Up @@ -867,18 +894,27 @@

% \end{frame}

\begin{frame}{Intro paper and brms and rstanarm + projpred examples}
\begin{frame}[fragile]{Intro paper and brms and rstanarm + projpred examples}

\begin{itemize}
\item {\footnotesize McLatchie, Rögnvaldsson, Weber, and Aki Vehtari (2023). Robust and efficient projection predictive inference. \url{https://arxiv.org/abs/2306.15581}}
\item {\small McLatchie, Rögnvaldsson, Weber, and Aki Vehtari (2024). Advances in projection predictive inference. \emph{Statistical Science}. \url{https://arxiv.org/abs/2306.15581}}
\item \url{https://mc-stan.org/projpred/articles/projpred.html}
\item \url{https://users.aalto.fi/~ave/casestudies.html}
\item Fast and often sufficient if $n\gg p$\\
{\footnotesize \texttt{varsel <- cv\_varsel(fit, method='forward', cv\_method='loo', validate\_search=FALSE)}}
\begin{minted}[fontsize=\footnotesize]{r}
varsel <- cv_varsel(fit, method='forward', cv_method='loo',
validate_search=FALSE)
\end{minted}
\item Slower but needed if not $n\gg p$\\
{\footnotesize \texttt{varsel <- cv\_varsel(fit, method='forward', cv\_method='kfold, K=10, validate\_search=TRUE)}}
\begin{minted}[fontsize=\footnotesize]{r}
varsel <- cv_varsel(fit, method='forward', cv_method='kfold', K=10,
validate_search=TRUE)
\end{minted}
\item If $p$ is very big\\
{\footnotesize \texttt{varsel <- cv\_varsel(fit, method='L1, cv\_method='kfold, K=5, validate\_search=TRUE)}}
\begin{minted}[fontsize=\footnotesize]{r}
varsel <- cv_varsel(fit, method='L1', cv_method='kfold', K=5,
validate_search=TRUE)
\end{minted}
\end{itemize}

\end{frame}
Expand Down Expand Up @@ -906,4 +942,5 @@
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-command-extra-options: "-shell-escape"
%%% End:
Binary file modified slides/slides_extra.pdf
Binary file not shown.
48 changes: 38 additions & 10 deletions slides/slides_extra.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@
\usepackage{eurosym}
\usepackage{microtype}

% minted
\usepackage{minted}
\setminted{highlightcolor=yellow!25}
\newmintinline{r}{}
% The following is adjusted from
% https://tex.stackexchange.com/questions/548592/changing-all-colors-to-black-white-using-minted-sty
\makeatletter
\newcommand{\minted@style@bw}{%
\renewcommand\fcolorbox[3][]{##3}%
\renewcommand\textcolor[3][]{##3}%
\color{gray}
}
% define new minted option "gray"
\minted@def@opt@switch{gray}
\fvset{formatcom*={%
\ifthenelse{\equal{\minted@get@opt{gray}{true}}{true}}
{\minted@style@bw}{}%
}}
\makeatother
% The following is ajusted from
% https://tex.stackexchange.com/questions/74459/remove-space-before-colorbox
\newcommand{\reducedstrut}{\vrule width 0pt height .9\ht\strutbox depth .9\dp\strutbox\relax}
\newcommand{\highlight}[1]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\colorbox{yellow!30}{\reducedstrut\detokenize{#1}\/}%
\endgroup
}

\usepackage{natbib}
\bibliographystyle{apalike}

Expand Down Expand Up @@ -325,9 +354,9 @@
\end{itemize}
\uncover<3->{\hspace{-1cm}\small
\begin{tabular}[t]{ll}
{\tt y $\sim$ 1 + x} & fixed / population effect; pooled model\\
{\tt y $\sim$ 1 + (0 + x | g) } & random / group effects \\
{\tt y $\sim$ 1 + x + (1 + x | g) } & mixed effects; hierarchical model
\rinline/y ~ 1 + x/ & fixed / population effect; pooled model\\
\rinline/y ~ 1 + (0 + x | g)/ & random / group effects \\
\rinline/y ~ 1 + x + (1 + x | g)/ & mixed effects; hierarchical model
\end{tabular}
}
\vspace{1\baselineskip}
Expand Down Expand Up @@ -359,9 +388,7 @@
predictor
\end{itemize}
\uncover<8->{\hspace{-1cm}\small
\begin{tabular}[t]{ll}
{\tt deaths $\sim$ dosage,} & {\tt family = binomial}\\
\end{tabular}
\rinline/deaths ~ dosage, family = binomial/ \\
}
\item<9-> Hierarchical GLM natural extension
\item<10-> 16.3 Weakly informative priors section is excellent
Expand Down Expand Up @@ -511,9 +538,9 @@
variables can be slow (Laplace integration over the latents coming)
\item<2-> \texttt{brms}:
\begin{itemize}
\item covariance matrix based computation:\\ {\tt y $\sim$ gp(x)}
\item covariance matrix based computation:\\ \rinline/y ~ gp(x)/
\item Hilbert space basis function approximation:\\
{\tt y $\sim$ gp(x, k=20)}
\rinline/y ~ gp(x, k=20)/
\end{itemize}
\end{itemize}

Expand Down Expand Up @@ -549,6 +576,7 @@
\end{document}

%%% Local Variables:
%%% TeX-PDF-mode: t
%%% mode: latex
%%% TeX-master: t
%%% End:
%%% TeX-command-extra-options: "-shell-escape"
%%% End:

0 comments on commit 9a9fb5c

Please sign in to comment.