R/gdm_constraints_itempars.R

Defines functions gdm_constraints_itempars

## File Name: gdm_constraints_itempars.R
## File Version: 0.09

###############################################
# constraints for item parameters
gdm_constraints_itempars <- function( b.constraint, a.constraint,
    K, TD, Qmatrix, a )
{
    for (kk in 1:K){
        for( td in 1:TD){
            ind.kk <- which( Qmatrix[,td, kk]==0 )
            a[ ind.kk, td, kk ] <- 0
            if ( length( ind.kk) > 0 ){
                a1 <- cbind( ind.kk, td, kk, 0 )
                a.constraint <- rbind( a.constraint, a1 )
            }
        }
    }
    if ( ! is.null( a.constraint) ){
        a.constraint <- as.matrix( a.constraint )
    }
    res <- list( a.constraint=a.constraint, b.constraint=b.constraint, a=a)
    return(res)
}

Try the CDM package in your browser

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

CDM documentation built on Aug. 25, 2022, 5:08 p.m.