R/tam_pv_draw_pv_nonparametric.R

Defines functions tam_pv_draw_pv_nonparametric

## File Name: tam_pv_draw_pv_nonparametric.R
## File Version: 0.03

tam_pv_draw_pv_nonparametric <- function(nstud, hwt1, theta, pv, ndim, pp)
{
    rn1 <- stats::runif( nstud )
    ind <- tam_interval_index( hwt1, rn1 ) - 1
    if (ndim==1){
        if (is.matrix(theta)){
            theta <- theta[,1]
        }
        pv[,pp] <- theta1 <- theta[ind]
    } else {
        theta1 <- pv[, (pp-1)*(ndim) + 1:ndim ] <- theta[ ind, ]
    }
    #--- OUTPUT
    res <- list(pv=pv, theta1=theta1)
    return(res)
}

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.