function scriptmissing(n)
%runs the mising data example
x=[-1.5 -1 -.3 .5 1 2]; theta=1; mu=.12;
u=rand(1,n);
disp(['**************Robbins-Monro****************'])
for i=1:n
    Z=-theta*log(u(i));
    [H,DH,D2H]=H_missing(mu,x,Z,theta);
    mu=mu-DH/i;
end
mu
disp(['**************Geyers method****************'])
mu=.12;
Z=-theta*log(u);
mu = fminsearch(@H_miss2,.12,[],x,Z,theta)
disp(['**************sequential importance****************'])
mu=.12;   w=ones(1,n);
for i=1:n
    Z=-theta*log(u);
    w=theta*exp(Z(1:i)/theta);
    [H,DH,D2H]=H_missing(mu,x,Z(1:i),theta);
    mu=mu-sum(w.*DH)/sum(w.*D2H);
    theta=
    
end
mu