% !TEX root = ../../main.tex
\chapter{Event Cutflow}
\label{ch:eventCutflow}

The event selection for this analysis is detailed in~\Ch{\ref{ch:event_selection}}. The efficiencies of the preselection cuts for the background MC samples are listed in~\Tab{\ref{tab:pre_cutflow}}. In~\Tab{\ref{tab:ggf_cutflow}} and~\Tab{\ref{tab:vbf_cutflow}}, the weighted event yields and cumulative efficiencies (with respect to event yields after preselection) for the background MC samples are presented for the ggF selection and VBF selection, respectively.
%The background composition percentage of each simulated background, in each of the signal and control regions, is given in~\Tab{\ref{tab:bkg_comp}}.
The raw event yields, and cumulative efficiencies (with respect to event yields after preselection) for a simulated 2\,\TeV\, HVT $Z'$ and 2\,\TeV\, heavy Higgs is presented in~\Tab{\ref{tab:sig_cutflow_ggF}} and~\Tab{\ref{tab:sig_cutflow_VBF}}, respectively.

\begin{table}[htbp]
\centering
\begin{tabular}{l|rrrrr}
\hline\hline
Cut & Total Bkg. & \Wjets & Top & Diboson & \Zjets \\ \hline
Bad Jet Veto&99.71&99.67&99.77&99.96&99.91\\
Second Lepton Veto&96.96&97.00&97.20&97.22&	96.01\\
%Lepton \pT&90.08&89.99&91.03&91.14&	89.02\\
Signal Lepton&87.38&87.39&88.03&88.52&	85.66\\
%Trigger&87.38&87.39&88.03&88.52&	85.66\\
Trigger \& Matching&86.89&86.91&87.59&88.12&	85.01\\\hline\hline
\end{tabular}
\caption[Preselection event cutflow]{Cumulative efficiencies (\%) of the preselection cuts for background MC samples. The top background includes both \ttbar and \Singlet.}
\label{tab:pre_cutflow}
\end{table}

%ggF
\begin{landscape}
\begin{table}[tbp]
\centering
\begin{tabular}{l|rr|rr|rr|rr|rr}
\hline\hline
Cut&\multicolumn{2}{c|}{Total Bkg.}& \multicolumn{2}{c|}{\Wjets}&\multicolumn{2}{c|}{Top}&\multicolumn{2}{c|}{Diboson}&\multicolumn{2}{c}{\Zjets}\\
&Events&Eff.&Events&Eff.&Events&Eff.&Events& Eff.&Events&Eff.\\\hline
Fail VBF&14593511.7&59.03&11019117.9&57.23&2367361.7&66.43&132117.3&63.33&1074914.9&63.39\\
$n(J)>1$&1917949.7&7.76&1315368.2&6.83&516870.4&14.50&27279.7&13.08&58431.3&3.45\\
$\MET>100\,\GeV$&896635.6&3.63&604994.3&3.14&263895.1&7.40&12518.5&6.00&15227.7&0.90\\
$\MET/\pT(e\nu)>0.2$&896198.4&3.62&604629.9&3.14&263842.6&7.40&12501.6&5.99&15224.3&0.90\\
$\pT(\ell\nu)>200\,\GeV$&662701.9&2.68&465166.6&2.42&177584.1&4.98&9887.1&4.74&10064.1&0.59\\
$\pT(\ell\nu)/m(\ell\nu J)>0.4$&436307.5&1.76&328896.7&1.71&94441.7&2.65&6555.6&3.14&6413.5&0.38\\
$\pT(J)/m(\ell\nu J)>0.4$&379466.5&1.53&287757.8&1.49&80380.8&2.26&5537.5&2.65&5790.5&0.34\\\hline
%Boson Tag&21058.3&0.09&6888.1&0.04&13123.1&0.37&920.5&0.44&126.6&0.01\\
SR HP (inclusive)&10613.5&0.04&6188.6&0.03&3485.6&0.10&832.4&0.40&106.9&0.01\\
SR $WZ$ HP&8574.2&0.03&4900.8&0.03&2909.6&0.08&677.4&0.32&86.4&0.01\\
SR $WW$ HP&7466.0&0.03&4190.8&0.02&2513.4&0.07&691.7&0.33&70.1&$<0.01$\\
Top CR HP&10487.4&0.04&704.8&$<0.01$&9674.6&0.27&87.9&0.04&20.1&$<0.01$\\
\Wjets CR HP&14775.6&0.06&10143.5&0.05&4054.0&0.11&374.0&0.18&204.1&0.01\\\hline
SR LP (inclusive)&28285.3&0.11&21153.8&0.11&5595.7&0.16&1121.9&0.54&413.9&0.02\\
SR $WZ$ LP&23494.0&0.10&17564.4&0.09&4648.0&0.13&937.6&0.45&344.0&0.02\\
SR $WW$ LP&19262.2&0.08&14658.2&0.08&3521.8&0.10&793.5&0.38&288.7&0.02\\
Top CR LP&14562.4&0.06&2113.3&0.01&12243.5&0.34&140.0&0.07&65.6&$<0.01$\\
\Wjets CR LP&22384.9&0.09&16529.4&0.09&5111.7&0.14&427.1&0.20&316.6&0.02\\\hline\hline
\end{tabular}
\caption[Cutflow, background Monte Carlo samples (gluon-gluon fusion selection)]{Cutflow for background MC samples for the ggF selection. The efficiency (\%) is cumulative, and with respect to event yields after preselection. The Top background includes both \ttbar and \Singlet. The inclusive signal regions (SR) includes events from $WW$ or $WZ$ SR. }
\label{tab:ggf_cutflow}
\end{table}
\end{landscape}

%VBF
\begin{landscape}
\begin{table}[tbp]
\centering
\begin{tabular}{l|rr|rr|rr|rr|rr}
\hline\hline
Cut&\multicolumn{2}{c|}{Total Bkg.}& \multicolumn{2}{c|}{\Wjets}&\multicolumn{2}{c|}{Top}&\multicolumn{2}{c|}{Diboson}&\multicolumn{2}{c}{\Zjets}\\
&Events&Eff.&Events&Eff.&Events&Eff.&Events& Eff.&Events&Eff.\\\hline
Pass VBF&509462.9&2.061&351102.4&1.823&105145.9&2.950&6500.1&3.116&46714.5&2.755\\
$n(J)>1$&55006.5&0.222&31980.0&0.166&19119.9&0.536&1089.4&0.522&2817.2&0.166\\
$\MET>100\,\GeV$&22831.2&0.092&12656.9&0.066&9326.1&0.262&449.7&0.216&398.4&0.023\\
$\MET/\pT(e\nu)>0.2$&22823.0&0.092&12651.5&0.066&9324.6&0.262&448.5&0.215&398.4&0.023\\
$\pT(\ell\nu)>200\,\GeV$&14463.3&0.059&8094.5&0.042&5853.3&0.164&314.2&0.151&201.4&0.012\\
$\pT(\ell\nu)/m(\ell\nu J)>0.4$&12549.8&0.051&6955.5&0.036&5146.2&0.144&284.2&0.136&163.8&0.010\\
$\pT(J)/m(\ell\nu J)>0.4$&12013.9&0.049&6589.8&0.034&4995.9&0.140&270.6&0.130&157.6&0.009\\\hline
%Boson Tag&842.4&0.003&207.1&0.001&603.5&0.017&27.8&0.013&4.1&0.000\\
SR HP (inclusive)&356.2&0.001&174.0&0.001&158.2&0.004&20.8&0.010&3.2&$<0.001$\\
SR $WZ$ HP&281.0&0.001&130.7&0.001&129.8&0.004&18.2&0.009&2.4&$<0.001$\\
SR $WW$ HP&242.0&0.001&119.8&0.001&104.9&0.003&14.9&0.007&2.5&$<0.001$\\
Top CR HP&481.3&0.002&30.3&$<0.001$&443.2&0.012&7.0&0.003&0.8&$<0.001$\\
\Wjets CR HP&635.6&0.003&352.3&0.002&255.4&0.007&21.6&0.010&6.3&$<0.001$\\\hline
SR LP (inclusive)&948.5&0.004&641.9&0.003&252.0&0.007&38.6&0.019&16.0&0.001\\
SR $WZ$ LP&791.2&0.003&541.6&0.003&203.0&0.006&32.5&0.016&14.1&0.001\\
SR $WW$ LP&633.2&0.003&438.9&0.002&157.8&0.004&24.9&0.012&11.6&0.001\\
Top CR LP&777.5&0.003&97.5&0.001&669.8&0.019&7.4&0.004&2.9&$<0.001$\\
\Wjets CR LP&913.4&0.004&527.7&0.003&350.6&0.010&21.6&0.010&13.5&0.001\\\hline\hline
\end{tabular}
\caption[Cutflow, background Monte Carlo samples (vector boson fusion selection)]{Cutflow for background MC samples for the VBF selection. The efficiency (\%) is cumulative, and with respect to event yields after preselection. The Top background includes both \ttbar and \Singlet. The inclusive signal regions (SR) includes events from $WW$ or $WZ$ SR. }
\label{tab:vbf_cutflow}
\end{table}
\end{landscape}

% Bkg Comp
%\begin{table}[tbp]
%\centering
%\begin{tabular}{l|rr|rr|rr|rr}
%\hline\hline
%Region&\multicolumn{2}{c|}{\Wjets}&\multicolumn{2}{c|}{Top}&\multicolumn{2}{c|}{Diboson}&\multicolumn{2}{c}{\Zjets}\\
%&ggF&VBF&ggF&VBF&ggF&VBF&ggF&VBF\\\hline
%SR HP (inclusive)&58.3&48.8&32.8&44.4&7.8&5.8&1.0&0.9\\
%Top CR HP &6.7&6.3&92.2&92.1&0.8&1.5&0.2&0.2\\
%\Wjets CR HP &68.7&55.4&27.4&40.2&2.5&3.4&1.4&1.0\\\hline
%SR LP (inclusive)&74.8&67.7&19.8&26.6&4.0&4.1&1.5&1.7\\
%Top CR LP&14.5&12.5&84.1&86.1&1.0&1.0&0.5&0.4\\
%\Wjets CR LP&73.8&57.8&22.8&38.4&1.9&2.4&1.4&1.5\\\hline\hline
%\end{tabular}
%\caption[Background composition in signal regions and control regions]{The background composition percentage for each background in the signal regions and control regions. The Top background includes both \ttbar and \Singlet. The inclusive signal regions (SR) includes events from $WW$ or $WZ$ SR. }
%\label{tab:bkg_comp}
%\end{table}

% Sig Eff
% ggF
\begin{table}[tbp]
\centering
\begin{tabular}{l|rr|rr}
\hline\hline
Cut& \multicolumn{2}{c|}{$e$-channel}&\multicolumn{2}{c}{$\mu$-channel}\\
&Raw Evts.&Eff.&Raw Evts.&Eff\\\hline
Fail VBF&6535&98.23&6521&98.73\\
$n(J)>1$&6430&96.65&6451&97.67\\
$\MET>100\,\GeV$&6062&91.12&6081&92.07\\
$\MET/\pT(e\nu)>0.2$&5721&85.99&--&--\\
$\pT(\ell\nu)>200\,\GeV$&5720&85.98&6079&92.04\\
$\pT(\ell\nu)/m(\ell\nu J)>0.4$&4727&71.05&4660&70.55\\
$\pT(J)/m(\ell\nu J)>0.4$&4530&68.09&4469&67.66\\\hline
SR HP (inclusive)&2336&35.11&2351&35.59\\
Top CR HP&165&2.48&178&2.69\\
\Wjets CR HP&126&1.89&117&1.77\\\hline
SR LP (inclusive)&2139&32.15&2065&31.26\\
Top CR LP&131&1.97&118&1.79\\
\Wjets CR LP&62&0.93&73&1.11\\\hline\hline
\end{tabular}
\caption[Cutflow, 2\,\TeV\,HVT $Z'$ signal sample (gluon-gluon fusion selection)]{Cutflow for 2\,\TeV\, HVT $Z'$ MC sample for the ggF selection. The efficiency (\%) is cumulative, and with respect to event yields after preselection. After preselection, the weighted number of events per \ifb\, is 1.23 (1.22) for the $e$-channel ($\mu$-channel). The Top background includes both \ttbar and \Singlet. The inclusive signal regions (SR) includes events from $WW$ or $WZ$ SR. }
\label{tab:sig_cutflow_ggF}
\end{table}

