skipTrack.diagnostics {skipTrack} | R Documentation |
skipTrack MCMC Diagnostics
Description
Takes model results from skipTrack.fit and uses genMCMCDiag to get generalized mcmc diagnostics
Usage
skipTrack.diagnostics(
stFit,
param = c("rho", "phi", "Betas", "Gammas", "muis", "tauis", "cijs"),
method = NULL,
...
)
Arguments
stFit |
A list of MCMC results from the skipTrack.fit function. |
param |
A character string specifying the parameter for which diagnostics are to be calculated. Must be one of: 'rho', 'phi', 'Betas', 'Gammas', 'muis', 'tauis', or 'cijs'. |
method |
An optional parameter specifying the method for calculating diagnostics. See package genMCMCDiag for details. Default is NULL. |
... |
Arguments passed on to
|
Details
If the parameter is 'rho' or 'phi' (the univariate parameters), the function extracts the specified parameter from the MCMC results and calculates diagnostics using the genDiagnostic function with the standard method. If the parameter is any of the other available options, the function extracts the corresponding values and calculates diagnostics using the genDiagnostic function with the specified or default method ('lanfear') and hammingDist as the distance function.
Details on the genDiagnostic function can be found in the genMCMCDiag package.
Value
A mcmcDiag object of MCMC diagnostics for the specified parameter
See Also
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)
#Get diagnostics for cijs
skipTrack.diagnostics(modFit, 'cijs')