Learn R Programming

campsismod (version 1.2.1)

sampleGeneric: Generic function for parameter sampling according to the minimum and maximum values. This function will sample parameters a first time and check if some parameters are out of range. Based on the success rate, it will sample more parameters to reach the desired number of rows.

Description

Generic function for parameter sampling according to the minimum and maximum values. This function will sample parameters a first time and check if some parameters are out of range. Based on the success rate, it will sample more parameters to reach the desired number of rows.

Usage

sampleGeneric(fun, args, n, minMax, msg, settings, parameters = NULL)

Value

tibble with the sampled parameters (1 parameter per column + REPLICATE column)

Arguments

fun

function to call to sample parameters

args

arguments to pass to the function

n

number of rows to sample

minMax

a data frame with min, max values for each parameter

msg

message template

settings

replication settings

parameters

double array parameters to check for positive definiteness