% VBF
\begin{table}[tbp]
\centering
\begin{tabular}{l|rr|rr}
\hline\hline
Cut& \multicolumn{2}{c|}{$e$-channel}&\multicolumn{2}{c}{$\mu$-channel}\\
&Raw Evts.&Eff.&Raw Evts.&Eff\\\hline
Pass VBF&4279&27.50&4531&28.11\\
$n(J)>1$&3102&19.94&3318&20.58\\
$\MET>100\,\GeV$&2934&18.86&3094&19.19\\
$\MET/\pT(e\nu)>0.2$&2773&17.82&--&--\\
$\pT(\ell\nu)>200\,\GeV$&2773&17.82&3092&19.18\\
$\pT(\ell\nu)/m(\ell\nu J)>0.4$&2499&16.06&2707&16.79\\
$\pT(J)/m(\ell\nu J)>0.4$&2419&15.55&2605&16.16\\\hline
SR HP (inclusive)&1316&8.46&1449&8.99\\
Top CR HP&22&0.14&28&0.17\\
\Wjets CR HP&77&0.49&91&0.56\\\hline
SR LP (inclusive)&1063&6.83&1140&7.07\\
Top CR LP&46&0.30&54&0.34\\
\Wjets CR LP&10&0.06&6&0.04\\\hline\hline
\end{tabular}
\caption[Cutflow, 2\,\TeV\,heavy Higgs signal sample (vector boson fusion selection)]{Cutflow for 2\,\TeV\, heavy Higgs (NWA) MC sample for the VBF selection. The efficiency (\%) is cumulative, and with respect to event yields after preselection. After preselection, the weighted number of events per \ifb\, is 0.90 (0.93) for the $e$-channel ($\mu$-channel). The Top background includes both \ttbar and \Singlet. The inclusive signal regions (SR) includes events from $WW$ or $WZ$ SR. }
\label{tab:sig_cutflow_VBF}
\end{table}


\section{Systematic uncertainties}
\label{sec:syst}

\subsection{Theory uncertainties}
\label{ssec:theoryuncert}
The estimation of the CP BSM parameters from the OO shape requires the precise knowledge of the SM contributions and related uncertainties. This includes both SM gluon-gluon fusion (background) and SM VBF (signal).
 Therefore, the different theoretical uncertainties affecting the SM predictions are included in the fitting likelihood. This includes uncertainties from PDF, QCD order and $\alpha_s$.

For the gluon-fusion production mode, nine uncertainty sources are used to model the QCD theory
uncertainties, following the recommendation of the LHC Higgs cross section working group~\cite{LHCXS_4}. These sources are:
\begin{itemize}
\item two sources correspond to yield uncertainties related to the total cross section. Their magnitude is taken from the
STWZ-BLPTW predictions~\cite{ggF_qcd_unc_1,ggF_qcd_unc_2,LHCXS_4} and their impact on the different bins is evaluated using
NNLOPS.
\item two sources correspond to migration uncertainties related to splitting the phase space by jet multiplicity. Their magnitude and impact are derived similarly to the yield uncertainties
\item two uncertainty sources are related to the $p_\mathrm{T}^H$ shape and are estimated from scale
variations in NNLOPS, including variations of the HNNLO input scales and the renormalization
and factorization scales in Powheg.
\item two uncertainty sources related to the enhancement of uncertainties for events with typical VBF topology (due to explicit or implicit third-jet vetos), and are estimated by scale variations in MCFM~\cite{MCFM}, and the corresponding uncertainties are estimated using the same procedure use for yield and migration uncertainties.
\item one uncertainty source is related to the treatment of $m_t$ and is most important at large $p_\mathrm{T}^H$.
\end{itemize}

Following the recommendations of PDF4LHC~\cite{pdf4lhc}, the PDF uncertainties are evaluated using the 30 eigenvectors set and treating each of them as an uncorrelated source. One additional nuisance parameter accounts for the uncertainties in $\alpha_{s}$.

For the $VBF+VH$ production modes, QCD uncertainties are estimated as an envelope of the scale variations available in Powheg~\cite{Nason:2009ai,VBFVH_theoryUnc}. Uncertainties from the choice of the PDF set and $\alpha_\mathrm{s}$ are evaluated similar to the gluon-fusion case.
A summary of the magnitude of these uncertainties in the different categories and OO bins is shown in the Figure ~\ref{fig:theoryUnc_ggF} ~\ref{fig:theoryUnc_VBF}.

\begin{figure}[htbp]
\centering
  \subfloat[TT ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/ggF_theoryUnc_TT_d_0.pdf} }
  \subfloat[TL ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/ggF_theoryUnc_TL_d_0.pdf} }
  \subfloat[LT ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/ggF_theoryUnc_LT_d_0.pdf} }
  \subfloat[LL ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/ggF_theoryUnc_LL_d_0.pdf} }
  \caption{Theory uncertainty in different OO bins for ggF process}
  \label{fig:theoryUnc_ggF}
\end{figure}

\begin{figure}[htbp]
\centering
  \subfloat[TT ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/VBF_theoryUnc_TT_d_0.pdf} }
  \subfloat[TL ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/VBF_theoryUnc_TL_d_0.pdf} }
  \subfloat[LT ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/VBF_theoryUnc_LT_d_0.pdf} }
  \subfloat[LL ]{ \includegraphics[width= 0.23\textwidth]{figure/TheorySyst/VBF_theoryUnc_LL_d_0.pdf} }
  \caption{Theory uncertainty in different OO bins for VBF process}
  \label{fig:theoryUnc_VBF}
\end{figure}

\subsection{Uncertainties from signal and background modeling}
\label{ssec:modeluncert}

\paragraph{} The Higgs peak described by double-side crystal ball function can be influence by several experimental effects.
Photon energy scale uncertainties shift the position of signal peak by between $\pm0.2\%$ and $\pm0.4\%$, while the photon resolution uncertainties change the width of signal peak by between $\pm 6\%$ and $\pm 15\%$, following Ref ~\cite{ref:phscaleres}.
Uncertainty due to knowledge of Higgs boson mass of 0.24GeV ~\cite{ref:mHerror} would also affect the signal peak position.
These sources are considered independently into systematic uncertainties.
\# \textcolor{red}{NUMBER NEED CHECK}

\paragraph{} The uncertainty due to the background choice is taken to be the spurious signal yield discussed in \Sect{\ref{ssec:spurious_signal}}, and assumed to be uncorrelated in each bins.

\subsection{Experimental systematic uncertainties affecting the expected signal yields}
\label{ssec:expuncert}

\paragraph{} With data taken during 2015-2018, the uncertainty from integrate luminosity is 2.0\%. Other sources of experimental uncertainty affecting the expected signal yields include: the efficiency of diphoton trigger, the photon identification and isolation efficiencies, the photon energy scale and resolution, the modelling of pile-up in the simulation, the jet energy scale and resolution, the efficiency of the jet vertex tagger. Among them the dominant one is jet flavor composition \texttt{ATLAS\_JET\_Flavor\_Composition} which contributes 5.5\%. \\

The considered systematic uncertainty terms are shown in Figure ~\ref{fig:syst_ranking}.

\begin{figure}[h]
  \centering
  \includegraphics[width=.9\textwidth]{figure/ranking.pdf}
  \caption{Ranking plot for all systematic uncertainty terms. }
  \label{fig:syst_ranking}
\end{figure}


\documentclass[12pt]{article}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ...
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epstopdf}
\usepackage{wrapfig}
\usepackage{natbib}
%\usepackage[square,comma,numbers,sort]{natbib}
\usepackage[pdftex, plainpages=false, colorlinks=true, linkcolor=blue, citecolor=blue, bookmarks=false]{hyperref}
\usepackage{setspace}
\usepackage{multicol}
\usepackage{sectsty}
\usepackage{url}
\usepackage{lipsum}
\usepackage{times}
\usepackage[tiny,compact]{titlesec}
\usepackage{fancyhdr}
\usepackage{deluxetable}
\usepackage[font=footnotesize,labelfont=bf]{caption}
\usepackage{verbatim}
\usepackage{acronym}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0.0cm}
\setlength{\evensidemargin}{0.0cm}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.2in}
\setlength{\headsep}{0.2in}
\setlength{\textheight}{9.in}
%\setlength{\footskip}{-0.2in}
%\setlength{\voffset}{0.0in}

\sectionfont{\normalsize}
\subsectionfont{\normalsize}
\subsubsectionfont{\normalsize}
\singlespacing

\input ../macros.tex
\input ../journal_abbr.tex

\pagestyle{fancy}
\fancyhf{}
\lhead{\fancyplain{}{\doctitle}}
\rhead{\fancyplain{}{S.M. Couch}}
\rfoot{\fancyplain{}{\thepage}}

\bibliographystyle{aasjournal}
%\bibliographystyle{hapj}
%\bibliographystyle{physrev}

%\titlespacing*{\section}{0in}{0.2in}{0in}
%\titlespacing*{\subsection}{0in}{0.1in}{0in}
\titleformat*{\subsection}{\itshape}
%\titlespacing*{\subsubsection}{0in}{0.in}{0in}
\titleformat*{\subsubsection}{\itshape}
\setlength{\abovecaptionskip}{3pt}

\begin{document}

\begin{center}
  {\bf \large Year 3 - CY2020 Allocation Renewal} \vspace{-0.1in}
\end{center}

\section{Project Achievements in Years 1 and 2}

\subsection{Significant Accomplishments and Progress on Project Milestones}

\subsubsection{3D simulations of magnetorotational core-collapse supernovae}

One of the key objectives for Year 1 of our INCITE project was to execute a parameter study of magnetorotational core-collapse supernova (CCSN) simulations using high-fidelity neutrino transport and magnetohydrodynamics (MHD) as implemented in our \sparkmone application, built in the \flash simulation framework \citep{Fryxell:2000, Dubey:2009}.
\sparkmone utilizes the new \spark high-order MHD solver \citep{couch:2017}, the M1 two-moment explicit neutrino transport method \citep{Shibata:2011a, oconnor:2015, oconnor:2018}, an accurate and efficient multipole gravity solver \citep{couch:2013c} including the general relativistic monopole correction \citep{Marek:2006}, and the \flash framework for adaptive mesh refinement (AMR), I/O, and runtime management.
The methods and physics included in \sparkmone make it one of the most high-fidelity and high-performance CCSN simulation tools in the world.

