R: Independence Metropolis independence chain of a posterior...
indepmetrop
R Documentation
Independence Metropolis independence chain of a posterior distribution
Description
Simulates iterates of an independence Metropolis chain with a normal proposal density for an arbitrary real-valued
posterior density defined by the user
Usage
indepmetrop(logpost,proposal,start,m,...)
Arguments
logpost
function defining the log posterior density
proposal
a list containing mu, an estimated mean and var, an estimated variance-covariance matrix, of the normal proposal density
start
vector containing the starting value of the parameter
m
the number of iterations of the chain
...
data that is used in the function logpost
Value
par
a matrix of simulated values where each row corresponds to a value of the vector parameter
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(LearnBayes)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LearnBayes/indepmetrop.Rd_%03d_medium.png", width=480, height=480)
> ### Name: indepmetrop
> ### Title: Independence Metropolis independence chain of a posterior
> ### distribution
> ### Aliases: indepmetrop
> ### Keywords: models
>
> ### ** Examples
>
> data=c(6,2,3,10)
> proposal=list(mu=array(c(2.3,-.1),c(2,1)),var=diag(c(1,1)))
> start=array(c(0,0),c(1,2))
> m=1000
> fit=indepmetrop(logctablepost,proposal,start,m,data)
>
>
>
>
>
> dev.off()
null device
1
>