getAIESamples: getAIESamples

Description Usage Arguments Details Value Author(s) Examples

View source: R/AIES.R

Description

Function to obtain affine-invariant ensemble samples

Usage

1
2
getAIESamples(halfN, nosteps, lnprob, x0, a = 2, eps = 0.01, CPUs = 1,
  dynlib = NULL, echo = FALSE, lgf = NULL)

Arguments

halfN

half the number of walkers in the ensemble

nosteps

the number of steps taken (chainlengths)

lnprob

the loglikelihood function

x0

a vector of initial parameter values

a

alg tuning: todo

eps

alg tuning: todo

CPUs

number of CPUs to use (experimental; not working)

dynlib

if a compiled library is need to evaluate lnprob

echo

if TRUE then more verbose output

lgf

if present, the filename for a logfile to dump information into

Details

todo: provenance and more on arguments

Value

list(chains=list(R1=R2,R2=R2),acc=acc,accv=accv,a=a, llike=list(LL1=LL1,LL2=LL2),lnprob=lnprob) - returned in this form to allow continuation with continueAIESamples. The chains R1 and R2 are matrices with columns for parameteres and rows for iterations.

Author(s)

Pete Dodd

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Rosenrbock banana function
rosen <- function(x) -(1-x[1])^2 - 100*(x[2] - x[1]^2)^2

#50 walkers for 200 steps
S <- getAIESamples(50,200,arosen,runif(2))
plotAIEchains(S)
SP <- processAIESamples(S,burnin=50)
corplot(SP)

#continue for another 100 steps
S <- continueAIESamples(Y=S,nosteps=100)

petedodd/MCIR documentation built on Jan. 9, 2020, 9:18 a.m.