Metropolis: A random walk Metropolis sampler

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

A random walk Metropolis sampler for generating the standard Laplace distribution

Usage

1
Metropolis(sigma, x0, N)

Arguments

x0:

the initial point(double)

sigma:

the standard deviation in the normal distribution(double)

N:

the length of the chain(int)

Value

a random sample of size N

Examples

1
2
3
4
5
6
7
## Not run: 
N<-100
sigma<-1
x0<-0
Metropolis(sigma,x0,N)

## End(Not run)

Jinshuyue98/SC190 documentation built on Jan. 3, 2020, 12:07 a.m.