Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/generate_sample.R
This is an implementation of MH algorithm to sample from the posterior distribution. The proposal is a mixture between a gaussian proposal and a single coordinate proposal. The step size is diminished when the rejection rate is too high.
1 | generate_sample(theta, knobj, N = 500, step = 1, verbose = F)
|
theta |
An initialization parameter named numeric vector |
knobj |
A knowledge list. See |
N |
The total sample size. |
step |
The proposal distribution expected step length. |
verbose |
Should the sampling process print information about itself? |
The posterior is evaluated using eval_log_like_knobj
function.
A posterior sample matrix, each row representing a parameter named numeric vector.
Edouard Pauwels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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
]
)
)
generate_sample(knobj$global_parameters$params * 50, knobj, N = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.