% \begin{figure*}[b!]
%   \begin{tabular}{ccc}
%     \includegraphics[width=2in]{fig_vr_m15u_3d_mag_annotated_0677.png} &
%     \includegraphics[width=2in]{fig_vr_m15u_3d_mag_rot_annotated_0695.png} &
%     \includegraphics[width=2in]{./fig_vr_m15u_3d_rot2_annotated_0696.png}
%   \end{tabular}
%   \caption{Volume renderings of entropy from three of the 3D magnetorotational CCSN simulations that we are currently running on \mira as part of this INCITE project. Shown are cases with magnetic fields (left), magnetic fields and rotation (middle), and no magnetic fields but fast rotation (right). All of these simulations are currently at around 100 ms post-bounce and are on-going.}
%   \label{f.m15u}
% \end{figure*}

\begin{figure*}[b!]
    \begin{tabular}{ccc}
        \includegraphics[width=2in]{m15u_3d_entr_slice_1126.png}&
        \includegraphics[width=2in]{m15u_3d_rot_entr_slice_1015.png}&
        \includegraphics[width=2in]{m15u_3d_mag_rot_entr_slice_1136.png}
    \end{tabular}
    \caption{Slice plots of entropy from three of the 3D magnetorotational CCSN simulations that we ran on \mira as part of this INCITE project. Shown are cases with no magnetic fields or rotation (left), rotation but no magnetic fields (middle), and rotating and magnetic (right). In this plots, all simulations are currently at around 250 ms post-bounce.}
    \label{f.m15u}
\end{figure*}

The \spark MHD solver \citep{couch:2019a} implements the cell-centered method of generalized Lagrangian multipliers \citep[GLM;][]{Dedner:2002, Mignone:2010} to control the growth of the divergence of the magnetic field.
The GLM-MHD scheme employs hyperbolic advection and parabolic damping of divergence errors in order to avoid expensive elliptic divergence cleaning \citep[e.g.,][]{Jiang:1999} or complicated staggered-mesh constrained transport \citep[e.g.,][]{Gardiner:2005, Lee:2009a, Lee:2013}.
\spark implements the GLM-MHD scheme via a finite-volume approach using high-order primitive reconstruction, multiple Riemann solvers for flux calculation, and method-of-lines time integration using multi-stage strong stability preserving (SSP) low-storage Runge-Kutta (RK) integrators of second- and third-order \citep[e.g.,][]{Gottlieb:1998}.
For realistic, non-Gamma-law equations of state, \spark avoids the approach of \citet{Colella:1985} used in other \flash solvers and adopts the volumetric internal energy, $\rho e$, as an auxiliary thermodynamic primitive variable instead, as in \citet{Almgren:2010}.
We have found this approach to be generally more robust but either method should be technically equivalent \citep[e.g.,][]{Zingale:2015}.
For our CCSN application, we use fifth-order WENO reconstruction \citep{Borges:2008}, second-order time integration, and the HLLC approximate Riemann solver \citep{toro:2009}.

Neutrino transport in \sparkmone is carried out using the M1 two-moment explicit approach described in \citet{oconnor:2015, oconnor:2018, oconnor:2018b}.
The M1 scheme solves the first two angular moments of the Boltzmann equation for neutrinos and utilizes an analytic closure for the higher-order moments.
The neutrino fluxes, both in real space and in energy space, are computed explicitly as a hyperbolic system resulting in favorable performance and scaling properties (at the cost of time step sizes limited by the speed of light) while the matter-radiation source terms are computed implicitly.
This implicit solve is completely local and requires solving only a 4x4 matrix.
Our M1 solver is fully velocity-dependent, except in the calculation of the explicit flux terms, which is done to $\mathcal{O}(v/c)$.
In Year 1, we did not include inelastic neutrino scattering in the multidimensional version of our transport solver but during Year 2 we have successfully implemented and optimized this capability and will use it in the production simulations planned for Year 3.

The two-moment M1 approach is inherently more accurate than zeroth-moment only approaches such as flux-limited diffusion \citep[e.g.,][]{bruenn:2013, Dolence:2015, Lentz:2015}.
M1 does not require a flux-limiter-based closure for the radiation fluxes as they are solved for directly.
Furthermore, the analytic closure we currently use for the moments beyond the first is simple and straightforward yet shows encouraging agreement with 1D Boltzmann and Monte Carlo neutrino transport calculations \citep{oconnor:2015, Murchikova:2017}.
As compared with flux-limited diffusion, M1 does not suffer from the inability to capture ``shadows'' inherent to FLD schemes.
A known limitation of M1 is cases in which distinct beams of radiation intersect, causing radiation ``shocks.''
The M1 solution in such cases becomes highly diffuse at the intersection.
This is a problem in, e.g., radiation hydrodynamic calculations of accretion disks or neutron star mergers.
For CCSNe, however, the radiation field is highly forward peaked and cases in which distinct beams of radiation might cross are essentially non-existent.
Hence, M1 is {\it ideally} suited for the CCSN problem due to its accuracy (for the specific problem) and efficiency.
In addition, the severe limitation of time steps determined by the speed of light is not so drastic in CCSNe since the explicit time step is already just a factor of a few larger than this thanks to the enormous sound speeds in the proto-neutron star (PNS).
Another significant advantage of M1 is that it is a fully multidimensional transport scheme, i.e., the solution at a given grid point is dependent on the fluxes from every direction around that point.
This is distinct from the often-adopted ``ray-by-ray'' approximation \citep[e.g.,][]{bruenn:2013, bruenn:2016, muller:2012a, Hanke:2013, Melson:2015, Lentz:2015} in which the transport problem is solved only along discrete radial rays.
The advantages of M1 for neutrino transport in CCSNe have not gone unnoticed and a number of groups are now adopting this approach \citep{Just:2015, Kuroda:2016, Skinner:2016, Roberts:2016, vartanyan:2018, vartanyan:2019}.

In our \flash CCSN application we have assumed that the composition of the matter throughout the entire computational domain is determined by nuclear statistical equilibrium (NSE).
This common approximation \citep[e.g.,][]{burrows:2007, Ott:2008, Dolence:2015, Skinner:2016, Roberts:2016, Kuroda:2016} is appropriate at high densities and temperatures where the nuclear reaction rates are sufficiently fast to establish equilibrium essentially instantly but becomes increasingly incorrect at low densities such as those in the silicon and oxygen shells surrounding the collapsing iron core.
Critically, correctly predicting the explosion energy or nucleosynthetic products such as radioactive nickel can be severely impacted by the inappropriate assumption of NSE \citep{bruenn:2016}.
\citet{bruenn:2016} advocate the use of an approximate nuclear network in regions that are not in NSE, while other groups \citep[e.g.,][]{muller:2012a, Melson:2015} use a ``flashing'' approach rather than a full network calculation.
We have recently implemented a method for transitioning to a nuclear network and appropriate EOS at low densities.
Our new approach blends the pressures between the high- and low-density EOS's to prevent spurious pressure discontinuities and uses an auxiliary variable to track whether a zone is entering or exiting NSE, allowing us to appropriately set the composition in the transition region.
This new capability will be included in Year 3 production simulations.

In Year 1, we successfully executed a parameter study of magnetorotational CCSN simulations.
Figure \ref{f.m15u} shows volume renderings of entropy from three of the five high-resolution 3D simulations we ran on \mira and \thet.
We opted to use the 15-\msun progenitor from \citet{heger:2005} in order to facilitate a direct comparison to the recent results of \citet{summa:2018}.
We ran five different cases for this one progenitor: (1) non-rotating, non-magnetic; (2) rotating, non-magnetic; (3) non-rotating, magnetic; (4) rotating, magnetic; and (5) rapidly rotating, non-magnetic.
For rotating cases, we take the rotation profile directly from the progenitor model that was evolved with rotation and magnetic fields and prescriptions for angular momentum transport \citep{heger:2005}.
For the rapidly-rotating case, we simply multiply the angular speed of the profile by two, making the rate of rotation similar to one of the models explored by \citet{summa:2018}.
The magnetic field is initialized with a quasi-poloidal field geometry with the peak strength set to match the field strength of the original progenitor model, about $10^8$ G.
The peak angular speed of this model is about 0.2 rad s$^{-1}$ (0.4 rad s$^{-1}$ for the ``rapidly'' rotating case).
This is, in fact, not very rapid rotation or field strength and so in these models we do not expect to see dramatic, magnetorotationally-dominated dynamics.
Rather, we explored the impact of plausibly typical rotation rates and field strengths on the CCSN mechanism.

% The 3D magnetorotational CCSN simulations are on-going and we fully expect to reach our target final simulation times by the end of Year 1.
% Already, we are seeing an impact of rotation and, to a lesser extent, magnetic fields.
% We are already seeing that the rotating cases are closer to explosion.
% The presence of magnetic fields is, so far, having little impact on the gross dynamics of the simulations, but for these initial field strengths it will take a longer period of evolution to build of substantial field strengths.
\begin{wrapfigure}[22]{l}{3in}
    \includegraphics[width=2.9in]{./fig_gradp_m25_o110_b9_0566.png}
    \caption{Equatorial slice plot of the gradient of pressure from a 3D magnetorotational CCSN simulation run as part of our previous INCITE project. The development of a non-axisymmetric rotational instabity in the PNS leads to the generation of strong spiral pressures waves. The gravitational wave emission is also significantly amplified.}
    \label{f.gradp}
\end{wrapfigure}
Our results from Year 1 simulations indicate that the presence of rotation, in particular, is helpful to CCSN shock revival \citep[e.g.,][]{summa:2018}.
As shown in \ref{f.m15u}, the addition of rotation substantially increases the mean shock radius at the same time post-bounce.
For the non-rotating, non-magnetic case (left panel), the shock is already receding by this point whereas for all cases including rotation the shock remains stalled at large radii ($\sim$200 km).
The right panel of Figure \ref{f.m15u} shows the case including both realistic rotation and weak initial magnetic fields.
The magnetic fields, even if weak, may still have an impact on the behavior of the turbulence in the gain region and the PNS.
Indeed, we see that while the field strengths, even at this point post-bounce, are not dynamically strong, there is still a noticeable impact on the overall evolution of the simulation.
The shock is at slightly larger radii than the rotating-only case and the entropies in the gain layer are on average greater.
This simulation is closer to explosion than the comparable case without magnetic fields.
Detailed analysis and comparisons are underway now.
This anallysis will include exploring the presence of a non-axisymmetric rotational instability in the PNS \citep{wheeler:2007, ott:2005}.
In work based on simulations ran as part of our previous INCITE allocation, we have identified the emergence of such an instability for magnetic and rotating initial conditions.
This instability can generate strong pressure waves that transport energy to the gain region, and also leads to very loud gravitational wave signals.
An image of the strong pressure waves is shown in Figure \ref{f.gradp}.

\subsubsection{3D Simulations of CCSN Progenitors}

One of the most remarkable and exciting results of recent 3D simulations of the CCSN mechanism is the discovery that  realistic non-spherical structure in the progenitor star can have a dramatic impact \citep{couch:2013b, couch:2015, couch:2015a, muller:2015, muller:2017, oconnor:2018b}.
The breaking of spherical symmetry is manifest in the turbulent convection driven by nuclear burning in the cores of massive stars.
As a massive star nears collapse, strongly convective burning in the Si and O shells surrounding the iron core can reach speeds of nearly 1000 km s$^{-1}$ and is characteristically very large in spatial scale \citep{Arnett:2011, couch:2015a, muller:2016a}.
These convective perturbations will reach the stalled shock shortly after core bounce and can aid neutrino-driven explosions by either enhancing the strength of post-shock turbulence \citep{couch:2015} or causing large scale ``forced shock deformations'' \citep{muller:2017}, or both.
These results serve to remind us that CCSN mechanism simulations are initial value problems and that the details of our initial conditions matter tremendously!
Our work inaugurated the era of detailed investigation into the impact of 3D progenitor structure on the CCSN mechanism \citep{couch:2013b, couch:2015a}.
As part of this INCITE project we are advancing the investigation into 3D progenitor structure substantially.
Specifically, we are simulating 3D progenitors including rotation and magnetic fields.

