HW3
Zahra Razaee
Sunday, May 15, 2016
Problem 1
(1)
Z
Eg [h(X)W (X)] =
h(x)w(x)g(x)dx
Z
h(x)
=
f (x)
g(x)dx
g(x)
Z
h(x)f (x)dx = Ef [h(X)]
=
(2)
Z
Eg [W (X)] =
Z
w(x)g(x)dx =
f (x)
g(x)dx =
g(x)
Z
f (x)dx = 1
(3)
n
=
E(I)
1X
E[h(Xi )wi ] = Eg [h(X)W (X)]
STATS102C Lecture Notes
Ying Nian Wu
April 20, 2016
Contents
1
Introduction
Monte Carlo: European Las Vegas
S. Ulam: complained about his uncle going to Monte Carlo
N. Metropolis (colleague): named sampling method as Monte Carlo method
1.1
Three important
Solutions 1
Levon Demirdjian
Friday, April 15, 2016
Problem 1
a <- 7^5
b <- 0
m <- 2^31-1
# Linear congruential method
my_uniform <- function(size, seed)cfw_
x <- rep(0, size)
x[1] <- seed
for(i in 1:(size - 1)cfw_
x[i+1] = (a * x[i] + b) % m
U <- x/m #s
STATS 102C HW5 due Thursday in class
Problem 1: Consider a joint distribution p(x, y), where both x and y take values in a finite set,
P
so P (X = x, Y = y) = p(x, y). Let pX (x) = P (X = x) = y p(x, y). Let pY (y) = p(Y = y) =
P
x p(x, y). Let p(x|y) = P
Solutions 4
Levon Demirdjian
Tuesday, May 24, 2016
Problem 1
(1)
p(t+1) (y) = p(Xt+1 = y)
X
=
p(Xt = x)P (Xt+1 = y|Xt = x)
x
=
X
p(t) (x) K(x, y)
x
Population migration interpretation: Suppose that there are currently p(t) (x) people in state x for each
s
Solutions 2
Levon Demirdjian
Tuesday, April 26, 2016
Problem 1:
1) This is a different approach to the problem than the one in your class notes. The polar method generates
iid
two copies of independent random variables, (X, Y ) N (0, 1). By independence,
STATS 102C HW3 due Thursday in class
R
Problem 1: Let X f (x). Let I = h(x)f (x)dx = Ef [h(X)]. Suppose we draw iid copies X1 ,
., Xn from g(x), which is different from f (x). Define W (x) = f (x)/g(x).
(1) Prove Ef [h(X)] = Eg [h(X)W (X)].
(2) Prove Eg [
STATS 102C HW1 due next Thursday in class
Notes: (1) Please turn in the printed code and outputs. (2) Please write your own code. Do not
copy from others. (3) For this homework, please do not call any built-in random number generators
in R.
Problem 1: Wri
STATS 102C HW2 due next Tuesday in class
Problem 1: Polar method. Let (X, Y ) N(0, 1) independently. Let X = R cos and Y = R sin .
(1) Find the joint distribution of R and .
(2) Based on (1), write R code for generating N(0, 1) random variables. You can o
STATS 102C HW4 due Thursday in class
Problem 1: For a Markov chain on a finite state space, let K(x, y) = P (Xt+1 = y|Xt = x) be
the transition probability, and let p(t) (x) = P (Xt = x) be the marginal distribution. Prove
P
(1) p(t+1) (y) = x p(t) (x)K(x
arXiv:1001.2906v1 [stat.ME] 17 Jan 2010
Christian Robert
Universit Paris-Dauphine
e
and
George Casella
University of Florida
Introducing Monte Carlo Methods with R
Solutions to Odd-Numbered Exercises
January 17, 2010
Preface
The scribes didnt have a large
STATS 102C: Monte Carlo Methods
TR 2pm-3:15pm, MS 5200
Instructor: Ying Nian Wu (ywu@stat.ucla.edu)
Office: 8971 Math Sciences Bldg, office hours: TR 3:30-4:30pm
Topics
Random number generation
Monte Carlo integration
Importance sampling
Theory of Markov
Stat 102C - Practice Final Solutions
Levon Demirdjian
May 28, 2016
Problem 1
1) FX (t) =
Rt
0
5x4 dx = t5 .
1
2) FX
(u) = u1/5 .
1/5
3) Set Xi = Ui
, i = 1, ., n. Then Xi will follow our desired distribution.
X <- runif(10000)^(1/5)
hist(X, prob = T)
curv