create_jaatha_model.function: Specify a jaatha model using a simulation function

View source: R/jaatha_model.R

create_jaatha_model.functionR Documentation

Specify a jaatha model using a simulation function

Description

This is the usual way to specify a jaatha model. An detailed exampled on doing so is given in the 'jaatha-intro' vignette.

Usage

## S3 method for class ''function''
create_jaatha_model(
  x,
  par_ranges,
  sum_stats,
  ...,
  scaling_factor = 1,
  test = TRUE
)

Arguments

x

A simulation function. This function takes model parameters as input, and returns the simulated data. The function must take exactly one argument, which is a numeric vector of model parameters for which the simulation should be conducted. The function should return the simulation results in an arbitrary format, that is then passed on to the summary statistics.

par_ranges

A matrix stating the possible values for the model parameters. The matrix must have one row for each parameter, and two columns which state the minimal and maximal possible value for the parameter.

sum_stats

A list of summary statistics created with create_jaatha_stat. The simulation results will be passed to the statistics, which should convert them into a numeric vector.

...

Currently unused.

scaling_factor

If your model is a down-scaled version of your data, you can indicated this using this value. The estimated expectation values are multiplied with this factor before the likelihood is calculated.

test

A logical indicating whether a simulation is performed to test the model.

Examples

create_jaatha_model(function(x) rpois(10, x),
                    par_ranges = matrix(c(0.1, 0.1, 10, 10), 2, 2),
                    sum_stats = list(create_jaatha_stat("sum", sum)))

jaatha documentation built on March 31, 2023, 11:37 p.m.