These methods access information stored in a CmdStanModel
object, print its Stan program, and manage paths to its executable and
generated C++ file. For how the executable was built, see the
$build_info() method, which has its own page.
Value
$stan_file()returns a path as a string, orcharacter(0)if the model was created without a Stan file.$has_stan_file()returnsTRUEif the model was created with a Stan file andFALSEotherwise.$code()returns a character vector with one element per line of Stan code, orNULLif the model was created without a Stan file.$print()returns theCmdStanModelobject invisibly.$model_name()returns the model name as a string.$exe_file()returns a path as a string, orcharacter(0)if no executable path is set.$include_paths()returns a character vector of absolute paths orNULL.$cmdstan_version()returns the version of CmdStan that built the executable, as a string.$cpp_options()returns a named list of C++ options, with names in their make spelling and values as the strings make received:TRUEcomes back as"true"andFALSEas"". To ask whether the executable was built with a feature, use$build_info(), which reports logicals.$user_header()returns the absolute path to the user header as a string, orNULLif the model has no user header.$hpp_file()returns the path to the.hppfile holding the C++ code generated for the Stan program when the model object was created. It errors if the model was created without a Stan file.$save_hpp_file()moves the.hppfile todir, updates the stored path, and returns the new path invisibly.
See also
The CmdStanR website (mc-stan.org/cmdstanr) for online documentation and tutorials.
The Stan and CmdStan documentation:
Stan documentation: mc-stan.org/users/documentation
CmdStan User’s Guide: mc-stan.org/docs/cmdstan-guide
Other CmdStanModel methods:
model-method-build_info,
model-method-check_syntax,
model-method-cmdstan_defaults,
model-method-diagnose,
model-method-expose_functions,
model-method-format,
model-method-generate-quantities,
model-method-is_current,
model-method-laplace,
model-method-optimize,
model-method-pathfinder,
model-method-sample,
model-method-sample_mpi,
model-method-variables,
model-method-variational