Run TreePPL and return output.
Arguments
- sampler
a sampler_T outputted by tp_compile.
- data
a base::character with the full path to the data file in TreePPL JSON format (as outputted by tp_data).
- dir
a base::character with the full path to the directory where you want to save the output. Default is
base::tempdir().- out_file_name
a base::character with the name of the output file in JSON format. Default is "out".
- n_runs
a base::numeric giving the numbers of sweeps(SMC)/runs(MCMC).
- n_processes
a base::numeric, number of parallel processes to use. Can't be superior to n_runs.
- ...
See tp_runtime_options for all supported arguments.
Examples
if (FALSE) { # \dontrun{
# When using SMC
# compile model and create SMC inference machinery
exe_path <- tp_compile(model = "coin", method = "smc-bpf", particles = 2000)
# prepare data
data_path <- tp_data(data_input = "coin")
# run TreePPL
result <- tp_run(exe_path, data_path, n_runs = 2)
# When using MCMC
# compile model and create MCMC inference machinery
exe_path <- tp_compile(model = "coin", method = "mcmc-naive", iterations = 2000)
# prepare data
data_path <- tp_data(data_input = "coin")
# run TreePPL
result <- tp_run(exe_path, data_path)
} # }