sample_function_single_mod: Sample function visiting a single mode of the posterior.

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

View source: R/sample_function_single_mod.R

Description

Generate a posterior sample using a single local search maximization and sampling.

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 a single time.

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
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$sample_burn_in <- 5
knobj$global_parameters$sample_to_keep1 <- 10
knobj$global_parameters$final_sample <- 5
knobj$global_parameters$final_sample_est <- 5

thetas <- sample_function_single_mod(knobj)
thetas

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