hzar.mcmc.bindLL: Generate a mcmc object with sampled parameters and log...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/60-hzarPlottingNew.R

Description

This function returns the mcmc data with an added a log likelihood column.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
hzar.mcmc.bindLL(fitRequest,
                 dataGroup = hzar.fit2DataGroup(fitRequest),
                 mcmcData =
                   if(inherits(fitRequest,"hzar.fitRequest")){
                     mcmc(fitRequest$mcmcRaw,
                          thin=fitRequest$mcmcParam$thin,
                          start=1+fitRequest$mcmcParam$burnin);
                   }else{
                     as.mcmc(dataGroup$data.mcmc)},
                 llData = dataGroup$data.LL,
                 t0 = start(mcmcData),
                 tF = thin(mcmcData))

Arguments

fitRequest

The hzar.fitRequest or hzar.dataGroup object to use.

dataGroup

The hzar.dataGroup object to use.

mcmcData

The mcmc object with the series parameter values.

llData

The series of log likelihoods of the parameter values.

t0

The start.mcmc attribute of the result.

tF

The thin.mcmc attribute of the result.

Value

A mcmc object, with columns for each free parameter and the log likelihood of each row.

Author(s)

Graham Derryberry asterion@alum.mit.edu

See Also

hzar.fitRequest hzar.dataGroup mcmc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(manakinMolecular);
mknAdaA <-
  hzar.doMolecularData1DPops(manakinMolecular$distance,
                             manakinMolecular$ada.A,
                             manakinMolecular$ada.nSamples);
mknAdaAmodel <-
  hzar.makeCline1DFreq(mknAdaA, scaling="fixed",tails="none");
mknAdaAmodelFit <-
   hzar.first.fitRequest.old.ML(model=mknAdaAmodel ,
                                mknAdaA,
                                verbose=FALSE);
mknAdaAmodelFit$mcmcParam$chainLength <- 5e3;
mknAdaAmodelFit$mcmcParam$burnin <- 5e2;
plot(hzar.mcmc.bindLL(hzar.doFit(mknAdaAmodelFit)));

hzar documentation built on May 2, 2019, 7 a.m.