mc: Monte Carlo Object

View source: R/mc.R

mcR Documentation

Monte Carlo Object

Description

Creates ‘⁠mc⁠’ objects from mcnode or ‘⁠mc⁠’ objects.

Usage

mc(..., name = NULL, devname = FALSE)

Arguments

...

‘⁠mcnode⁠’ and/or ‘⁠mc⁠’ object(s) to be gathered in a ‘⁠mc⁠’ object, separated by a comma.

name

vector of characters of the same length as the final ‘⁠mc⁠’ object. If ‘⁠NULL⁠’, names are taken from the names of the elements.

devname

develop the name from the name of the ‘⁠mc⁠’ objects, if any.

Details

A ‘⁠mc⁠’ object is a list of mcnode objects. ‘⁠mcnode⁠’ objects must be of coherent dimensions.

If one of the arguments is a ‘⁠mc⁠’ object, the names of its elements are used. ‘⁠devname = TRUE⁠’ develops the name using the name of the ‘⁠mc⁠’ object as prefix. The names of the ‘⁠mcnode⁠’ arguments are made unique; the names of the elements of ‘⁠mc⁠’ arguments are kept as they are (they may duplicate other names, unless ‘⁠devname = TRUE⁠’ is used).

An unnamed argument that is not a variable name (e.g. ‘⁠a + b⁠’ or a call to mcstoc) gets an empty name. Name such arguments (e.g. ‘⁠mc(a, b, out = a + b)⁠’): functions that select nodes by name, such as tornadounc, may fail otherwise.

Value

An object of class ‘⁠mc⁠’.

See Also

mcnode, the basic element of a ‘⁠mc⁠’ object. To evaluate ‘⁠mc⁠’ objects: mcmodel, evalmcmod, evalmccut. To study ‘⁠mc⁠’ objects: print.mc, summary.mc, plot.mc, converg, hist.mc, tornado, tornadounc.

Examples

x <- mcstoc(runif)
y <- mcdata(3, type = "0")
z <- x * y
(m <- mc(x, y, z, name = c('n1', 'n2', 'n3')))
mc(m, x, devname = TRUE)

mc2d documentation built on Oct. 23, 2026, 1:06 a.m.