skipTrack.diagnostics | R Documentation |
Takes model results from skipTrack.fit and uses genMCMCDiag to get generalized mcmc diagnostics
skipTrack.diagnostics(
stFit,
param = c("rho", "phi", "Betas", "Gammas", "muis", "tauis", "cijs"),
proximityMap = NULL,
...
)
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'. |
proximityMap |
An optional parameter specifying the proximity-map for calculating diagnostics. See package genMCMCDiag for details. Default is NULL. |
... |
Arguments passed on to
|
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 proximityMap. 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 proximityMap ('lanfear') and hammingDist as the distance function.
Details on genDiagnostic can be found in the genMCMCDiag package.
A mcmcDiag object of MCMC diagnostics for the specified parameter
genDiagnostic
, skipTrack.fit
#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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.