sampleStep {skipTrack}R Documentation

Perform a single step of the MCMC sampling process for skipTrack

Description

This function performs a single step of the Markov Chain Monte Carlo (MCMC) algorithm to update parameters in a hierarchical model used for identifying skips in menstrual cycle tracking.

Usage

sampleStep(
  ijDat,
  iDat,
  rho,
  pi,
  Xi,
  Zi,
  Beta,
  Gamma,
  priorAlphas,
  indFirst,
  rhoBeta,
  rhoGamma,
  phi,
  rhoPhi,
  fixedSkips
)

Arguments

ijDat

A data.frame with individual-observation level parameters: Individual, ys, cijs, muis, tauis.

iDat

A data.frame with individual level parameters: Individual, mus, taus, thetas.

rho

Updated value of the global parameter rho.

pi

Updated value of the global parameter pi.

Xi

A matrix (numIndividuals x length(Beta)) of covariates for cycle length mean. Default is a vector of 1's. NOTE THE DIFFERENCE (from skipTrack.MCMC) IN EXPECTED DIMENSION OF X

Zi

A matrix (numIndividuals x length(Gamma)) of covariates for cycle length precision. Default is a vector of 1's. NOTE THE DIFFERENCE (from skipTrack.MCMC) IN EXPECTED DIMENSION OF Z

Beta

Matrix (1 x length(Beta)) of coefficients for cycle length mean.

Gamma

Matrix of (1 x length(Gamma)) coefficients for cycle length precision.

priorAlphas

Vector of prior alpha values for updating pi.

indFirst

A logical vector indicating the first occurrence of each individual.

rhoBeta

Updated value of the global parameter rhoBeta.

rhoGamma

Value of the proposal parameter rhoGamma.

phi

Value of the parameter phi.

rhoPhi

Value of the proposal parameter rhoPhi.

fixedSkips

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

Value

A list containing updated parameters after performing a single MCMC step. The list includes:

ijDat

A data.frame with updated parameters at the individual-observation level: Individual, ys, cijs, muis, tauis.

iDat

A data.frame with updated parameters at the individual level: Individual, mus, taus, thetas.

rho

Updated value of the global parameter rho.

pi

Updated value of the global parameter pi.

Xi

Matrix of covariates for cycle length mean.

Zi

Matrix of covariates for cycle length precision.

Beta

Updated matrix of coefficients for cycle length mean.

Gamma

Updated matrix of coefficients for cycle length precision.

priorAlphas

Vector of prior alpha values for updating pi.

indFirst

A logical vector indicating the first occurrence of each individual.

rhoBeta

Hyperprior parameter rhoBeta, used to update Beta.

rhoGamma

Value of the proposal parameter rhoGamma.

phi

Updated value of the parameter phi.

rhoPhi

Value of the proposal parameter rhoPhi.

fixedSkips

Logical. Indicates if skips were fixed.


[Package skipTrack version 0.1.0 Index]