Learn R Programming

latrend (version 1.2.1)

postprob: Posterior probability per fitted trajectory

Description

Get the posterior probability matrix with element \((i,j)\) indicating the probability of trajectory \(i\) belonging to cluster \(j\).

Usage

# S4 method for lcModel
postprob(object, ...)

Arguments

object

The lcModel.

...

Additional arguments.

Value

A I-by-K matrix with I = nIds(object) and K = nClusters(object).

Implementation

Classes extending lcModel should override this method.

setMethod("postprob", "lcModelExt", function(object, ...) {
  # return trajectory-specific posterior probability matrix
})

Details

This method should be extended by lcModel implementations. The default implementation returns uniform probabilities for all observations.

See Also

trajectoryAssignments predictPostprob predictAssignments

Other model-specific methods: clusterTrajectories(), coef.lcModel(), converged(), deviance.lcModel(), df.residual.lcModel(), fitted.lcModel(), fittedTrajectories(), lcModel-class, logLik.lcModel(), model.frame.lcModel(), nobs.lcModel(), predict.lcModel(), predictAssignments(), predictForCluster(), predictPostprob(), residuals.lcModel(), sigma.lcModel(), time.lcModel()

Examples

Run this code
# NOT RUN {
data(latrendData)
model <- latrend(lcMethodLcmmGMM(fixed = Y ~ Time, mixture = ~ Time,
   id = "Id", time = "Time"), data = latrendData)
postprob(model)
# }

Run the code above in your browser using DataLab