Learn R Programming

NMsim (version 0.2.1)

samplePars: Sample model parameters using `mvrnorm` or the `simpar` package

Description

Sample model parameters using `mvrnorm` or the `simpar` package

Usage

samplePars(file.mod, nsims, method, seed.R, format = "ext", as.fun)

Value

A table with sampled model parameters

Arguments

file.mod

Path to model control stream. Will be used for both `NMreadExt()` and `NMreadCov()`, and extension will automatically be replaced by `.ext` and `.cov`.

nsims

Number of sets of parameter values to generate. Passed to `simpar`.

method

The sampling method. Options are "mvrnorm" and "simpar". Each have pros and cons. Notice that both methods are fully automated as long as ".ext" and ".cov" files are available.

seed.R

seed value passed to set.seed().

format

The returned data set format "ext" (default) or "wide". "ext" is a long-format, similar to what `NMdata::NMreadExt()` returns.

as.fun

The default is to return data as a data.frame. Pass a function (say `tibble::as_tibble`) in as.fun to convert to something else. If data.tables are wanted, use as.fun="data.table". The default can be configured using NMdataConf.

Details

This function was originally create by Sanaya Shroff and Philip Delff for sampling using `simpar`. It has since been generalized to support sampling with `mvrnorm()` too.