skipTrack.fit {skipTrack}R Documentation

Fits the skipTrack Model using 1 or more MCMC chains

Description

This function fits the model using multiple instances of skipTrack.MCMC, either in parallel or sequentially.

Usage

skipTrack.fit(
  Y,
  cluster,
  X = matrix(1, nrow = length(cluster)),
  Z = matrix(1, nrow = length(cluster)),
  numSkips = 10,
  reps = 1000,
  chains,
  useParallel = FALSE,
  ...
)

Arguments

Y

A vector of observed cycle lengths.

cluster

A vector indicating the individual cluster/group membership for each observation Y.

X

A matrix (length(Y) x length(Beta)) of covariates for cycle length mean. Default is a vector of 1's.

Z

A matrix (length(Y) x length(Gamma)) of covariates for cycle length precision. Default is a vector of 1's.

numSkips

The maximum number of skips to allow. Default is 10.

reps

The number of MCMC iterations (steps) to perform. Default is 1000.

chains

Number of chains to run.

useParallel

Logical, indicating whether to use parallel processing, as supported by doParallel. Default is FALSE.

...

Arguments passed on to skipTrack.MCMC

fixedSkips

If TRUE cycle skip information (cijs) is not updated in sample steps and the inputs are instead assumed to be true.

initialParams

A list of initial parameter values for the MCMC algorithm. Default values are provided for pi, muis, tauis, rho, cijs, alphas, Beta, Gamma, phi, rhoBeta, rhoGamma, and rhoPhi.

verbose

logical. If true progress bars and additional info are printed to the console.

Value

A list containing the results of skipTrack.MCMC for each chain.

See Also

skipTrack.MCMC

Examples

#Simulated data
simDat <- skipTrack.simulate(n = 100, skipProb = c(.7, .2, .1))

#Run model fit (should typically run with much more than 50 reps)
modFit <- skipTrack.fit(Y = simDat$Y, cluster = simDat$cluster, chains = 2, reps = 50)
modFit


[Package skipTrack version 0.1.0 Index]