MHAlogrithmmulti: Metropolis-Hastings Algorithm to sample data from...

Description Usage Arguments Value

View source: R/MHAlogrithmMulti.R

Description

Metropolis-Hastings Algorithm to sample data from multivariate distribution

Usage

1
2
3
4
5
6
7
8
MHAlogrithmmulti(
  TargetDensity,
  nvar,
  CGDensity = "multivariateNormal",
  xinit = NULL,
  sigma = NULL,
  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.

nvar

A scalar: The number of variables

CGDensity

Candidate Generating Density function (default is multivariate normal distribution)

xinit

A vector: The starting point of the algorithm

sigma

A matrix: The covariance matrix of the candidate generating distribution

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.