A PMXStanFit
object, with the following list of methods:
get.fitreturns the output derived from fitting a Stan model, including the samples; the same output as
defined by stanfit-class
.
print.fitprints out statistics of posterior samples, with the following arguments:
on.screen
: a logical variable that controls whether or not to print results on screen. Default is TRUE
.
save.mode
: a logical variable that controls whether or not to export results to a text file. Default is TRUE
.
...
: any other arguments that are passed to the more generic function print.stanfit
from
rstan, such as digits_summary
, number of significant digits for printing out the summary;
pars
, parameters in which the summaries are interest;
probs
, quantiles of interest for summary statistics; etc.
This function has a generic form as well (see Examples).
get.pathreturns path of the folder that stores all post-processing results, such as printed statistics for
samples and goodness-of-fit plots.
get.waicreturns diagnostic statistics for a fitted Bayesian model: Watanabe-Akaike information criterion
(WAIC
) and Leave-on-out cross-validation (LOO-CV
).
The argument complete
allows to select whether to input all pointwise and total statistics
(TRUE
) or only total statistics (FALSE
, by default). For more details, see References.
This function has a generic form as well (see Examples).
plot.traceplots traces and posterior distributions corresponding to one or more Markov chains, therefore to
investigate sampling behavior and to assess mixing across chains and convergence. The argument
pars
specifies names of parameters whose traces will be plotted. When it is not specified,
the function by default plots all the theta
's (model parameters), sigma_eta
's
(variance of the inter-individual random effects), and sigma
(variance of the intra-individual
random effects) in the auto-generated Stan code.
This function has a generic form as well (see Examples).
For a similar implementation, see traceplot
.
plot.gof.pred.obsplots medians of predictions vs. observations for goodness-of-fit assessment, with
the following arguments:
by.cov
: a string to specify the covariate name under investigation. If left as
NULL
by default, the plot will be generated based on the overall
population from all individuals in the input data. To make sure that the
specified covariate name be properly recognized, please also specify it
in the argument covar
when calling prepareInputData
.
type
: a string to specify the type of the parameter, can be "categorical" (abbreviated
as "cat") or "continuous" (abbreviated as "con"). This argument is ignored
(automatically set to NULL
) if by.cov is not provided by user.
cutoff
: a number or vector of numbers to specify the cut-off points by which the
subgroups based on a continuous covariate are defined. If a parameter name
is specified in by.cov and the type is specified as "continuous" in
type, the default cut-off (when not provided by user) is set as the
median of the corresponding parameter across the population. This argument
is ignored for a categorical covariate, where the subgroups will be
automatically determined by all available distinct values of the covariate.
filename
: a string to specify the path to store the plots. If not provided by user,
the plots will be output to screen automatically.
Noted that a good fit usually results in a group of points clustered around the line of
x=y
representing alignment between observations and predictions. This function has
a generic form as well (see Examples).
plot.gof.pred.rsdplots residuals, calculated as the difference between medians of predictions and observations,
vs. predictions as one way of goodness-of-fit assessment, with the same arguments as
plot.gof.pred.rsd()
above. A good fit usually results in a
group of points clustered around the horizontal line of y=0
, without obvious trend of
deviation. This function has a generic form as well (see Examples).
plot.gof.idvplots time profiles of the prediction medians and 95
profile of observations. This function has a generic form as well (see Examples).