| mcnode | R Documentation |
Creates a ‘mcnode’ object from a vector, an array or another ‘mcnode’.
‘mcdatanocontrol’ is a fast but unchecked version of mcdata which
forces the dimension of data to be ‘(nsv x nsu x nvariates)’ and sets the attributes
and class without any validation. Useful when your model is tested and speed is important.
mcdata(
data,
type = c("V", "U", "VU", "0"),
nsv = ndvar(),
nsu = ndunc(),
nvariates = 1,
outm = "each"
)
mcdatanocontrol(
data,
type = c("V", "U", "VU", "0"),
nsv = ndvar(),
nsu = ndunc(),
nvariates = 1,
outm = "each"
)
data |
the numeric/logical vector/matrix/array of data or a ‘mcnode’ object. |
type |
the type of node to be built. By default, a ‘"V"’ node. |
nsv |
the variability dimension (‘type="V"’ or ‘type="VU"’) of the node.
By default: the current value in |
nsu |
the uncertainty dimension (‘type="U"’ or ‘type="VU"’) of the node.
By default: the current value in |
nvariates |
the number of variates. By default: 1. |
outm |
the output of the ‘mcnode’ for multivariate nodes. May be ‘"each"’ (default), ‘"none"’, or a vector of function names applied on the variates dimension before any output. |
A ‘mcnode’ object is the basic element of a mc object.
It is an array of dimension ‘(nsv x nsu x nvariates)’. Four types exist:
for "Variability", arrays of dimension ‘(nsv x 1 x nvariates)’. The variability of the data should reflect parameter variability.
for "Uncertainty", arrays of dimension ‘(1 x nsu x nvariates)’. The variability reflects parameter uncertainty.
for "Variability and Uncertainty", arrays of dimension ‘(nsv x nsu x nvariates)’.
for "Neither Variability nor Uncertainty", arrays of dimension ‘(1 x 1 x nvariates)’.
Multivariate nodes (‘nvariates != 1’) should be used for multivariate distributions
(rmultinomial, rmultinormal, rempiricalD,
rdirichlet).
Recycling rules are limited: recycling is only permitted to fill a dimension from 1 to the final size of the dimension.
An ‘mcnode’ object.
mcstoc to build a stochastic ‘mcnode’ object.
mc to build a Monte-Carlo object.
is.mcnode, dimmcnode, typemcnode.
oldvar <- ndvar()
oldunc <- ndunc()
ndvar(3)
ndunc(5)
(x0 <- mcdata(100, type = "0"))
(xV <- mcdata(1:ndvar(), type = "V"))
(xU <- mcdata(10 * 1:ndunc(), type = "U"))
(xVU <- mcdata(1:(ndvar() * ndunc()), type = "VU"))
## Multivariates
(x0M <- mcdata(1:2, type = "0", nvariates = 2))
(xVM <- mcdata(1:(2 * ndvar()), type = "V", nvariates = 2))
ndvar(oldvar)
ndunc(oldunc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.