Math 237 - Midterm Fall 2006
NOTE: The questions on this exam does not exactly reect which questions will be on this
semesters midterm. That is, some questions asked on this midterm may not be asked on our
midterm and there may be some questions on our mi
Bayesian VS Frequentists
Ali Ghodsi
Computational Statistics and Data Analysis STAT 341
Frequentists
Probability is objective and refers to the limit of an events
relative frequency in a large number of trials. For example, a
coin with a 50% probability o
Computational Statistics and Data Analysis
STAT 341
Ali Ghods
University of Waterloo
September 17, 2015
Ali Ghods
Computational Statistics and Data Analysis STAT 341
Multiplicative Congruential Method
One way to generate pseudo random numbers from the uni
Computational Statistics and Data Analysis
STAT 341
Ali Ghods
University of Waterloo
Ali Ghods
Computational Statistics and Data Analysis STAT 341
Multiplicative Congruential Method
One way to generate pseudo random numbers from the uniform
distribution i
Example Continuous Case
Sample from Beta(2,1)
In general:
Beta(, ) =
(+)
()()
x 1 (1 x)1 ,0 < x < 1
Ali Ghods
Computational Statistics and Data Analysis STAT 341
Note: (n) = (n 1)! if n is a positive integer
f (x)
= Beta(2, 1)
=
(3)
x 1 (1
(2)(1)
2!
= 1!
Sampling from Gamma Distribution
If X Gamma( , ), then its pdf is of the form:
Shape Scale
f (x) =
x 1 e x
,
()
x 0
A Gamma distribution with an integer shape parameter say = m is
also called an Erlang distribution denoted by Erl(m, )
Ali Ghods
Computatio
LECTURE 3: Review of Linear Algebra and MATLAB
Vector and matrix notation
g Vectors
g Matrices
g Vector spaces
g Linear transformations
g Eigenvalues and eigenvectors
primer
g MATLAB
g
Introduction to Pattern Analysis
Ricardo Gutierrez-Osuna
Texas A&M Un
1 Random Vector Generation
We want to sample from X = ( X1 , X2 , . . . , Xd ) , a d-dimensional vector from a known
pdf f ( x ) and cdf F ( x ) . Consider the following two cases:
Case 1: if the x1 , x2 , xd s are independent, then
f ( x ) = f ( x1 , , x
1 Basic Monte Carlo Integration
We consider three integration methods in this course:
Basic Monte Carlo Integration
Importance Sampling
Markov Chain Monte Carlo (MCMC)
The rst, and most basic, method of numerical integration is Basic Monte Carlo Integr
Computational Statistics and Data Analysis
STAT 341
Practice Questions Set 2 - Solutions
1. The LCG under consideration is xk+1 (15xk + 4) mod 7
(a) Check the three conditions of the theorem:
b = 4, m = 7; given b and m do not share common prime factors,
Computational Statistics and Data Analysis
STAT 341
Practice Questions Set 2
1. Recall that a linear congruence generator (LCG) is of the form
xk+1 (axk + b) mod m
where a, b, m and x0 is the seed of the congruence relationship. The period of the LCG is d
Please fill in this answer sheet and attach it after your cover page and your procedure sheets.
(1) Please assume Y is numerical and please use 5-fold cross-validation to find the optimal K for a
K-nearest neighbor regression. Show your cross-validated re
Computational Statistics and Data Analysis
STAT 341
Assignment 2
Due: Tuesday October 13 before 4pm in drop box 15 located in the 4th floor of MC
Policy on Lateness: No late assignment will be accepted.
1. Given the acceptance-rejection method for generat
Computational Statistics and Data Analysis
STAT 341
Assignment 5
Due: Monday November 23 before 12pm in drop box 15 located in the 4th floor of MC
Policy on Lateness: No late assignment will be accepted.
1. Use the Metropolis-Hastings algorithm and write
Computational Statistics and Data Analysis
STAT 341
Assignment 3
Due: Tuesday October 27 before 12pm in drop box 15 located in the 4th floor of MC
Policy on Lateness: No late assignment will be accepted.
1. Use simulation to approximate the following inte
Computational Statistics and Data Analysis
STAT 341
Assignment 1
Due: Thursday October 1 before 4pm in drop box 15 located in the 4th floor of MC
Policy on Lateness: No late assignment will be accepted.
For questions 2, 3 and 4 in this assignment, please
Computational Statistics and Data Analysis
STAT 341
Assignment 4
Due: Tuesday November 10 before 12pm in drop box 15 located in the 4th floor of MC
Policy on Lateness: No late assignment will be accepted.
1. Let X0 , X1 , be a Markov chain with states cfw
Computational Statistics and Data Analysis
STAT 341
Practice Questions
1. Let X1 , . . . , Xn be iid random variables with cdf F . Generate random variables X(n)
and X(1) that are distributed according to the order statistics max(X1 , . . . , Xn ) and
min
Computational Statistics
and
Data Analysis
STAT341
Instructor: Ali Ghodsi
Two Paradigms
Classical Statistics
Infer information from small data sets (Not
enough data)
Machine Learning
Infer information from large data sets (Too
many data)
We are drowning