\begin{wrapfigure}[21]{r}{3in}
  \includegraphics[width=2.9in]{mag_vel_face_on_no_rot_prog3d_oct_vol_0834.jpg}
  \caption{Volume rendering of the velocity magnitude from a 3D progenitor simulation run in full ``$4\pi$'' geometry during Years 1 and 2 of this project. Peak convective speeds reach over 300 km/s prior to core collapse. This simulation is being used as initial conditions for Year 2 CCSN simulations.}
  \label{f.progen}
\end{wrapfigure}
A key milestone for Years 1 and 2 was to carry out new, high-fidelity 3D simulations of the final minutes of stellar evolution to the point of iron core collapse.
%For these simulations we used the \spark MHD solver \citep{couch:2019a} and include rotation and magnetic fields {\it for the first time ever} in a 3D CCSN progenitor simulation.
We are used 1D massive star evolution models constructed using MESA \citep{paxton:2011, paxton:2013, paxton:2015}, initialized in 3D approximately five minutes prior to core collapse.
During Years 1 and 2 we ran a full-3D non-rotating, non-magnetic case all the way to the point of iron core collapse.
In second half of Year 2 we will carry out a second full 3D model that includes both rotation and magnetic fields.
%In the original proposal, we planned four 3D progenitor simulations in Year 1.
Our test simulations executed showed that the expense of the simulations increases significantly as the stars approach collapse.
This is due to more vigorous nuclear burning in the core, increasing the expense of the nuclear network solve.
Therefore, in order to ensure that we can simulate sufficiently long time scales, we have opted to execute just these two simulations rather than the originally-planned four.

In Years 1 and 2, we made substantial gains in improving our simulation approach for 3D CCSN progenitors.
We improved the OpenMP threading of our nuclear network code.
We improved the efficiency of the empirical load balancing approach our progenitor application uses.
We tested several approaches to the initial mapping of the 1D progenitor model to the 3D domain and have improved our approach to stabilizes the initial conditions.
We implemented new, modern reaction rates for electron captures and for key carbon reactions.
And, importantly, we have successfully, and efficiently, run a full production simulation all the way to core instability and collapse.

% We are now ready to begin our 3D progenitor production simulations on \mira.
For the rotating, magnetic progenitor we are using a MESA model constructed using the magnetic field production and angular momentum transport model of \citet{spruit:2002}, as implemented for stellar evolution by \citet{heger:2005, paxton:2015}.
This model yields a realistic rotation profile and an estimate for the {\it strength} of the magnetic field as a function of radius in the star.
There is very limited information about the 3D geometry of the field.
To address this, we are initializing the field in a random, divergenceless fashion with a typical strength matching the 1D MESA model estimate.
We will then allow the field to relax to a quasi-steady-state configuration.
This transition should occur on the rotational and convective time scale, both of which are about 30 s.
We will simulate roughly 3 to 5 minutes of evolution up to core collapse.

\subsubsection{High-resolution Simulation of Magnetorotational Turbulence}

Our final simulation milestone for Year 1 was to execute a high-resolution simulation of magnetorotational turbulence in the CCSN gain region.
For this simulation, we used the ``rapidly'' rotating conditions described above and allow for higher resolution in the gain layer using AMR.
This simulation required many more zones than the fiducial resolution case and was a standalone Capability-scale simulation.
This simulation was run until 100 ms post-bounce and we are now analyzing the results and comparing to the lower-resolution case.

\subsubsection{Long time simulations of MHD CCSNe}

In Year 2 of this project we are carrying out the 3D simulations of magnetorotational CCSNe from Year 1 to late times, nearing one second post-bounce.
Long time scale simulations are crucial for accurately predicting the explosion energy, PNS mass, nucleosynthesis, etc. \citep{bruenn:2016, muller:2017}.
For any of the simulations that fail to explode, we will attempt to simulate late enough times to capture the onset of PNS collapse to a black hole.
This has the potential to elucidate some details of the formation of stellar mass black holes, such as those that have been detected by aLIGO \citep{abbott:2016, abbott:2017}.
We have recently shown \citep{pan:2018} that the GR effective potential approach can fairly accurately predict black hole formation time in 2D as compared to 1D fully GR simulations \citep{oconnor:2011}.

The nucleosynthetic yields from CCSN simulations are a key quantity that can be directly compared to observations and laboratory measurements of cosmic abundances.
We will compute the detailed nucleosynthesis from these late-time CCSN simulations.
This will be accomplished as a post-processing step using the open-source SkyNet nuclear reaction network code developed by Co-I Roberts.
The input for the nuclear reaction networks will be passive tracer particle data that records thermodynamic trajectory information from our \flash CCSN simulations.
\flash already includes a well-developed, efficient passive-particle framework that has been used extensively in the calculation of nucleosynthesis in Type Ia supernova simulations \citep[e.g.,][]{long:2014}.
We will compute detailed abundances for elements such as radioactive nickel and titanium, two key observable quantities, and we will also examine how rotation and magnetic fields can influence the conditions for very heavy element formation and the r-process.

% Each of the four 3D simulations will require 16M core-hours on \mira and 10 TB of online storage (see Section \ref{sec:performance}).
% Including 2M \mira core-hours for development and testing, the total request for this milestone is 66M \mira core-hours and 40 TB of online storage.

These simulations have been restarted from simulations carried over from Year 1 and are running in the Capability queue on {\it Mira}. Substantial progress has been made on these simulations and they are nearing completion.

\subsubsection{High-resolution simulation of MHD dynamos in the proto-neutron star}

There is a very strong shear layer at the edge of rotating PNS's that is unstable to the magnetorotational instability \citep[MRI,][]{akiyama:2003, burrows:2007}.
The presence of convection combined with rotation in the PNS can also lead to an $\alpha$-$\Omega$ dynamo \citep{mosta:2015}.
Both mechanisms can lead to exponential amplification of magnetic fields with dramatic implications for the CCSN mechanism.
Accurately capturing either process is extremely challenging computationally, requiring extremely high resolution to capture the fastest growing modes of these instabilities \citep{mosta:2015}.
In Year 2 of this project, we will carry out an extremely high resolution simulation of a rotating PNS in order to study the rapid growth of magnetic fields via the MRI and dynamo.
This simulation will go beyond \citet{mosta:2015} in a number of ways: we will use our M1 neutrino transport method rather than leakage, we will include the entire solid angle of the sphere rather than just a 90$^\circ$ wedge, and will simulate to later times in the aim of capturing the saturation of the magnetic fields.
Using AMR, we will add two extra levels of refinement beyond our fiducial resolution only in the shear layer surrounding the PNS, between 15\,km and 40\,km, bringing the finest resolution elements to 163\,m.
This approach was piloted for capturing turbulence in the gain region during our current INCITE project and will avoid adding additional zones in regions that are stable to the instabilities of interest.
This is not as high as the highest resolution used by \citet{mosta:2015} but we plan to go to much longer time scales, as much as 100 ms post-bounce.
This simulation will comprise about 100 million zones in 3D and require about 200,000 time steps to reach 100 ms.
%The expense for this simulation will be 60M core-hours on \mira and will require 40 TB of online storage. We request an additional 2M core-hours for testing and development.

So far in Year 2 we have analyzed simulations from Year 1 that will serves as the initial conditions for this high-resolution simulation. We anticipate starting this simulation in Q3 of Year 2. Given the extreme resolution of this simulation, it will run in the Capability queue from the outset.

\subsubsection{MHD simulation of CCSN progenitors}

In Year 2, we are extending the Year 1 study of iron core collapse to rotating and magnetic stars.
We will simulate the final five minutes of stellar evolution to core collapse in 3D for a 25-\msun progenitor stars for both ``high'' and ``low'' core rotation rates.
As in Year 1, all final models will be made publicly available.
% Each such simulation will require 5M core-hours on \mira, for a total of 20M core-hours for the four simulations.
% We request 10 TB of online storage for these simulations.
% We request an additional 2M core-hours for testing and development.

These simulations will be started in Q3 of Year 2. We are now tuning our progenitor application to make better use of OpenMP threading and developing realistic initial conditions for the magnetic field strength and geometry.

\subsubsection{CCSN simulation with 3D progenitors}

In Year 2 we will use the 3D progenitor models generated in Year 1 for 3D CCSN simulations on \thet.
The progenitor model for these simulations is now finished and ready to be used in CCSN simulations.
For these simulations, we will enhance the physical fidelity of our neutrino transport by incorporating our newly-implemented neutrino-electron scattering capability and the latest, most accurate electron capture rates.

% For these four simulations we will use the 15-\msun 3D progenitor simulated during Years 1 and 2.
% For this milestone we request a total of 16M \thet core-hours (52M \mira-equivalent core-hours) and 20 TB of online storage.
% Plus an additional 2M \thet core-hours for development and testing, the total request for \thet in Y2 is 18M core-hours (58.5M \mira-equivalent core-hours).

% \subsubsection{Implement microphysics from TEAMS SciDAC collaboration and neutrino-electron scattering (NES)}

% This planned open-source microphysics framework will incorporate the latest, state of the art neutrino interactions and cross sections that are fully self-consistent with the underlying EOS.

% Built on NuLib. Currently FLASH (and hence Spark-M1) is the only CCSN code in TEAMS that already utilizes NuLib, so we are good.

% The TEAMS microphysics package is not yet ready for production simulations. We have during Q1 finished an implementation of NES and are now testing it in 1D and 2D simulations. We anticipate being able to use this new capability in our planned 2019 CCSN simulations.

\begin{figure*}
    \includegraphics[width=6in]{./gw_trains.png}
    \caption{Gravitational wave strains from the 3D simulations of \citet{oconnor:2018}, carried out under a prior INCITE award. Our work showed for the first time that the presence of 3D structure in the progenitor star leaves a detectable imprint on the gravitational wave emission.}
    \label{f.strains}
  \end{figure*}

  \subsubsection{Fundamentally 3D Phenomena in CCSNe}

  Recently, we submitted a publication detailing results based on simulations carried out under our previous INCITE award \citep{oconnor:2018b}.
  This work includes several full 3D, high-resolution simulations using our M1 neutrino transport in \flash, representing over 100 Million core-hours of work on \mira.
  In these simulations, we identify and analyze several essentially 3D aspects of CCSNe, including the presence of a new instability in the neutrino emission called the Lepton-number Emission Self-sustaining Asymmetry (LESA), first reported by \citep{tamborra:2014}.
  We are the first group to confirm the presence of the LESA in CCSNe and, since we use a very different transport approach, our work strongly implies this is not a numerical artifact but a real physical instability.

  In \citet{oconnor:2018}, we also show that the presence of the non-spherical, 3D progenitor structure has several important impacts on the CCSN mechanism.
  We show that convective motion in the progenitor can substantially increase the proximity to explosion.
  We also showed that 3D structure in the progenitor can leave a measurable imprint on the gravitational wave emission from CCSNe that could be detected by, e.g., LIGO.
  The gravitational wave strains from our simulations are shown in Figure \ref{f.strains}.

\subsection{Project Usage}

