Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/sample_function_multi_mod_weight.R
Generate a posterior sample using multiple local search maximization and sampling based on different initializations.
1 |
knobj |
A knowledge list. See |
The parameters governing the local search and sampling behaviour are defined in the global_parameters
slot of the knobjs
argument. The function consists in using the BFGS_special
function to find an initialization for the Metropolis Hasting algorithm implented by generate_sample
. This is done multiple times. This procedure is also applied to previous sample points. All those sample are aggregated and the resulting sample is chosen randomly based on the associated posterior values.
A matrix which rows represent a named numeric vector of parameters
Edouard Pauwels
sample_function
, BFGS_special
, generate_sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | data(experiment_list1)
data(observables)
## Generate the knowledge object with correct parameter value
knobj <- generate_our_knowledge(transform_params)
## Initialize with some data
knobj$datas[[1]] <- list(
manip = experiment_list1$nothing,
data = add_noise(
simulate_experiment(knobj$global_parameters$true_params_T, knobj, experiment_list1$nothing)[
knobj$global_parameters$tspan %in% observables[["mrnaLow"]]$reso,
observables[["mrnaLow"]]$obs
]
)
)
## Decrease parameter values for the example
knobj$global_parameters$max_it <- 2
knobj$global_parameters$n_multi_mod <- 2
knobj$global_parameters$sample_burn_in <- 5
knobj$global_parameters$sample_to_keep1 <- 100
knobj$global_parameters$final_sample <- 100
knobj$global_parameters$final_sample_est <- 100
#thetas <- sample_function_multi_mod_weight(knobj)
#thetas
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.