R/gdm_constraints_itempars2.R

Defines functions gdm_constraints_itempars2

## File Name: gdm_constraints_itempars2.R
## File Version: 0.07

##########################################################
# constraints on item parameters
gdm_constraints_itempars2 <- function( b.constraint, a.constraint,
    K, TD,I, dat )
{
    K.item <- apply( dat, 2, max )
    for (ii in 1:I){    # ii <- 1
        K.ii <- K.item[ii]
        if ( K.ii < K ){
            for ( kk in (K.ii+1):K){
                b.constraint <- rbind( b.constraint, cbind( ii, kk, -99999 ) )
                for (td in 1:TD){
                    a.constraint <- rbind( a.constraint, cbind( ii, td, kk, 0 ) )
                }
            }
        }
    }
    res <- list(K.item=K.item, a.constraint=a.constraint,
            b.constraint=b.constraint )
    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.