\begin{figure}
    \begin{tabular}{cc}
        \includegraphics[width=3.25in]{on_track_graph_mira_2018.png}
        \includegraphics[width=3.25in]{categorized_hours_graph_mira_2018.png} \\
        \includegraphics[width=3.25in]{on_track_graph_2018}
        \includegraphics[width=3.25in]{categorized_hours_graph_2018}
    \end{tabular}
    \caption{Allocation usage in Year 1 on {\it Mira} and {\thet}.}
    \label{fig:usageY1}
\end{figure}

\begin{figure}
%   \begin{tabular}{cc}
    \includegraphics[width=3.25in]{on_track_graph_mira.png}
    \includegraphics[width=3.25in]{categorized_hours_graph_mira.png} \\
%     \includegraphics[width=3.25in]{on_track_graph}
%     \includegraphics[width=3.25in]{categorized_hours_graph}
%   \end{tabular}
    \caption{Allocation usage in Year 2 on {\it Mira}.}
    \label{fig:usage}
\end{figure}

In Year 1 of our allocation, we fully expended our allocations on both \mira and \thet (see Figure \ref{fig:usageY1}).
On \thet, despite a late start to our production simulations, we exceeded our initial allocation by 12\%.

So far in 2019 we expended 66M core-hours on Mira out of our total 2019 allocation of 150M core-hours (44\% usage).
This is just slightly behind the linear usage curve, though our burn rate in Q2 was substantially larger than for Q1.
We are now running one of our primary simulation milestones in the Capability queue and will start a second Capability-scale simulation in the next week or two.
Figure \ref{fig:usage} we show our current usage and categorized hours on Mira.

We have yet to start running production simulations on Theta for two reasons.
First, during Q1 we spent some effort continuing to tune our production application for Theta.
This is largely complete now.
The second reason for the delayed start is that we were waiting on the completion of 3D supernovae progenitor simulations that we had planned to use as the initial conditions for our simulations on Theta this year.
These simulations are now complete and a paper is in preparation describing them.
We are now prepared to start these simulations during Q3.
Based on our experience last year running on Theta, we do not anticipate any difficulty in expending our entire allocation before the end of the calendar year.

% \begin{figure}
%   \begin{tabular}{cc}
%     \includegraphics[width=6.5in]{fig_theta_scaling_j4.pdf}
%   \end{tabular}
%   \caption{Weak scaling test on Theta. Different colors represent different combinations of MPI and OpenMP tasks. }
%   \label{fig:theta}
% \end{figure}

\subsection{Application Parallel Performance}

\begin{wrapfigure}[15]{l}{3in}
    \includegraphics[width=3in]{wkScaleSparkAll.pdf}
    \caption{Weak scaling parallel efficiency of our \sparkmone application on \thet.}
    \label{f.wkScaleThet}
\end{wrapfigure}

As shown in our original proposal, our application demonstrates good parallel performance.
In Figure \ref{f.wkScaleThet} we show the weak scaling parallel efficiency of \sparkmone on \thet for up to 2048 nodes.
At production scales ($\gtrsim128$ nodes), we see an efficiency of around 80\%.
Considering the immense communication requirements of our M1 transport solver, we consider this good performance.

We have also substantially improved our overall appliation performance on \thet during Years 1 and 2.
At the time of our original proposal, \sparkmone on \thet and a performance metric of 91 mega-zone-updates per node-hour.
We have optimized the single-node performance of our application to better utilize KNL hardware threads, high-bandwidth memory, and OpenMP parallelism.
For the same application we now achieve a metric of 132 mega-zone-updates per node-hour, and increase in single-node performance of 44\%.

% \section{Code Development}

% We planned two code development milestones for Year 1: implement a ``marching cubes'' approach for our EOS and opacity tables and develop a simulation workflow management tool in Python.
% Both efforts are still underway.
% While developing the marching cubes capability we found that we could significantly accelerate our table interpolations by reordering some of the large arrays.
% This allowed for efficient vectorization by the compiler and sped up our table interpolations, both EOS and opacity, by about a factor of two.
% This improvement makes these aspects of our simulations relatively cheap, although the memory cost of the large tables is still high.
% Nevertheless, we have downgraded the priority of implementing the marching cubes approach.\footnote{Never let optimization slow you down.}
% We will still complete this implementation as person-power allows.

% We have continued to develop workflow  tools for managing our large simulations on \mira and \thet.
% We have implemented new {\tt bash} scripts that automatically configure and submit restart jobs, which will substantially increase our queue throughput.
% We are incorporating these new tools into our existing Python tool chain.
% We have also developed Python code to automatically configure and setup simulation parameter studies and generate job submission scripts.
% Work on this tool continues and we will implement functionality for some limited runtime visualization and automatic data archiving in the near future.

We have also made significant progress on other code development relevant to, but not directly planned as part of, this INCITE program.
In our neutrino transport, we have implemented neutrino-electron inelastic scattering, an important process that we have so far only included during the 1D collapse phase of our simulations.
We have also begun porting our \spark MHD solver to the DOE Exascale Computing Project (ECP)-supported AMReX framework.
We are doing this within the new version of \flash that is being developed as part of the DOE ECP.
We anticipate moving to the AMReX version of \flash in the future for our production simulations.

% For Year 2, we continued to make improvements to our \sparkmone application.
% As originally proposed, we will implement the TEAMS SciDAC EOS and opacity framework.
% In collaboration with researchers at the University of Washington and the University of Tennessee, Co-PI Roberts is now working on the initial implementation of this framework.
% This effort will enhance the physical fidelity of the EOS and neutrino opacities we use in our simulations.

The second major code development effort we performed in Year 2 is the implementation of high-order, single-step methods for MHD in our CCSN application.
This is work also supported by the TEAMS SciDAC collaboration.
Chelsea Harris, a new research associate at MSU, is leading this effort.
Our \spark MHD solver is written in such a way to make implementation of this new approach straight-forward.
A high-order single-step method will both increase the accuracy of our simulations while also decreasing the overall communication burden.
This as the potential to significantly improve our computational efficiency.
We will also continue porting our various physics routines, particularly \spark, to the AMReX-capable version of \flash.

\subsection{Data Storage}

At present, we have 280 TB of online storage on the \mira filesystem and approximately 200 TB on archival storage.
At this stage, we are continually triaging our on-disk data and moving to tape as we are able to free up disk for new simulations.

\section{Project Plans for Year 3}

During Years 1 and 2 we have largely achieved our originally-planned goals for this three-year project.
Therefore, our goals for Year 3 will be largely unchanged except for minor course corrections based on the actual achievements of the first two years.
One major change is necessitated by the delay of the \aurora system.
We had originally proposed an extensive parameter study of 3D magnetorotational CCSNe on \aurora for Year 3.
We have opted to de-scope this study to far fewer simulations to be executed on \thet instead.
This does require, however, a substantial increase in our request for \thet in Year 3.
We had originally requested 500k node-hours on \thet in Year 3 but to achieve the goals we outline below we now request a total of 1M node-hours on \thet for 2020.

Based on our updated application performance studies on \thet, we estimate that for 500 ms of post-bounce evolution, our \sparkmone CCSN simulations will require approximately 100k node-hours when including neutrino-electron scattering.
This performance is very competitive with comparable state-of-the-art CCSN simulations on comparable hardware platforms \citep{vartanyan:2019}.

\subsection{MHD CCSN Simulations Using 3D Progenitors}
\label{sec:Y3mrccsn}

In Year 3 we will use the 3D progenitor models generated in Year 2 for 3D MHD CCSN simulations on \thet.
These progenitors will be simulated in 3D with both rotation and magnetic fields.
We will carry out two new CCSN simulations, one from a fully magnetorotational progenitor and one in a rotating-only progenitor.
As with all planned Year 3 simulations, we include our newly-implemented neutrino-electron scattering capability.
For this milestone we request a total of 250k node-hours and 40 TB of online storage.

\subsection{Late time 3D Simulations of Magnetorotational CCSNe from 3D Progenitors}
\label{sec:Y3late}

In Year 3 we will continue two CCSN simulations from 3D progenitors started in Year 2 to about one second post-bounce.
As in Year 2, we will study the explosion energies, PNS masses, nucleosynthesis, and black hole formation times in these simulations as appropriate.
For this milestone we request a total of 250k node-hours and 40 TB of online storage.

\subsection{Magnetorotational CCSN Parameter Study in 3D Progenitors}
\label{sec:Y3aurora}

The four 3D simulations planned above will be executed in progenitor models that have been evolved in 3D.
At this point, those are the only such models we expect to be available, at least during the beginning of Year 3.
In order to augment this progenitor set, and further explore the impact of rotation and magnetic fields across the range of potential CCSN progenitors, we will run four additional 3D CCSN simulations in the 1D magnetorotational progenitor models of \citep{heger:2005}.
These models include realistic rotation profiles and rough estimates of magnetic field strengths.
In order to increase the realism of these models in the absence of fully 3D evolution to core collapse, we will add multidimensional perturbations in the convective shells of these models using the vector spherical harmonics formalism of \citet{chatzopoulos:2014}.
Such an approach has been used in several recent studies \citep{oconnor:2018b, vartanyan:2019}.
We will select a range of progenitor compactnesses \citep{oconnor:2011, sukhbold:2018} in this study.
For these simulations, we will include inelastic neutrino scattering \citep{oconnor:2015, burrows:2016}.
Each simulation will cost about 100k node-hours to reach around 500 ms post-bounce.
Thus, we request a total of 500k node-hours and 80 TB of online storage for this milestone.

\subsection{Code Development}

For the planned Year 3 milestones above we require no further code development.
The only major relevant development effort we plan to undertake in Year 3 is to continue to adapt our \sparkmone application to the new AMReX-based FLASH5.
This version of FLASH is targeted at the exascale and is being supported by the DOE Exascale Computing Project.

\renewcommand\bibsection{\section*{References}}
\setlength{\bibsep}{2pt}
%\begin{multicols}{2}
\bibliography{AchievePlans}
%\end{multicols}

\end{document}


\chapter{Simulation}
\label{ch:simulation}
Since a real copter was not available for testing, 2 proof-of-concept simulation were performed. In the first one the controller has been used with an extended Kalman filter but no sensor has been used: the state of the copter is estimated by mean of the control signal and the model of the copter; the second simulation demonstrates the feasibility of a full Kalman filter update and predict behavior: an real AHRS sensor is used to update the state of the copter accordingly to the sensors data and a constant control signal.

\section{Kalman filter in predict-only mode}

The node core functionality is implemented in the extended Kalman filter and in the controller, a layout of the node is depicted in \autoref{fig:node040}. The set-point of the copter is computed by the node on the basis of 10 primitives that can be called via a tool that acts as remote controller for the copter, the communication between the node and the controller is realized via a TCP connection.\\
The controller block \texttt{ctrl} reads the copter state from the block \texttt{state} and the set-point from the block \texttt{setpoint} , than computes and store the control action in \texttt{ctrl\_action}. The Kalman filter block \texttt{kf\_pred\_cptr} in turns reads the state and the control action applied and write the estimate of the state back.

Other blocks are however necessary:
\begin{itemize}
	\item \texttt{ptrig1} is the i-block in charge to call all the c-block of the node (except the graphic dump) in an infinite loop with a period of 1ms;
	\item \texttt{tgj\_gen} is a c-block responsible for generating the current set-point: it receives the trajectory primitive from a tcp connection and computes the actual copter set-point as a function of the time;
	\item \texttt{state} is a i-block that store the state of the copter in virtual memory;
	\item \texttt{setpoint} is a i-block that store the set-point of the copter in virtual memory;
	\item \texttt{ctrl\_action} is a i-block that store the current applied control action in virtual memory;
	\item \texttt{timing} generates a virtual clock allowing to simulate the system beyond the actual computation capabilities of the computer platform.
	\item \texttt{graphic\_dump} opens a gtk 2-D graphic interface showing the position of the copter; a screenshot is reported in \autoref{fig:gfxdump1};
	\item \texttt{ptrig\_graphic} trigs \texttt{graph\_dump} with a period of 10 ms;
