mcEnsemble: Random ensemble subject to constraints

Description Usage Arguments Details Value

View source: R/perturbations.R

Description

Given a background mean and standard deviation for a number of variables, the function returns a random ensemble possibly subject to fixed-value and cross-variable constraints. See details below.

Usage

1
mcEnsemble(p, MC, m, MCcons = NULL, Sigma = NULL, empiricalNorm = TRUE)

Arguments

p

LIST with named input variables as components. Each component is then a vector of length two, containing its background mean and standard deviation

MC

Dataframe with metadata, where the MC[,'ispar'] is a LOGICAL column indicating which variables are to be included in the output matrix, out of all those available in p

. The number of output variables in the ensemble is ntheta==sum(CF$MC$flag) MC has the additional 'max' and 'min' columns indicating fix-valued contraints on output samples. MC[,'dis'] indicates the random distribution type. Available values are 'rnorm', 'truncnorm' and 'rlnorm'.

m

number of members in the ensemble, m has to be an exact multiplier of ntheta

MCcons

CHARACTER, 3-column matrix of cross-variable constraints. For each row, the first and third columns are variable names matching those in p, and the second column is one character in ['<','=','>']

Sigma

REAL, OPT, [ntheta,ntheta], full covariance matrix. If Sigma is provided, only those element in Sigma with normal distribution will be considered for covariances

empiricalNorm

whether to use empircal norm for those variables with an 'rnorm' distribution

Details

Makes a random sample subject to the abovementioned fixed-value constraints and cross-variable constraints.

Value

An [ntheta,m] matrix


garciapintado/rDAF documentation built on May 25, 2019, 7:26 p.m.