Learn R Programming

pauwels2014 (version 1.0)

random_design: Simulates a randim design process.

Description

Simulates a randim design process.

Usage

random_design(knobj, sample_function, exps, seed, credits = 5000, file_to_save = NULL, verbose = T)

Arguments

knobj
A knowledge list. See knobjs.
sample_function
A sample function that takes a knowledge list as argument and outputs a sample from the associated posterior in a design matrix.
exps
A dataframe representing possible experiments to be performed with their cost. See exps.
seed
A random number generator seed.
credits
Total credit to be spent.
file_to_save
A file where the updated knowledge list should be saved at each step.
verbose
Should the process print information about on going computation.

Value

An updated knowledge list.

Details

This implements a strategy consisting in choosing experiments randomly. If a file name is provided, the resulting object will be saved at the corresponding location at each step of the process.

See Also

knobjs, sample_function_multi_mod_weight, sample_function_single_mod, experiment_list1, observables, sample_function, exps

Examples

Run this code
data(exps)
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
  ]
 )
)
knobj$experiments <- paste("nothing", "mrnaLow")


## Decrease parameter values for the example
knobj$global_parameters$max_it <- 2
knobj$global_parameters$n_simu_weights <- 3
knobj$global_parameters$sample_burn_in <- 5
knobj$global_parameters$sample_to_keep1 <- 10
knobj$global_parameters$sample_to_keep2 <- 10
knobj$global_parameters$n_multi_mod_weight <- 2
knobj$global_parameters$final_sample <- 5
knobj$global_parameters$final_sample_design <- 5

## Run the random design (this takes quite some time)
#knobj <- random_design(knobj, sample_function_single_mod, exps, seed = 1, credits = 400)

Run the code above in your browser using DataLab