metrop: Run a simple Metropolis sampler with standard normal target...

metropR Documentation

Run a simple Metropolis sampler with standard normal target and uniform innovations

Description

This function runs a simple Metropolis sampler with standard normal target distribution and uniform innovations.

Usage

metrop(n, alpha) 

Arguments

n

The number of iterations of the Metropolis sampler.

alpha

The tuning parameter of the sampler. The innovations of the sampler are of the form U(-alpha,alpha).

Value

An R vector containing the output of the sampler.

See Also

normgibbs

Examples

normvec=metrop(1000,1)
op=par(mfrow=c(2,1))
plot(ts(normvec))
hist(normvec,20)
par(op)

smfsb documentation built on Jan. 13, 2024, 3:02 a.m.