genSample.JointScalar {spup} | R Documentation |
Generating sample from cross-correlated variables described by a scalar.
Description
Generating sample from cross-correlated variables described by a scalar.
Usage
## S3 method for class 'JointScalar'
genSample(UMobject, n, samplemethod, p = 0, asList = TRUE, ...)
Arguments
UMobject |
object of a class JointScalar created using defineMUM.R |
n |
integer; number of Monte Carlo runs |
samplemethod |
"randomSampling" or "lhs". |
p |
a vector of quantiles. Optional. Only required if sample method is "lhs". |
asList |
logical. If asList = TRUE returns list of all samples as a list. If asList = FALSE returns samples in a format of distribution parameters in UMobject. |
... |
Additional parameters. |
Value
Monte Carlo sample of cross-correlated scalar variables.
Author(s)
Kasia Sawicka, Gerard Heuvelink
Examples
set.seed(12345)
scalarUM <- defineUM(uncertain = TRUE, distribution = "norm",
distr_param = c(1, 2), id="Var1")
scalarUM2 <- defineUM(uncertain = TRUE, distribution = "norm",
distr_param = c(3, 2), id="Var2")
scalarUM3 <- defineUM(uncertain = TRUE, distribution = "norm",
distr_param = c(10, 2.5), id="Var3")
myMUM <- defineMUM(UMlist = list(scalarUM, scalarUM2, scalarUM3),
matrix(c(1,0.7,0.2,0.7,1,0.5,0.2,0.5,1), nrow = 3, ncol = 3))
my_sample <- genSample(myMUM, n = 10, samplemethod = "randomSampling", asList = FALSE)
my_sample
[Package spup version 1.4-0 Index]