xSample: Generate Sample

Description Usage Arguments Details Value Examples

Description

Generate Monte Carlo sample from prescribed PDF. All PDFs are parameterized by their mean and standard deviation (if needed).

Usage

1
2
xSample(M = 1000, x.mu, x.u, x.pdf, x.df, x.cor = diag(length(x.mu)),
  x.cov = NULL, tol = sqrt(.Machine$double.eps))

Arguments

M

Sample size.

x.mu

Named vector of mean values with names compatible with fExpr.

x.u

Named vector of standard uncertainty values (one of {x.u, x.cov} mandatory).

x.pdf

Named vector of pdf types (see below).

x.df

Named vector of degrees of freedom for x.pdf.

x.cor

Named correlation matrix between model parameters.

x.cov

Named variance/covariance matrix between model parameters (one of {x.u, x.cov} mandatory).

tol

Numeric tolerance level to check positive-definiteness of x.cor or x.cov.

Details

Available distributions:

Correlation between variables is described by matrices x.cov or x.cor, and enforced by Gaussian copula.

Value

X A M*N matrix of M values for N variables.

Examples

1
2
3
4
5
x.mu = c(1,1); names(x.mu)=c('x1','x2')
x.u = c(0.1,0.1); names(x.u)=c('x1','x2')
x.pdf = c('unif','triangle'); names(x.pdf)=c('x1','x2')
X=xSample(M=1000,x.mu,x.u,x.pdf)
SAPlot(X)

ppernot/rgumlib documentation built on May 25, 2019, 11:24 a.m.