Learn R Programming

mtk (version 1.0)

setDistributionParameters-methods: The setDistributionParameters method

Description

Sets the parameters of the distribution associated with a factor's domain.

Usage

setDistributionParameters(this, aDistParamList)

Arguments

this
the underlying object of the class mtkDomain.
aDistParamList
a list of objects of class mtkParameter or a named list from which we can build a list of objects of class mtkParameter .

Value

Examples

Run this code

# 1)  Build an object of the "mtkDomain" class
	d <- mtkDomain(distributionName="unif", domainNominalValue=0)
	
	## Define the parameters
	p <- make.mtkParameterList(list(min=-pi, max=pi))
	
	## Assign the parameters to the mtkDomain's object

	setDistributionParameters(d, p)
# 2) Build an object of the "mtkDomain" class
	d <- mtkDomain(distributionName="unif", domainNominalValue=0)
	
	## Assign the parameters to the mtkDomain's object

	setDistributionParameters(d, list(min=-pi, max=pi))

# 3) Build an object of the "mtkDomain" class with a discrete distribution
	d <- mtkDomain(distributionName="discrete", domainNominalValue=0)

	## Assign the parameters to the mtkDomain's object

	setDistributionParameters(d, list(type='categorical', levels=seq(1:3), weights=rep(0.33,3)))

Run the code above in your browser using DataLab