R/reglca_normalize_probabilities.R

Defines functions reglca_normalize_probabilities

## File Name: reglca_normalize_probabilities.R
## File Version: 0.04

reglca_normalize_probabilities <- function(parm)
{
    eps <- 1E-10
    probs <- cumsum(parm)
    M <- max(probs)
    if (M > 1){
        probs <- probs / ( M + eps )
        parm <- c( probs[1], diff(probs) )
    }
    return(parm)
}

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.