STAT 624: Statistical Computation

Dr. Robert Richardson
Brigham Young University
Fall 2024

Syllabus

Homework 9 is active.

Homework Link Due Date
Homework 1 September 14 at 8:30 p.m.
Homework 2 September 21 at 10:00 p.m.
Homework 3 October 1 at 11:59 p.m.
Homework 4 October 12 at 11:59 p.m.
Homework 5 October 24 at 11:59 p.m.
Homework 6 November 2 at 11:59 p.m.
Homework 7 November 12 at 11:59 p.m.
Homework 8 November 26 at 11:59 p.m.
Homework 9 December 11 at 11:59 P.M.

Grading Best Practices (10 Points Total)

Python for R Users: Slides

Available Exams and Solutions

2017 Final Exam

2018 Midterm Exam

2019 Midterm Exam

Solution Code: Problem1.R

Data: growth.csv

Solution Video: Midterm 2019 Video

2020 Midterm Exam

Solution Code: 624_midterm_2020_code.R

2023 Midterm Exam

Solution Code: 624_midterm_2023_code.R

Fall 2023 Course Project

Project Details and Requirements

Labs and Solutions




Class Material

Overview of the Course

Computing in the Department

Steps to get set up:

Introduction to vi

Familiarize yourself with basic UNIX commands:

cd, ls, mkdir, rm, rm -r, cp, vi, mv, scp

For off-campus access, install the VPN client.

Introduction to R and Python

Using Scripts in Batch Mode

Learn to run scripts in batch mode for R and Python.

Working with tmux

Configuration Files

Setting Up Git for STAT 624

  1. Generate an SSH key:
    • Run: ssh-keygen -C "your.email@example.com"
    • Accept the default file location or specify your own.
    • Optional: Provide a passphrase or press Enter to skip.
  2. Add your SSH key to GitHub:
    • View your key: cat ~/.ssh/id_rsa.pub
    • Copy the output and add it to GitHub under Settings > SSH and GPG Keys.
  3. Clone repositories:
    • General Repository: git clone git@github.com:BYU-STAT624/general_624.git
    • Personal Repository: git clone git@github.com:BYU-STAT624/"net_id".git

Submitting Homework

Tip: Use git status often to check for changes.

LaTeX Resources

Best Coding Practices

Examples:

Debugging Tips

Recommended Resource: Debugging for Beginners

Practice Debugging:

Monte Carlo Integration

Learn the foundational concepts of Monte Carlo integration and its applications in statistical computation.

Slides: Monte Carlo Integration Slides

Examples:

Parallel Computing in Monte Carlo Integration

Learn how to speed up Monte Carlo computations using parallelization techniques.

Explore Monte Carlo integration for generic functions using both R and Python.

Article: MC Integration for Generic Functions

Watch the instructional video: Monte Carlo Integration Video

Goals for This Unit

Evaluation Metrics

Algorithms are evaluated based on the following criteria:

Numerical Integration Techniques

Learn how to perform numerical integration using the trapezoidal rule.

Root Finding Methods

Explore different algorithms for finding roots of equations:

Example Code:

Introduction to Optimization

Learn about maximum likelihood estimation (MLE) and optimization techniques.

Multivariate Parameter Estimation

Techniques for optimizing multivariate functions.

Resampling Techniques

Special Considerations in Optimization

Markov Chain Monte Carlo (MCMC) and Sampling Techniques

Understand the principles of acceptance-rejection sampling.

Explore the basics of Markov Chain Monte Carlo methods and their applications.

Recommended Reading:

Learn about Gibbs sampling, a popular MCMC technique.

Explore advanced MCMC techniques and applications in statistical modeling.

November 25th Lecture: 11_25.mp4

Introduction to C and C++

Learn the basics of programming in C and C++ for numerical computations.

Integrating C++ with R Using Rcpp and Sugar

Learn how to use Rcpp to integrate C++ code into R for efficient computations.

Linear Algebra with RcppArmadillo

Utilize the RcppArmadillo library for high-performance linear algebra in R.

Importance Sampling

Learn how to perform importance sampling with efficient algorithms:

Importance Sampling Algorithm

Spatial Data Modeling with Rcpp

Use Rcpp for inference on covariance parameters in spatial models.