MHAlogrithmuni: Metropolis-Hastings Algorithm to sample data from univariate...

Description Usage Arguments Value

View source: R/MHAlogrithmUni.R

Description

Metropolis-Hastings Algorithm to sample data from univariate distribution

Usage

1
2
3
4
5
6
7
MHAlogrithmuni(
  TargetDensity,
  CGDensity = "Normal",
  xinit = 0,
  sigma = 1,
  niter = 1000
)

Arguments

TargetDensity

A function: The PDF of target density function from which the users want to sample. This should be as a function of x.

CGDensity

Candidate Generating Density function (default is normal distribution)

xinit

A scalar: The starting point of the algorithm

sigma

A scalar: The standard deviation of the Candidate Generating Density

niter

A scalar: The number of data to sample

Value

Return the data collection sampled from the MH Algorithm


wzh96/STAT600RPackage documentation built on Dec. 23, 2021, 6:15 p.m.