Learn R Programming

mtk (version 1.0)

mtkDomain-class: The mtkDomain class

Description

The mtkDomain class is a class used to manage the uncertainty domain associated with a factor.

Arguments

Class Hierarchy

Parent classes :
Direct Known Subclasses :

Constructor

mtkDomain
signature(distributionName = "unknown", domainNominalValue = 0, distributionParameters = list())

Slots

distributionName:
(character) a string representing the distribution law.
nominalValue:
(mtkValue) the nominal value of the domain.
levels:
(mtkLevels) an object of mtkLevels class.
distributionParameters:
(list) a list of mtkParameter objects.

Methods

initialize
signature(.Object = "mtkDomain"): The initializer of the class mtkDomain.
getDistributionName
signature(this = "mtkDomain"): Returns the distribution's name.
getNominalValue
signature(this = "mtkDomain"): Returns the the nominal value.
getNominalValueType
signature(this = "mtkDomain"): Returns the value type of the nominal value .
getDiscreteDistributionType
signature(this = "mtkDomain"): Returns the type of the discrete distribution.
getLevels
signature(this="mtkDomain"): Fetches the the levels managed by the domain.
getWeights
signature(this="mtkDomain"): Fetches the the weights managed by the domain.
getDistributionParameters
signature(this = "mtkDomain"): Fetches the parameters of the distributions associated with the domain.
setLevels
signature(this="mtkDomain", levels = "vector"): Affects a new level to the domain where levels is a named list like list(type='categorical', levels=c(1,2,3,4,5), weights=c(0.2, 0.2, 0.2, 0.2, 0.2)).
setLevels
signature(this="mtkDomain", levels = "mtkLevels"): Affects a new level to the domain where levels is an object from the class mtkLevels.
setDistributionParameters
signature(this = "mtkDomain", aDistParamList="list"): Affects a new list of parameters to the domain. For continue distributions, aDistParamList may be a list of objects of the class mtkParameter or a named list like list(max=5, min=1)., For discrete distributions, aDistParamList may be a named list containing an object of the class mtkLevels or a named list like list(type='categorical',levels = c(1,2,3,4,5), weights=rep(0.2, 5)) from which we can build an object of the class mtkLevels.
print
signature(x = "mtkDomain"): Prints the data managed by the domain.
show
signature(object = "mtkDomain"): Displays the underlying object of the class mtkDomain.

References

J. Wang, H. Richard, R. Faivre, H. Monod (2013). Le package mtk, une bibliothèque R pour l'exploration numérique des modèles. In: Analyse de sensibilité et exploration de modèles : Application aux sciences de la nature et de l'environnement (R. Faivre, B. Iooss, S. Mahévas, D. Makowski, H. Monod, Eds). Editions Quae, Versailles.

Examples

Run this code
# Create a  new domain with a continue distribution
	d <- mtkDomain(distributionName="unif", domainNominalValue=0, 
		distributionParameters = list(max=3, min=0))
	
# Create a  new domain with a discrete distribution
	d <- mtkDomain(distributionName="discrete", domainNominalValue=3,
		 distributionParameters = list(type='categorical',
		 levels = c(1,2,3,4,5), weights=rep(0.2, 5)))
# Change the levels to list(type='categorical', levels = c('a','b','c','d'), weights=rep(0.25, 4))
	setLevels(d, list(type='categorical', levels = c('a','b','c','d'), weights=rep(0.25, 4)))
		

Run the code above in your browser using DataLab