calculus | R Documentation |
Arithmetic operators and functions for probability distribution objects.
These methods define how standard operations like +
, -
,
*
, and /
behave when applied to random variables, returning the
resulting distribution based on known properties of common distribution
families.
## S4 method for signature 'Norm,Norm'
e1 + e2
## S4 method for signature 'numeric,Norm'
e1 + e2
## S4 method for signature 'Norm,numeric'
e1 + e2
## S4 method for signature 'Norm,Norm'
e1 - e2
## S4 method for signature 'numeric,Norm'
e1 - e2
## S4 method for signature 'Norm,numeric'
e1 - e2
## S4 method for signature 'numeric,Norm'
e1 * e2
## S4 method for signature 'Norm,numeric'
e1 * e2
## S4 method for signature 'Norm,numeric'
e1 / e2
## S4 method for signature 'Norm,logical'
sum(x, ..., na.rm = FALSE)
## S4 method for signature 'Norm'
exp(x)
x , e1 , e2 |
objects of subclass |
... |
extra arguments. |
na.rm |
logical. Should missing values be removed? |
All calculations return Distribution
objects (specifically, objects
of a class that is a subclass of Distribution
), according to the property
at hand.
# -----------------------------------------------------
# Distribution Calculus Example
# -----------------------------------------------------
# Normal location - scale transformation
x <- Norm(2, 3)
y <- 3 * x + 1 # Norm(7, 9)
# Addition of two independent Normal random variables
x1 <- Norm(1, 3)
x2 <- Norm(2, 4)
x3 <- x1 + x2 # Norm(3, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.