Learn R Programming

CNPBayes (version 1.2.2)

theta: Accessor for the theta parameter in the hierarchical mixture model

Description

The interpretation of theta depends on whether object is a MarginalModel or a BatchModel. For BatchModel, theta is a matrix of size B x K, where B is the number of batches and K is the number of components. Each column of the theta matrix can be interpreted as the batch means for a particular component. For objects of class MarginalModel (assumes no batch effect), theta is a vector of length K. Each element of theta can be interpreted as the mean for a component. See the following examples for accessing the current value of theta from a MixtureModel-derived object, and for plotting the chain of theta values.

Usage

theta(object)
"theta"(object)
"theta"(object)
"theta"(object)

Arguments

object
see showMethods(theta)

Value

A vector of length number of components or a matrix of size number of batches x number of components

Examples

Run this code
## MarginalModel
k(MarginalModelExample)
theta(MarginalModelExample)
plot.ts(theta(chains(MarginalModelExample)))
## BatchModel
k(BatchModelExample)
length(unique(batch(BatchModelExample)))
theta(BatchModelExample)
## Plot means for batches in one component
plot.ts(theta(chains(BatchModelExample))[, 1:3])

Run the code above in your browser using DataLab