R/sirt_MAP.R

Defines functions sirt_MAP

## File Name: sirt_MAP.R
## File Version: 0.01

sirt_MAP <- function(post, theta)
{
    TP <- ncol(post)
    maxval <- post[,1]
    indval <- 1
    for (tt in 2:TP){
        m0 <- maxval
        maxval <- ifelse( post[,tt] > m0, post[,tt], m0 )
        indval <- ifelse( post[,tt] > m0, tt, indval )
    }
    MAP <- theta[ indval, ]
    return(MAP)
}

Try the sirt package in your browser

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

sirt documentation built on Aug. 11, 2023, 5:07 p.m.