R/dpm_calc_probs.R

Defines functions dpm_calc_probs

## File Name: dpm_calc_probs.R
## File Version: 0.02

dpm_calc_probs <- function( vh )
{
    N_max <- length(vh)
    probs <- rep( 1, N_max)
    probs[1] <- vh[1]
    for (tt in 2:N_max){
        probs[tt] <- vh[tt] * prod( 1 - vh[ 1:(tt-1)] )
    }
    return(probs)
}

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.