\end{itemize}

The configuration file of the node is here reported:

\begin{lstlisting}[language={[5.0]Lua},]
local bd = require("blockdiagram")

return bd.system {
  imports = {
    "types/stdtypes/stdtypes.so",
    "types/control/control_types.so",
    "blocks/ptrig/ptrig.so",
    "blocks/control/shm.so",
    "blocks/control/dump_ctrl.so",
    "blocks/copter/ctrl_copter.so",
    "blocks/copter/prim_trj_gen.so",
    "blocks/copter/kf_predict_copter.so",
    "blocks/control/dump_state.so",
    "blocks/copter/copter_graphic_dump.so",
    "blocks/control/dump_time_stat.so",
    "blocks/webif/webif.so",
  },

  blocks = {
    { name = "ptrig1" , type = "std_triggers/ptrig" },
    { name = "ptrig_graphic", type = "std_triggers/ptrig" },
    { name = "ctrl_action"  , type = "control/shm" },
    { name = "state"  , type = "control/shm" },
    { name = "setpoint"  , type = "control/shm" },
    { name = "ctrl" , type = "copter/ctrl_copter" },
    { name = "ctrl_dump" , type = "control/dump_ctrl" },
    { name = "state_dump" , type = "control/dump_state" },
    { name = "kf_pred_cptr" , type = "copter/kf_predict_copter" },
    { name = "tgj_gen" , type = "copter/prim_trj_gen" },
    { name = "graph_dump"  , type = "copter/copter_graphic_dump"    },
    { name = "timing"  , type = "control/dump_time_stat"    },
    { name = "webif1"  , type = "webif/webif"    },
  },

  connections = {
    { src="ctrl.ctrl_action" , tgt="ctrl_action" },
    { src="ctrl.ctrl_action" , tgt="ctrl_dump" },
    { src="state" , tgt="ctrl.state" },
    { src="setpoint" , tgt="ctrl.setpoint" },
    { src="kf_pred_cptr.stt_out" , tgt="state" },
    { src="kf_pred_cptr.stt_out" , tgt="state_dump" },
    { src="state" , tgt="kf_pred_cptr.stt_in"  },
    { src="ctrl_action" , tgt="kf_pred_cptr.ctrl_in" },
    { src="tgj_gen.setpoint_out"  , tgt="setpoint" },
    { src="state" , tgt="tgj_gen.state_in" },
    { src="state"      , tgt="graph_dump.state"  },
    { src="setpoint"    , tgt="graph_dump.setpoint"  },
  },

  configurations = {
    {
      name="webif1",
      config = { port="8888" },
    },
		{
			name="kf_pred_cptr" ,
			config = {
				mass		= 1 	,
				J_xx		= 0.01,
				J_yy		= 0.01,
				J_zz		= 0.01,
				dt		= 0.001	,
				process_noise	= 0	,
			},
		},
		{
			name="ctrl_action" ,
			config = {
				shm_name="/ctrl_action" ,
				type_name="struct ControlAction",
			},
		},
		{
			name="setpoint" ,
			config = {
				shm_name="/setpoint" ,
				type_name="struct SetPoint",
			},
		},
		{
			name="state" ,
			config = {
				shm_name="/state" ,
				type_name="struct State",
			},
		},
		{
			name="tgj_gen" ,
			config = {
				dt	= 0.001	;
				zmq_address = "tcp://127.0.0.1:8890"
			},
		},
		{
			name="ctrl" ,
			config = {
				mass		= 1	,
				inertia_xx	= 0.01,
				inertia_yy	= 0.01,
				inertia_zz	= 0.01,
				k1		= 1	,--0.9	,
				l1		= 5	,--5	,	-- i.e. max speed for static set-point
				k2		= 10	,--8	,
				l2		= 10	,--8	,
				kp		= 100	,
				kd		= 10	,
				hysteresis_thr	= 0.01	,
				max_thrust	= 20	,
				max_torque_xx	= 3	,
				max_torque_yy	= 3	,
				max_torque_zz	= 3	,
			},
		},
		{
			name="timing" ,
			config = {
				period		= 60*1000	;
				update_rate	= 0.001		;
			},
		},
		{
			name="ptrig1" ,
			config = {
				period = {sec=0, usec=1000 },
				trig_blocks={
					{ b="#ctrl"		, num_steps=1, measure=0 },
					{ b="#kf_pred_cptr"	, num_steps=1, measure=0 },
					{ b="#tgj_gen"		, num_steps=1, measure=0 },
					{ b="#timing"		, num_steps=1, measure=0 },
				},
			},
		},
		{
			name="graph_dump" ,
			config = {
				zoom = 5 ;
				max_q = 2 ;
			},
		},
		{
			name="ptrig_graphic" ,
			config = {
				period = {sec=0, usec=10000 },
				trig_blocks={
					{ b="#graph_dump"	, num_steps=1, measure=0 },
        },
      },
    },
  },
}
\end{lstlisting}
\subsection{Launching the node}
The node can be lunched by calling the script\\
\texttt{ubx-control/test/04-working\_ctrl/launch.sh}\\
This script also executes the gtk app \texttt{fake\_planner} specifying with an argument to connect to \texttt{tcp://127.0.0.1:8890} (obviusly the node is configured to listen at the same TCP address and port).
\graffito{The name of the remote controller executable is \texttt{fake\_planner} because there may be an actual \emph{mission} planner (or supervisor) controlling the drone instead of a human operator.}
Then the script launches and deploys the node. Messages from the node are dumped to the terminal but the state of the node can be also checked via a web interface at \texttt{http://127.0.0.1:8888}.

\newpage
\begin{figure}
	\centering
	\frame{\includegraphics[width=1\textwidth]{node04}}
	\caption{The node used for the simulation in predict-only mode}
	\label{fig:node040}
\end{figure}
\clearpage

\newpage
\begin{figure}
	\centering
	\frame{\includegraphics[width=0.3\textwidth]{fakeplanner}}
	\frame{\includegraphics[width=0.8\textwidth]{gfxdump1}}
	\caption{The remote controller HMI interface and the graphic dump of the copter state and set-point}
	\label{fig:gfxdump1}
\end{figure}
\clearpage

\section{Kalman filter in update mode}
The second simulation was performed in a configuration where the Kalman filter is used to update the estimate of the state of the vehicle by reading from an attitude and heading reference system (AHRS) \autocite{bib:wikiahrs}. This application is a proof-of-concept demonstration for sensor fusion and the controller has no role here, the control action is constant (i.e. no feedback) and manually tuned to make the copter hover. The Kalman filter then update the copter attitude with the data from the sensors and accordingly predict the estimate of the position too.\\
The AHRS used is a USB device from Hardkernel \autocite{bib:ahrsproduct}; it embeds a triple axis gyroscope, a triple axis accelerometer and a triple axis magnetometer, plus it embeds an extended Kalman filter (so data if pre-filtered and pre-fused); data can be read via a I2C or UART or USB serial interface. The i-block used to read is a bridge written in C++ named \texttt{sensor\_myAHRS} and can be found in the \texttt{ubx-control} project.

The node can be launched by executing:
\begin{lstlisting}[language=bash]
cd ubx-control/test/06_test_myAHRS/
ubx_launch -c 06.usc -d deploy.udc
\end{lstlisting}

As expected, if the AHRS is horizontal the Kalman filter will just correct the heading: since the AHRS embeds a magnetometer, the filter has been told to map the $x$ axis of the fixed reference frame the copter is moving in to the magnetic North.\\
If the AHRS is oriented, the copter will orient accordingly and will start moving around. Note that however the copter will loose elevation, since the controller generates no torque and just the thrust exactly sufficient to hover horizontally.\\

As in the previous simulation, it follows the configuration of the node:

\begin{lstlisting}[language={[5.0]Lua},]
local bd = require("blockdiagram")

return bd.system {
  imports = {
    "types/stdtypes/stdtypes.so",
    "types/control/control_types.so",
    "blocks/ptrig/ptrig.so",
    "blocks/webif/webif.so",
    "blocks/control/shm.so",
    "blocks/control/dump_ctrl.so",
    --"blocks/copter/ctrl_copter.so",
    "blocks/copter/prim_trj_gen.so",
    "blocks/copter/kf_predict_copter.so",
    "blocks/control/dump_state.so",
    "blocks/copter/copter_graphic_dump.so",
    "blocks/control/dump_time_stat.so",
    "blocks/control/sensor_myAHRS.so",
    "blocks/control/fake_ctrl.so",
    "blocks/control/kf_update.so",
  },

  blocks = {
    { name = "ptrig1"	, type = "std_triggers/ptrig"		},
    { name = "webif1"	, type = "webif/webif"				},
    { name = "ptrig_graphic", type = "std_triggers/ptrig"	},
	{ name = "ctrl_action"	, type = "control/shm"			},
	{ name = "state"	, type = "control/shm"				},
	{ name = "setpoint"	, type = "control/shm"				},
	{ name = "ctrl"		, type = "control/fake_ctrl"		},
	{ name = "ctrl_dump"	, type = "control/dump_ctrl"			},
	{ name = "state_dump"	, type = "control/dump_state"			},
	{ name = "kf_pred_cptr"	, type = "copter/kf_predict_copter"		},
	{ name = "tgj_gen"	, type = "copter/prim_trj_gen"				},
	{ name = "graph_dump"	, type = "copter/copter_graphic_dump"	},
	{ name = "timing"	, type = "control/dump_time_stat"		},
	{ name = "ahrs"       , type = "control/sensor_myAHRS"    	},
	{ name = "kf_upd"       , type = "control/kf_update"    	},
  },

  connections = {
	{ src="ctrl.control_out"	, tgt="ctrl_action"			},
	{ src="ctrl.control_out" 	, tgt="ctrl_dump"			},
	{ src="kf_pred_cptr.stt_out"	, tgt="state"			},
	{ src="kf_pred_cptr.stt_out"	, tgt="state_dump"		},
	{ src="state"			, tgt="kf_pred_cptr.stt_in"		},
	{ src="ctrl_action"		, tgt="kf_pred_cptr.ctrl_in"	},
	{ src="tgj_gen.setpoint_out"	, tgt="setpoint"		},
	{ src="state"			,tgt="tgj_gen.state_in"			},
	{ src="state"			, tgt="graph_dump.state"		},
	{ src="setpoint"		, tgt="graph_dump.setpoint"		},
	{ src="kf_upd.state_out"        , tgt="state_dump"              },
	{ src="kf_upd.state_out"        , tgt="state"                   },
	{ src="state"                   , tgt="kf_upd.state_in"         },
	{ src="ahrs"                     , tgt="kf_upd.sensor_in"       },
  },

  configurations = {
	{
		name="webif1",
		config = { port="8888" },
	},
	{
		name="kf_pred_cptr" ,
		config = {
			mass		= 1 	,
			J_xx		= 0.01,
			J_yy		= 0.01,
			J_zz		= 0.01,
			dt		= 0.001	,
			process_noise	= 0.01	,
		},
	},
  {
	name="ctrl_action" ,
	config = {
		shm_name="/ctrl_action" ,
		type_name="struct ControlAction",
    },
  },
  {
    name="setpoint" ,
    config = {
      shm_name="/setpoint" ,
      type_name="struct SetPoint",
    },
  },
  {
    name="state" ,
    config = {
      shm_name="/state" ,
      type_name="struct State",
    },
  },
  {
    name="tgj_gen" ,
    config = {
      dt	= 0.001	;
    },
  },
  {
    name="ctrl" ,
    config = {
      filepath_U="U",
    },
  },
  {
    name="ahrs",
    config = {
      device_path = "/dev/ttyACM0"	,
      quaternion_cov = 0.0001		,
    }
  },
  {
    name="kf_upd" ,
    config = {
      filepath_H	= "H"	,
    },
  },
  {
    name="timing" ,
    config = {
      period		= 60*1000	,
      update_rate	= 0.001		,
    },
  },
  {
          name="ptrig1" ,
          config = {
            period = {sec=0, usec=1000 },
            trig_blocks={
            { b="#ctrl"		, num_steps=1, measure=0 },
            { b="#kf_upd"		, num_steps=1, measure=0 },
            { b="#kf_pred_cptr"	, num_steps=1, measure=0 },
            { b="#tgj_gen"		, num_steps=1, measure=0 },
            { b="#timing"		, num_steps=1, measure=0 },
          },
        },

      },
      {
        name="graph_dump" ,
        config = {
        zoom = 5 ;
        max_q = 2 ;
      },

    },
    {
      name="ptrig_graphic" ,
      config = {
        period = {sec=0, usec=1000 },
        trig_blocks={
          { b="#graph_dump"	, num_steps=1, measure=0 },
        },
      },
    },
  },
}
\end{lstlisting}

\newpage
\begin{figure}
	\centering
	\frame{\includegraphics[width=1\textwidth]{node06}}
	\caption{The node used for the simulation in update mode}
	\label{fig:node060}
\end{figure}
\clearpage


%\documentclass[12pt]{article}
\documentclass[12pt,landscape]{article}

\include{preamble}

\newcommand{\instr}{\small Your answer will consist of a lowercase string (e.g. \texttt{aebgd}) where the order of the letters does not matter. \normalsize}

\title{Math 369 / 650 Fall \the\year{} \\ Midterm Examination Two}
\author{Professor Adam Kapelner}

\date{Wednesday, November 11, \the\year{}}

\begin{document}
\maketitle

%\noindent Full Name \line(1,0){410}

\thispagestyle{empty}

\section*{Code of Academic Integrity}

\footnotesize
Since the college is an academic community, its fundamental purpose is the pursuit of knowledge. Essential to the success of this educational mission is a commitment to the principles of academic integrity. Every member of the college community is responsible for upholding the highest standards of honesty at all times. Students, as members of the community, are also responsible for adhering to the principles and spirit of the following Code of Academic Integrity.

Activities that have the effect or intention of interfering with education, pursuit of knowledge, or fair evaluation of a student's performance are prohibited. Examples of such activities include but are not limited to the following definitions:

\paragraph{Cheating} Using or attempting to use unauthorized assistance, material, or study aids in examinations or other academic work or preventing, or attempting to prevent, another from using authorized assistance, material, or study aids. Example: using an unauthorized cheat sheet in a quiz or exam, altering a graded exam and resubmitting it for a better grade, etc.
\\

\noindent By taking this exam, you acknowledge and agree to uphold this Code of Academic Integrity. \\

%\begin{center}
%\line(1,0){250} ~~~ \line(1,0){100}\\
%~~~~~~~~~~~~~~~~~~~~~signature~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date
%\end{center}

\normalsize

\section*{Instructions}

This exam is 75 minutes (variable time per question) and closed-book. You are allowed \textbf{one} page (front and back) of a \qu{cheat sheet}, blank scrap paper and a graphing calculator. Please read the questions carefully. No food is allowed, only drinks. %If the question reads \qu{compute,} this means the solution will be a number otherwise you can leave the answer in \textit{any} widely accepted mathematical notation which could be resolved to an exact or approximate number with the use of a computer. I advise you to skip problems marked \qu{[Extra Credit]} until you have finished the other questions on the exam, then loop back and plug in all the holes. I also advise you to use pencil. The exam is 100 points total plus extra credit. Partial credit will be granted for incomplete answers on most of the questions. \fbox{Box} in your final answers. Good luck!

\pagebreak

\problem\timedsection{5} These are questions on method of moments estimators.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{11}

\begin{enumerate}[(a)]
\item For any DGP, $\thetahatmm$ will be a function of the data.
\item For any DGP, $\thetahatmm$ will be a function of the data and of $\theta$.
\item For any DGP, its fifth moment is $\expe{X^5}$ if it exists.
\item For any iid DGP with a finite expectation, $\thetahat = \Xbar := \oneover{n}\sum_{i=1}^n X_i$ is an MM estimator for the DGP's expectation.
\item For any iid DGP with a finite variance, $\thetahat = \sigsqhat := \oneover{n}\sum_{i=1}^n (X_i - \Xbar)^2$ is an MM estimator for the DGP's variance.
\item Let $\thetahatmm$ be an estimator for $\theta$. Its estimate $\thetahathatmm$ must be a legal value in the parameter space of $\theta$.
\item For an iid DGP with a finite variance where $\theta := \expe{X} / \sd{X}$, then $\thetahatmm = \Xbar / \sqrt{\sigsqhat}$ where $\Xbar$ and $\sigsqhat$ are defined in (d) and (e).\\

Consider a DPG $\Xoneton \iid \text{ShiftedParetoI}(1, \theta) := \theta (x + 1)^{-\theta - 1}$ which has support in positive numbers only. Using calculus you can show that $\expe{X} = \frac{1}{\theta - 1}$.
\item $\thetahatmm = \Xbar$
\item $\thetahatmm = 1 / \Xbar$
\item $\thetahatmm = 1 / \Xbar + 1$
\item $\thetahatmm = (\Xbar + 1) / \Xbar$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{13} Consider the DPG from the previous problem, $\iid \text{ShiftedParetoI}(1, \theta) := \theta (x + 1)^{-\theta - 1}$ which has support in positive numbers only and consider a dataset $\xoneton$ to be realizations from this DGP.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{19}

\begin{enumerate}[(a)]
\item The likelihood for all the data is $=\theta (\xoneton + 1)^{-\theta - 1}$.
\item The likelihood for all the data is $=\prod_{i=1}^n \theta (x_i + 1)^{-\theta - 1}$.
\item The log likelihood for all the data is $=\prod_{i=1}^n \theta (\natlog{x_i} + 1)^{-\theta - 1}$.
\item The log likelihood for all the data is $=\natlog{\prod_{i=1}^n \theta (x_i + 1)^{-\theta - 1}}$.
\item The log likelihood for all the data is $=n\natlog{\theta} + \natlog{(-\theta - 1)\prod_{i=1}^n  (x_i + 1)}$.
\item The log likelihood for all the data is $=n\natlog{\theta} + (-\theta - 1) \sum_{i=1}^n  \natlog{x_i + 1}$.
\item The score function for all the data is the derivative of the log likelihood function.
\item The deriviative of the log likelihood for all the data is $=\frac{n}{\theta} - \sum_{i=1}^n  \natlog{x_i + 1}$.
\item Assuming (h) is true, $\thetahathatmle = n \Big/ \sum_{i=1}^n  \natlog{x_i + 1}$.
\item The Fisher information for this DGP is $I(\theta) = 1$.
\item The Fisher information for this DGP is $I(\theta) = n / \theta^2$.
\item The Fisher information for this DGP is $I(\theta) = -1 / \theta^2$.
\item The Fisher information for this DGP is $I(\theta) = 1 / \theta^2$.
\item The variance of any unbiased estimator for $\theta$ for this DGP must be at least $1 / n$.
\item The variance of any unbiased estimator for $\theta$ for this DGP must be at least $\theta / n$.
\item The variance of any unbiased estimator for $\theta$ for this DGP must be at least $\theta^2 / n$.
\item To show that $\thetahatmle$ is/isn't the UMVUE for $\theta$ involves simple algebra / calculus on information available to you on this page.
\item To show that $\thetahatmle$ is/isn't the UMVUE for $\theta$ involves a lot of algebra / calculus but the information you require is available to you on this page.
\item To show that $\thetahatmle$ is/isn't the UMVUE for $\theta$ is impossible given the information available to you on this page.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{6} \ingray{Consider the DPG from the previous problem, $\iid \text{ShiftedParetoI}(1, \theta) := \theta (x + 1)^{-\theta - 1}$ which has support in positive numbers only and consider a dataset $\xoneton$ to be realizations from this DGP.} Let $\sigsq$ denote the variance of this DGP model. You can show that $\thetahathatmle = n \Big/ \sum_{i=1}^n  \natlog{x_i + 1}$ and $I(\theta) = 1 / \theta^2$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{13}

\begin{enumerate}[(a)]
\item $\var{\thetahatmle} = \theta^2 / n$.
\item $\thetahatmle$ is normally distributed.
\item $\thetahatmle$ is distributed as a Student's $t$ distribution.
\item $\thetahatmle$ is an asymptotically normally estimator.
\item $\thetahatmle \approxdist \normnot{0}{1}$.
\item $\thetahatmle \approxdist \normnot{\theta}{\sigsq / n}$.
\item $\thetahatmle \approxdist \normnot{\theta}{\oneover{n\theta^2}}$.
\item You can use the fact in (g) to create a confidence interval for $\theta$ (i.e. a function of $\xoneton$ and constants).
\item $\thetahatmle \approxdist \normnot{\theta}{\squared{\oversqrtn{\theta}}}$.
\item You can use the fact in (i) to create a confidence interval for $\theta$ (i.e. a function of $\xoneton$ and constants).
\item $\thetahatmle \approxdist \normnot{\thetahathatmle}{\squared{\oversqrtn{\thetahathatmle}}}$.
\item You can use the fact in (k) to create a confidence interval for $\theta$ (i.e. a function of $\xoneton$ and constants).
\item $\thetahatmle$ can provide arbitrary precision to measure $\theta$ given a higher sample size $n$.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

%\problem\timedsection{4} Consider the DGP $\Xoneton \iid U(0, \theta)$. We showed in class that $\thetahatmm = 2\Xbar$ and $\thetahatmle = \max{\Xoneton}$.
%
%\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{5}
%
%\begin{enumerate}[(a)]
%\item $\thetahathatmm > \thetahathatmle$.
%\item $\bias{\thetahatmm} = 0$.
%\item $\var{\thetahatmm} > \var{\thetahatmle}$.
%\item $\mse{\thetahatmm} > \mse{\thetahatmle}$.
%\end{enumerate}
%\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{6} Consider $\xoneton$ to be realizations from an iid DGP, $\thetahat$ to be an unbiased estimator for $\theta$ and assume the conditions needed to prove the Cramer-Rao Lower Bound (CRLB). A quantity primed (e.g. $\ell'$) denotes differentiation with respect to $\theta$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{7}

\begin{enumerate}[(a)]
\item ${\ell'\parens{\thetahat; \xoneton}} = 0$
\item $\expe{\ell\parens{\theta; \Xoneton}} = 0$
\item $\expe{\ell\parens{\theta; \Xoneton}} = n\expe{\ell\parens{\theta; X}}$
\item $\expe{\ell\parens{\theta; \Xoneton}^2} = 0$
\item $\expe{\ell'\parens{\theta; \Xoneton}^2} = 0$
\item $\partialop{\theta}{\expe{\ell\parens{\theta; \Xoneton}}} = 0$
\item $\var{\ell\parens{\theta; \Xoneton}^2} = 0$
\item $\var{\ell'\parens{\theta; \Xoneton}^2} = nI(\theta)$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

%\problem\timedsection{4} These are some questions about some theorems we discussed in class. Let $X_1, X_2, ... $ be rv's and $a_1, a_2, ...$ be constants.
%
%\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{5}
%
%\begin{enumerate}[(a)]
%\item If $X_1 \convp a_1$, then $\natlog{X_1} \convp \natlog{a_1}$.
%\end{enumerate}
%\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{5} These are some questions about some theorems we discussed in class. Let $X_1, X_2, ... $ be rv's indexed also by $n$, the sample size, and $a_1, a_2, ...$ be positive constants.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{6}

\begin{enumerate}[(a)]
\item If $X_1 \convp a_1$, then $\natlog{X_1} \convp \natlog{a_1}$.
\item If $X_1 \convp a_1$, then $\displaystyle\oneover{X_1} \convp \oneover{a_1}$.
\item If $X_1 \convp a_1$ and $\displaystyle \frac{X_2 - \mu}{a_1} \convd \stdnormnot$ then $\displaystyle\frac{X_2 - \mu}{X_1} \convd \stdnormnot$
\item If $\displaystyle \frac{X_1 - \mu}{a_1} \sim \stdnormnot$ then $\displaystyle\frac{(X_1 - \mu)^2}{a_1^2} \sim \stdnormnot$
\item If $\displaystyle \frac{X_1 - \mu}{a_1} \sim \stdnormnot$ then $\displaystyle\frac{(X_1 - \mu)^2}{a_1^2} \sim \chisq{n}$
\item If you do a one-sample t test with $n=20$ and get a standardized estimate of -2.30. If the square of this estimate is less than 95\% quantile of the $F_{1,19}$ distribution, then you retain $H_0$.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{7} According to Benford's Law in Base 10, in any measurement setting that spans orders of magnitude, the first digit of measurements is more likely to be a one than a two, a two than a three, etc. This phenomenon is ubiquitous and can be used to describe measurements for city populations, surface area of rivers, dollar amounts on tax returns, etc. The distribution is on the first row of the table below.

Here we investigate possible fraud in the 2009 Iranian election, a topic of many academic papers. We examine the vote counts in the 366 districts for one of the five main candidates and count the number of districts who's count had first digit = 1, first digit = 2, ..., first digit = 9. The tally is the second row of the table below.

\begin{table}[htp]
\centering
\begin{tabular}{l|ccccccccc|c}
& \multicolumn{9}{c}{First Digit is $x = $} &\\
 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & Total \\\hline\hline
Benford's Law in Base 10 $p_X(x) = $ & .301 & .176 & .125 & .097 & .079 & .067 & .058 & .051 & .046 & 1.000 \\\hline
Observed Count & 125 & 57 & 44 & 29 & 24 & 16 & 41 & 13 & 17 & 366\\
\ingray{Row 3 Name} & 110.17 & 64.42 & 45.75 & 35.50 & 28.91 & 24.52 & 21.23 & 18.67 & 16.84 & ?\\
\ingray{Row 4 Name}  & 2.00 & 0.85 & 0.07 & 1.19 & 0.83 & 2.96 & 18.42 & 1.72 & 0.00 & ?
\end{tabular}
\end{table}
\FloatBarrier

We wish to test if the voting counts \emph{differ} from Benford's Law at $\alpha = 5\%$. Let $\theta_1$ denote the true probability of a count having a first digit = 1, $\theta_2$ denote the true probability of a count having a first digit = 2, ..., $\theta_9$ denote the true probability of a count having a first digit = 9. Note: $F_{\chisq{8}}(15.51) = F_{\chisq{9}}(16.92) = F_{\chisq{24}}(36.42) = F_{\chisq{27}}(40.11) = 95\%$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{9}

\begin{enumerate}[(a)]
\item This test is a \qu{goodness of fit} test.
\item This test is an \qu{independence} of $\geq 2$ events test.
\item The number of parameters in Benford's Law in Base 10 is 8.
\item $H_0: \theta_1 = \theta_2 = \ldots = \theta_9 = 1/9$.
\item $H_0:$ The $\theta_k$'s are equal to the values in the table's first row.
\item $H_a: \theta_1 = \theta_2 = \ldots = \theta_9 = 1/9$.
\item $H_a:$ at least one $\theta_k$ is not equal to the value in the table's first row.
\item The name of row 3 could be \qu{expected number of first digits in the district counts under Benford's Law in Base 10}.
\item The name of row 4 could be \qu{expected number of first digits in the district counts under Benford's Law in Base 10}.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{7} \textbf{This header is the same as in the previous problem.} According to Benford's Law in Base 10, in any measurement setting that spans orders of magnitude, the first digit of measurements is more likely to be a 1 than a 2, a 2 than a 3, etc. This phenomenon is ubiquitous and can be used to describe measurements for city populations, surface area of rivers, dollar amounts on tax returns, etc. The distribution is on the first row of the table below.

Here we investigate possible fraud in the 2009 Iranian election, a topic of many academic papers. We examine the vote counts in the 366 districts for one of the five main candidates and count the number of districts who's count had first digit = 1, first digit = 2, ..., first digit = 9. The tally is the second row of the table below.

\begin{table}[htp]
\centering
\begin{tabular}{l|ccccccccc|c}
& \multicolumn{9}{c}{First Digit is $x = $} &\\
 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & Total \\\hline\hline
Benford's Law in Base 10 $p_X(x) = $ & .301 & .176 & .125 & .097 & .079 & .067 & .058 & .051 & .046 & 1.000 \\\hline
Observed Count & 125 & 57 & 44 & 29 & 24 & 16 & 41 & 13 & 17 & 366\\
\ingray{Row 3 Name} & 110.17 & 64.42 & 45.75 & 35.50 & 28.91 & 24.52 & 21.23 & 18.67 & 16.84 & ?\\
\ingray{Row 4 Name}  & 2.00 & 0.85 & 0.07 & 1.19 & 0.83 & 2.96 & 18.42 & 1.72 & 0.00 & ?
\end{tabular}
\end{table}
\FloatBarrier

We wish to test if the voting counts \emph{differ} from Benford's Law at $\alpha = 5\%$. Let $\theta_1$ denote the true probability of a count having a first digit = 1, $\theta_2$ denote the true probability of a count having a first digit = 2, ..., $\theta_9$ denote the true probability of a count having a first digit = 9. Note: $F_{\chisq{8}}(15.51) = F_{\chisq{9}}(16.92) = F_{\chisq{24}}(36.42) = F_{\chisq{27}}(40.11) = 95\%$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{7}

\begin{enumerate}[(a)]

\item The Pearson chisq statistic has an estimate = 366.00.
\item The Pearson chisq statistic has an estimate = 28.04.
\item The Pearson chisq statistic estimator here is asymptotically $\chisq{24}$.
\item The Pearson chisq statistic estimator here is asymptotically $\chisq{8}$.
\item If (d) were to be true, the retainment region for the estimate would be $\bracks{-15.51, +15.51}$.
\item $H_0$ is rejected and we conclude that the counts for this specific candidate is \emph{not} Benford-Law-distributed.
\item Assuming (f), the digit that is most incongruent with Benford's law is $x=9$.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\begin{figure}
\centering
\includegraphics[width = 6in]{windspeeds.pdf}
\end{figure}

\problem\timedsection{10} Above is a histogram of wind speeds at JFK airport measured at midnight for every day in 2013. We fit eight different iid DGPs / models to this data. Below are the models, the maximum likelihood estimates for their parameter(s) and their log likelihood value estimates:

\begin{table}[htp]
\centering
\begin{tabular}{r|cccccccc}
& \multicolumn{8}{c}{Name of Model / DGP}\\
 & Exponential & Normal & Weibull & Gamma & Gumbel & Gompertz & Frechet & Generalized Logistic \\\hline
$\thetahathatmle_1$ & 0.05 & 18.97 & 3.52 & 11.71 & 15.17 & 0.14 & 3.18 & 3.49 \\
$\thetahathatmle_2$ &  & 5.59 & 21.01 & 0.62 & 4.84 & 0.05 & 15.59 & 12.22 \\
$\thetahathatmle_3$ &  &  &  &  &  &  &  & 4.03 \\ \hline
$\ell(\thetahathatmle_1, \ldots, \thetahathatmle_{K_m}; \xoneton)$ & -1435.12 & -1142.72 & -1148.11 & -1129.28 & -1143.31 & -1200.26 & -1174.37 & -1129.65
\end{tabular}
\end{table}
\FloatBarrier

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{9}

\begin{enumerate}[(a)]
\item All of these models have the same number of parameters $K$.
\item The true model will be one of these eight models candidates.
\item According to the log-likelihood estimates, the best fitting model candidate is the Gamma.
\item According to the AICC metric, the best fitting model candidate is the Generalized Logistic.
\item The asymptotic bias on the true log-likelihood for the normal model is the same as the bias for the Gompertz model.
\item The AIC metric for the generalized logistic model candidate is 2263.30. %false
\item The AIC metric for the exponential model candidate is 2872.24. %true
\item Assuming (b), the probability the exponential model is the true model is negligibly small.
\item AICC values will not significantly differ from the AIC values.
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\problem\timedsection{16} In the \qu{Topiramate for the Treatment of Binge Eating Disorder Associated With Obesity: A Placebo-Controlled Study}, the researchers were also interested in adverse effects of the drug Topiramate. One such bad effect is \qu{Upper Respiratory Tract Infection} which we call \emph{infection}. The experimental results are below.

\begin{itemize}
\item In the $n_T = 202$ Topiramate group, there were 75 cases of infection and
\item in the $n_C = 202$ placebo group that did not take Topiramate, there were 40 cases of infection.
\end{itemize}
Let $\theta_T$ be the true proportion of infection in Topiramate-takers and $\theta_C$ be the true proportion of infection among non Topiramate-takers.  All numbers below are rounded to the nearest 3 digits.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{13}

\begin{enumerate}[(a)]
\item When testing $H_a: \theta_T \neq \theta_C$ at $\alpha = 5\%$, a retainment region for $H_0$ is equal to or is approximately $\bracks{-0.086, 0.086}$.%true
\item When testing $H_a: \theta_T \neq \theta_C$ at $\alpha = 5\%$, a retainment region for $H_0$ is equal to or is approximately $\bracks{-0.088, 0.088}$.%true
\item $CI_{\theta_T - \theta_C, 95\%}$ is equal to or is approximately $\bracks{0.087, 0.260}$.%true
\item There is a 95\% chance that the CI estimate in (c) contains the true mean difference $\theta_T - \theta_C$.
\item The estimate of the odds against infection in the Topiramate group is 1.693. %true
\item The estimate of the odds against infection in the Topiramate group is 0.591. %false
\item When testing $H_a: \displaystyle \frac{1 - \theta_T}{\theta_T} \neq \half$ at $\alpha = 5\%$, a retainment region for $H_0$ is equal to or is approximately $\bracks{0.224, 0.776}$.%true
\item The estimate of the risk ratio of infection in the Topiramate group vs the control group is 0.173.%false
\item The estimate of the risk ratio of infection in the Topiramate group vs the control group is 1.875.%true
\item $CI_{\theta_T / \theta_C, 95\%}$ is equal to or is approximately $\bracks{1.255, 2.495}$.%true
\item $CI_{\theta_T / \theta_C, 95\%}$ is equal to or is approximately $\bracks{-0.088, 0.088}$.%false
\item It would be possible to create an exact CI for the risk ratio of infection in the Topiramate group vs the control group given the data here and the concepts learned in class.%false
\item The CI estimator in (j) is more approximate in coverage probability than the CI estimator in (c).
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%