R/mdmb_regression_optim_oprobit_fct.R

Defines functions mdmb_regression_optim_oprobit_fct

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

mdmb_regression_optim_oprobit_fct <- function(x, index_beta, index_thresh, Xdes,
                offset_values, y, eps, weights)
{
    beta <- x[ index_beta ]
    logthresh <- x[ index_thresh ]
    thresh <- logthresh_2_thresh(x=logthresh)
    ypred <- Xdes %*% beta + offset_values
    ll_i <- mdmb_regression_oprobit_density( y=y, ypred=ypred, thresh=thresh,
                        log=TRUE, eps=eps)
    ll <- - sum( weights * ll_i )
    #--- output
    return(ll)
}

Try the mdmb package in your browser

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

mdmb documentation built on March 7, 2023, 6:58 p.m.