trait.posterior: Calculate Posterior Estimates for Trait Parameters

View source: R/person.posterior.R

trait.posteriorR Documentation

Calculate Posterior Estimates for Trait Parameters

Description

Calculates posterior estimates for trait/person parameters for a fitted GPCMlasso model using the assumed Gaussian distribution of the person parameters.

Usage

trait.posterior(model, coefs = NULL, cores = 25, tol = 1e-04)

Arguments

model

Object of class GPCMlasso.

coefs

Optional vector of coefficients. If coefs = NULL, the coefficients from the BIC-optimal model are used, or, if cross-validation was performed, the coefficients from the cross-validation optimal model are used.

cores

Number of cores used for parallel computation.

tol

Deprecated. Kept for backward compatibility.

Details

The function computes posterior means of the latent trait parameters by Gauss-Hermite quadrature. If no coefficient vector is supplied, the cross-validation optimal coefficient vector is used when cross-validation was performed; otherwise, the BIC-optimal coefficient vector is used.

Value

Numeric vector containing posterior estimates of the trait/person parameters.

Author(s)

Gunther Schauberger
gunther.schauberger@tum.de

See Also

GPCMlasso, predict.GPCMlasso

Examples

data(tenseness_small)

form0 <- as.formula(
  paste(
    "cbind(",
    paste(colnames(tenseness_small)[1:5], collapse = ","),
    ") ~ 0"
  )
)

## Not run: 
rsm0 <- GPCMlasso(
  formula = form0,
  data = tenseness_small,
  model = "RSM",
  control = ctrl_GPCMlasso(cores = 1, trace = FALSE)
)

theta_hat <- trait.posterior(rsm0, cores = 1)
summary(theta_hat)

## End(Not run)


GPCMlasso documentation built on Sept. 8, 2026, 5:08 p.m.