sample_function_multi_mod_weight: Sample function visiting multiple modes of the posterior

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sample_function_multi_mod_weight.R

Description

Generate a posterior sample using multiple local search maximization and sampling based on different initializations.

Usage

1

Arguments

knobj

A knowledge list. See knobjs.

Details

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.

Value

A matrix which rows represent a named numeric vector of parameters

Author(s)

Edouard Pauwels

See Also

sample_function, BFGS_special, generate_sample

Examples

 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

pauwels2014 documentation built on May 1, 2019, 6:29 p.m.