Learn R Programming

pauwels2014 (version 1.0)

eval_log_like_knobj: Posterior function.

Description

Computes the posterior value associated to a given parameter value for a given knowledge list.

Usage

eval_log_like_knobj(theta, knobj, fail_incoming = F, fit = F)

Arguments

theta
A parameter named numeric vector.
knobj
A knowledge list. See knobjs
fail_incoming
A boolean indicating wether an error message is given by the ode solver.
fit
A parameter to be passed to the likelihood function. It indicates wether further prior information about the smoothness of the dynamical time course should be considered. This is used to guide local search posterior maximization methods.

Value

A numerical value if fail_incoming == FALSE. A list containing a res numerical slot and a fail boolean slot representing wether the ode solver failed or not.

Details

The function computes the log prior first and then the likelihood associated to all the time course data found in the knobj$datas slot. The likelihood terms are summed. The prior term and the likelihood terms are weighted, weights being the inverse the number of observations they represent. This is necessary in order to give comparable contributions to low resolution and high resolution experiments.

See Also

log_prior, knobjs, eval_kn_log_like

Examples

Run this code
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
  ]
 )
)

eval_log_like_knobj(knobj$global_parameters$true_params_T, knobj)

Run the code above in your browser using DataLab