Learn R Programming

hzar (version 0.2-5)

hzar.next.fitRequest: Generate a new fitRequest using data from another fitRequest.

Description

The method is the glue for parallel runs of sequential chains. It returns a ready to run hzar.fitRequest object based on the hzar.fitRequest supplied. If oldFitRequest had already been successfully run, this method's result will be dependent on the prior run. If not, this method's result will be a request for an independent run.

Usage

hzar.next.fitRequest(oldFitRequest)

Arguments

oldFitRequest
A hzar.fitRequest object.

Value

A hzar.fitRequest object.

Details

If oldFitRequest describes a successful run, a new covariance matrix is generated, modelParam$init is updated to the covariance matrix center, and the lecuyer seed channel incremented by 1. If the mersenne twister was used previously, the lecuyer random number generator is requested on channel 2.

If oldFitRequest does not describe a successful run, everything is copied, except the lecuyer seed channel incremented by 10 to prevent overlapping. If the mersenne twister was used previously, the lecuyer random number generator is requested on channel 11.

See Also

hzar.fitRequest hzar.chain.doSeq hzar.cov.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 <- 1e4;
str(hzar.next.fitRequest(mknAdaAmodelFit))
## Not run: 
# mknAdaAinitialFit <- hzar.doFit(mknAdaAmodelFit);
# str(hzar.next.fitRequest(mknAdaAinitialFit))
# ## End(Not run)

Run the code above in your browser using DataLab