Learn R Programming

hzar (version 0.2-5)

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

Description

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

Usage

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.

See Also

hzar.fitRequest hzar.dataGroup mcmc

Examples

Run this code
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)));

Run the code above in your browser using DataLab