| mcprobtree | R Documentation |
Builds an ‘mcnode’ as a mixture of ‘mcnode’ objects.
mcprobtree(
mcswitch,
mcvalues,
type = c("V", "U", "VU", "0"),
nsv = ndvar(),
nsu = ndunc(),
nvariates = 1,
outm = "each",
seed = NULL
)
mcswitch |
a vector of probabilities/weights or an ‘mcnode’. |
mcvalues |
a named list of ‘mcnode’s, ‘mcdata’ calls, or ‘mcstoc’ calls. Each element should be or lead to a compatible ‘mcnode’. |
type |
the type of ‘mcnode’ to be built. By default, a ‘"V"’ node. |
nsv |
the number of simulations in the variability dimension. |
nsu |
the number of simulations in the uncertainty dimension. |
nvariates |
the number of variates of the final ‘mcnode’. |
outm |
the default output for multivariate nodes. See |
seed |
the random seed. If ‘NULL’ the seed is unchanged. |
‘mcswitch’ may be either:
a vector of weights (need not sum to one, must be nonneg and not all zero). Length must equal the number of elements in ‘mcvalues’.
a ‘"0 mcnode"’ to build any type of node.
a ‘"V mcnode"’ to build a ‘"V"’ or ‘"VU"’ node.
a ‘"U mcnode"’ to build a ‘"U"’ or ‘"VU"’ node.
a ‘"VU mcnode"’ to build a ‘"VU"’ node.
Names of elements in ‘mcvalues’ should correspond to values in ‘mcswitch’, specified as character. Elements are evaluated only if needed.
An ‘mcnode’ object.
mcdata, mcstoc, switch.
conc1 <- mcstoc(rnorm, type="VU", mean=10, sd=2)
conc2 <- mcstoc(runif, type="VU", min=-6, max=-5)
conc3 <- mcdata(0, type="VU")
## Randomly in the cells
whichdist <- mcstoc(rempiricalD, type="VU", values=1:3, prob=c(.75, .20, .05))
mcprobtree(whichdist, list("1"=conc1, "2"=conc2, "3"=conc3), type="VU")
## Equivalent using weights
mcprobtree(c(.75, .20, .05), list("1"=conc1, "2"=conc2, "3"=conc3), type="VU")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.