Function for writing an RSGHB model object as a series of CSV files to the disk. Files are written in Sawtooth's CBC HB format to allow for easier integration with analysis processes built around that software.
writeModel(object, writeDraws = FALSE, path = getwd())
an RSGHB
model object.
whether to write out the individual draw files. (Defaults to FALSE
)
the folder location to write the files. (Defaults to getwd()
)
None, though a series of files is written to path
:
A log file containing summary model information and the estimation iteration detail.
A faceted plot of all appropriate model statistics stored in the iteration detail of the model (object[["iter.detail"]]
). Depending on the type of parameters estimated, some statistics may be NULL
or NA
and are omitted.
If object
was estimated with random parameters, contains the sample-level means of the underlying normals at each iteration.
If object
was estimated with random parameters, contains the mean individual-level draws across iterations for the underlying normals. The Bsd file provides the standard deviations of these individual draws.
If object
was estimated with random parameters, contains the mean individual-level draws across iterations for the underlying normals while including the appropriate distribution transformations. The Csd file provides the standard deviations of these individual draws. These two files are equivalent to the conditional distributions from models estimated using Maximum Simulated Likelihood methods.
If object
was estimated with random parameters, contains a row-based representation of the sample variance-covariance matrix for each iteration.
If object
was estimated with fixed parameters, contains the set of fixed (non-random) parameters at each iteration in object[["gNEREP"]]
.
If object
was estimated with random parameters, contains the prior variance-covariance matrix that was assumed to estimate the model.
All output files are named with a object[["modelname"]]
prefix. (E.g. modelname.log, modelname_C.csv)
If writeDraws
is TRUE
, a CSV file for each of object[["gNP"]]
individuals is written to the disk. This may take a long time if object[["gNEREP"]]
or object[["gNP"]]
is large.
# NOT RUN {
# writeModel(model)
# }
Run the code above in your browser using DataLab