Académique Documents
Professionnel Documents
Culture Documents
Methods
By Marc Sobel
I ( g ) g ( x) p ( x)dx
by
1 n
g( Xi )
n i 1
Importance Sampling is
(sometimes) the answer!!
1 n g( Xi )
p( X i )
I ( g ) n i 1 h( X i )
1 n p( X i )
n i 1 h( X i )
p( X i )
wi
h( X i )
The quantities
are the
i=1,,n
1 n g( Xi )
p ( x ) h( x)dx
p( X i )
h( x )
I ( g ) n i 1 h( X i )
1 n p( X i )
p ( x )
h( x)dx
n i 1 h( X i )
h( x)
= g(x)p(x)dx
Project
Q ( x)
1000
1000 2000
exp
f , , ( x)
( x ) 2
1
2
t4 ( zi )
wi
; (i=1,...,n)
( zi )
zz= normrand(0,1,500,1);
w= tpdf(zz,4)./normpdf(zz);
ww = w/sum(w);
tt= randsample(zz,500,true,w)
Rejection Sampling is
sometimes the answer!!
Rejection Sampling
Rejection Sampling
Rejection Sampling:
The Key
f ( x)
P U
| x q ( x)
cq ( x )
f ( x )
x |U
cq ( x )
C
f ( x)
q ( x)
cq ( x)
=
f ( x)
C
x 2
1
exp x 3
2
2
3
3
2
exp x
1 (3)
2
3 1 (3) 2 2
for x>3
num=0;
c=3/(2*sqrt(2*pi));
for ii=1:1000
zz=0;
while zz<3,
zz=exprnd(2/3);
end
w=normpdf(zz)/(c*exppdf(zz,2/3));
if(rand<w) num=num+1; ss(num)=zz; end
end
ss
P ( x) Q
1000
1.01011000 2.314*104
Metropolis received his B.Sc. (1937) and Ph.D. (1941) degrees in experimental physics
at the University of Chicago. Shortly afterwards, Robert Oppenheimer recruited him
from Chicago, where he was at the time collaborating with Enrico Fermi and Edward
Teller on the first nuclear reactors, to the Los Alamos National Laboratory. He arrived in
the Los Alamos, on April 1943, as a member of the original staff of fifty scientists. After
the World War II he returned to the faculty of the University of Chicago as an Assistant
Professor. He came back to Los Alamos in 1948 to lead the group in the Theoretical (T)
Division that designed and built the MANIAC I computer in 1952 and MANIAC II in
1957. (He chose the name MANIAC in the hope of stopping the rash of such acronyms
for machine names, but may have, instead, only further stimulated such use.) From
1957 to 1965 he was Professor of Physics at the University of Chicago and was the
founding Director of its Institute for Computer Research. In 1965 he returned to Los
Alamos where he was made a Laboratory Senior Fellow in 1980.
Hill Climbing
for Academics
Metropolis Hastings
greedy algorithms
=1
Metropolis Explanation
The ratio
xnew | y
xcurrent | y
Proof (continued)
We show balance:
Probmove(x new | xcurrent ) *( xcurrent | y )
xcurrent | Y
1 .9
f ( x) exp (1 / 2) x'-1x ; =
.9 1
Pr obmove 1
xcurrent ' 1xcurrent
exp
f (Z )
P U
| Z y h( y )
that,
ch( Z )
f ( Z )
P y |U
ch
(
Z
)
d
f ( y)
f ( y)
f ( y)
h( y )
&if
1
cdh( y )
cd
ch( y )
h( y )
&otherwise
d
If x,yC={u: f(u)/ch(u)<1}
(y|x)=1 and (x|y) [f(y)f(x)/cd]=
[f(x)f(y)/cd], so
(x|y)=1.
If x C, but y C. Then (x|y) =1
because x has high f value. So,
(y|x) [f(x)f(y)/cd]= [f(y)h(x)/d] or
(y|x)=[ch(x)/f(x)];
If xC, but yC. Then (x|y) =[ch(y)/f(y)];
Probmove continued
Start with x.
Then if x,yC, move to y.
If yC but x not in C, move to y with
probability, c(x)/t4(x). Else y=x.
If xC but y not in C, move to y with
probability, c(y)/t4(y). Else y=x.
If neither x nor y is in C, move to y with
probability, min{t4(y)(x)/[(y)t4(x)],1}.
Else y=x.
end
Gibbs Sampling
(x[1],,x[i],y[i],x[i+1],,x[n] |
x)=y[i],x[i]g(y[i]|x)
Gibbs Sampling
(x|z)= {5,3+-22log(z)}
This comes from solving the equation,
z< exp{-(x-)2/22}; x>5
(z|x)={0,exp(-(x-)2/22)}
This comes from fixing x and solving
for z.
1 .9
f ( x) exp (1 / 2) x'-1x ; =
.9 1
.19 z;
.19 * z2
Definition of Simulated
Annealing
Simulated Annealing
(1/ Tn )