Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RandVariable-class

Random variable


Description

Class of random variables; i.e., measurable maps from Domain to Range. The elements contained in the list Map are functions in one(!) argument named “x”.

Objects from the Class

Objects can be created by calls of the form new("RandVariable", ...). More frequently they are created via the generating function RandVariable.

Slots

Map

Object of class "list": list of functions.

Domain

Object of class "OptionalrSpace": domain of the random variable.

Range

Object of class "OptionalrSpace": range of the random variable.

Methods

Map

signature(object = "RandVariable"): accessor function for the slot Map.

Domain

signature(object = "RandVariable"): accessor function for the slot Domain.

Range

signature(object = "RandVariable"): accessor function for the slot Range.

Map<-

signature(object = "RandVariable"): replacement function for the slot Map.

Domain<-

signature(object = "RandVariable"): replacement function for the slot Domain.

Range<-

signature(object = "RandVariable"): replacement function for the slot Range.

compatibleDomains

signature(e1 = "RandVariable", e2 = "RandVariable"): test if the domains of two random variables are compatible.

length

signature(object = "RandVariable"): length of the list of functions in slot Map.

show

signature(object = "RandVariable")

Author(s)

See Also

Examples

(R1 <- new("RandVariable"))
Map(R1)
Domain(R1)
Range(R1)
Map(R1) <- list(function(x){ceiling(x)}, function(x){floor(x)})
Domain(R1) <- Reals()
Range(R1) <- Naturals()
R1
Map(R1)
length(R1)

R2 <- R1
Domain(R2) <- Naturals()
compatibleDomains(R1, R2)
Domain(R2) <- NULL
compatibleDomains(R1, R2)
Domain(R2) <- EuclideanSpace(dimension = 1)
compatibleDomains(R1, R2)
Domain(R2) <- EuclideanSpace(dimension = 2)
compatibleDomains(R1, R2)

RandVar

Implementation of Random Variables

v1.2.1
LGPL-3
Authors
Matthias Kohl [cre, cph, aut], Peter Ruckdeschel [aut, cph]
Initial release
2020-01-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.