R/tam_pv_mcmc_inits_theta.R

Defines functions tam_pv_mcmc_inits_theta

## File Name: tam_pv_mcmc_inits_theta.R
## File Version: 0.05

tam_pv_mcmc_inits_theta <- function(person, theta_init)
{
    #--- extract EAPs as initial theta estimates
    cnp <- colnames(person)
    ind <- setdiff( grep("EAP", cnp ), grep("SD", cnp ) )
    theta0 <- as.matrix(person[, ind, drop=FALSE])
    D <- ncol(theta0)
    colnames(theta0) <- paste0("Dim", 1:D)
    if ( ! is.null(theta_init)){
        theta0 <- theta_init
    }
    return(theta0)
}

Try the TAM package in your browser

Any scripts or data that you put into this service are public.

TAM documentation built on Aug. 29, 2022, 1:05 a.m.