STAT 624: Statistical Computation

Dr. Robert Richardson
Brigham Young University
Winter 2023

  Syllabus
Homework 9 is active.
Homework Link Due Date
Homework 1 September 16 at 6:00 p.m.
Homework 2 September 23 at 6:00 p.m.
Homework 3 September 30 at 6:00 p.m.
Homework 4 October 10 at 11:59 p.m.
Homework 5 October 17 at 11:59 p.m.
Homework 6 October 26 at 11:59 p.m.
Homework 7 November 7 at 11:59 p.m.
Homework 8 November 22 at 11:59 p.m.
Homework 9 December 14 at 11:59 P.M.


Best Practices Grading (10 points available in every assignment)

Python for R users: Slides
2017 Final
2018 Midterm
2018 Final

Video: Final 2018
2019 Midterm
R solution: Code using this data: Data
Video: Midterm 2019

Video: Final 2019
2020 Midterm
R solution: Code
2023 Midterm
R solution: Code

Project

November 20th: Lecture
November 21st: Lecture
November 29th: Lecture


Class Material

Overview of course: Computing in the department and getting set up:
Introduction to vi. Basic UNIX commands: cd; ls; mkdir; rm; rm -r; cp; vi; mv; scp

Setting up account for git access. Use the following terminal commands and just press enter when given any options: Email the output starting from ssh-rsa and ending with net.id@rencher
R: An Introduction to R.
Python: An Introduction to Python.
More on tmux. Cheat Sheet


Clone your personal git repository Read-only STAT 624 general git repository:

Git: A free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Submitting Homework Note: Check git status before each step while you are getting used to it.
Latex: Introduction

Simulation Studies: A Comprehensive Insight



Explore More: Monte Carlo Integration
Best Coding Practices:
This is demonsrated in good_form.R and good_form.py. The opposite extreme is in bad_form.R and bad_form.py


When your code isn't working, what are your options? Here are some debugging tips: I personally like this list: https://blog.hartleybrody.com/debugging-code-beginner/

The code find_the_bugs.R and find_the_bugs.py is code for a simulation study to test the effect of an outlier on regression coefficient confidence interval coverage. But it doesn't work. Use these principles too find out why!
Parallel Computing

Before we delve into the simulations and tests, let's review some important terms:

Hypothesis Testing and Power Calculation via simulation:

Permutation Tests:

MC integration of a generic function.
MC Integration Simulation in R
and Python

Numerical integration.
Root finding methods.
Optimization.
Optimization.
Video for class: 10-18
Video for class: 10-20
Markov chain Monte Carlo.
More Markov chain Monte Carlo.
More Markov chain Monte Carlo.
Intro to C and C++: sum.c and sd.c
Integrating C++ and R


Importance Sampling: Algorithm
  • comp.R and mvnorms.cpp
  • Perform inference for covariance parameters in a spatial model
  • spatial.R and mnlik.cpp