copulaSample: Generate correlated samples from elicited marginal...

Description Usage Arguments Value Author(s) Examples

View source: R/elicitCopula.R

Description

Takes elicited marginal distributions and elicited concordance probabilities: pairwise probabilities of two uncertain quantities being greater than their medians, and generates a correlated sample, assuming the elicited marginal distributions and a multivariate normal copula

Usage

1
copulaSample(..., cp, n, d = NULL)

Arguments

...

A list of objects of class elicitation. command, one per marginal distribution, separated by commas.

cp

A matrix of pairwise concordance probabilities, with element i,j the elicited probability P(X_i > m_i, X_j > m_j or X_i < m_i, X_j < m_j), where m_i and m_j are the elicited medians of the uncertain quantities X_i and X_j. Only the upper triangular elements in the matrix need to be specified; the remaining elements can be set at 0.

n

The sample size to be generated

d

A vector of distributions to be used for each elicited quantity: a string with elements chosen from "normal", "t", "gamma", "lognormal", "logt", "beta". The default is to use the best fitting distribution in each case.

Value

A matrix of sampled values, one row per sample.

Author(s)

Jeremy Oakley <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
p1 <- c(0.25, 0.5, 0.75)
v1 <- c(0.5, 0.55, 0.6)
v2 <- c(0.22, 0.3, 0.35)
v3 <- c(0.11, 0.15, 0.2)
myfit1 <- fitdist(v1, p1, 0, 1)
myfit2 <- fitdist(v2, p1, 0, 1)
myfit3 <- fitdist(v3, p1, 0, 1)
quad.probs <- matrix(0, 3, 3)
quad.probs[1, 2] <- 0.4
quad.probs[1, 3] <- 0.4
quad.probs[2, 3] <- 0.3
copulaSample(myfit1, myfit2, myfit3, cp=quad.probs, n=100, d=NULL)

## End(Not run)

OakleyJ/SHELF documentation built on Feb. 14, 2020, 8:17 a.m.