R/reglca_fit_probabilities_fit_function.R

Defines functions reglca_fit_probabilities_fit_function

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


reglca_fit_probabilities_fit_function <- function( parm, lambda, C, W, regular_type="scad")
{
    probs0 <- reglca_calc_probs(parm=parm)
    ll0 <- reglca_freq_ll( x=probs0, C=C, W=W )
    pen0 <- - sum( cdm_penalty_values(x=parm[-1], regular_type=regular_type, regular_lam=lambda) )
    opt0 <- ll0 + pen0
    #--- output
    res <- list( ll=ll0, pen=pen0, fit_fct=opt0)
    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.