Learn R Programming

Tools for Two-Dimensional Monte-Carlo Simulations

The package

mc2d provides a complete framework to build and study Two-Dimensional Monte-Carlo simulations, aka Second-Order Monte-Carlo simulations. It also includes various distributions frequently used in the risk assessment domain (pert, triangular, Bernoulli, empirical discrete and continuous, beta subjective, Minimum Quantile Information Distribution, ...).

Getting it

The stable version of mc2d can be installed from CRAN using:

install.packages("mc2d")
library("mc2d")

The development version of mc2d can be installed from GitHub (devtools needed):

if (!requireNamespace("devtools", quietly = TRUE))
   install.packages("devtools")
devtools::install_github("rpouillot/mc2d")
library("mc2d")

Check the NEWS here.

Documentation

See the manual and the vignettes distributed with the package.

Issues

Issues can be reported on https://github.com/rpouillot/mc2d/issues.

or directly to the maintainer Régis Pouillot: rpouillot@yahoo.fr

Citations

If you use mc2d, please cite:

R. Pouillot, M.-L. Delignette-Muller (2010), Evaluating variability and uncertainty in microbial quantitative risk assessment using two R packages. International Journal of Food Microbiology. 142(3):330-40

Copy Link

Version

Install

install.packages('mc2d')

Monthly Downloads

4,683

Version

0.2.0

License

GPL (>= 2)

Maintainer

Last Published

July 17th, 2023

Functions in mc2d (0.2.0)

empiricalD

The Discrete Empirical Distribution
ggtornado

Draws a Tornado chart as provided by tornado (ggplot version).
evalmcmod

Evaluates a Monte-Carlo model
lhs

Random Latin Hypercube Sampling
mcapply

Apply Functions Over mc or mcnode Objects
mcratio

Ratio of uncertainty and the variability
plot.tornado

Draws a Tornado chart.
mccut

Evaluates a Two-Dimensional Monte Carlo Model in a Loop.
mcprobtree

Creates a Stochastic mcnode Object using a Probability Tree
plot.mc

Plots Results of a Monte Carlo Simulation
mcmodel

Monte Carlo model
hist.mc

Histogram of a Monte Carlo Simulation
tornado

Computes Correlation between Inputs and Output in a mc Object (tornado) in the Variability Dimension;
print.mc

Prints a mcnode or a mc Object
is.mc

Tests mc and mcnode Objects
pmin

Maxima and Minima for mcnodes
tornadounc

Computes Correlation between Inputs and Output in a mc Object (tornado) in the Uncertainty Dimension
mcnode

Build mcnode Objects from Data or other mcnode Objects
total

An Example of all Kind of mcnode
triangular

The Triangular Distribution
spaghetti

Spaghetti Plot of mc/mcnode Object
summary.mc

Summary of mcnode and mc Object
multinormal

The Vectorized Multivariate Random Deviates
mcstoc

Creates Stochastic mcnode Objects
mc

Monte Carlo Object
mc.control

Sets or Gets the Default Number of Simulations.
typemcnode

Provides the Type of a mcnode Object
outm

Output of Nodes
quantile.mc

Quantiles of a mc Object
unmc

Unclasses the mc or the mcnode Object
rtrunc

Random Truncated Distributions
pert

The (Modified) PERT Distribution
converg

Graph of Running Statistics in the Variability or in the Uncertainty Dimension.
Lognormalb

The Log Normal Distribution parameterized through its mean and standard deviation.
BetaSubjective

The BetaSubjective Distribution
cornode

Builds a Rank Correlation using the Iman and Conover Method.
bernoulli

The Bernoulli Distribution
betagen

The Generalised Beta Distribution
dimmcnode

Dimension of mcnode and mc Objects
NA.mcnode

Finite, Infinite, NA and NaN Numbers in mcnode.
gghist

Histogram of a Monte Carlo Simulation (ggplot version)
ggspaghetti

Spaghetti Plot of `mc` or `mcnode` Object
MinimumQuantileInformation

Minimum Quantile Information Distribution
dmultinomial

The Vectorized Multinomial Distribution
extractvar

Utilities for multivariate nodes
ec

An example on Escherichia coli in ground beef
dirichlet

The Dirichlet Distribution
ggplotmc

ggplotmc
Ops.mcnode

Operations on mcnode Objects
empiricalC

The Continuous Empirical Distribution