R/mgsem_test_fun.R

Defines functions mgsem_test_fun

## File Name: mgsem_test_fun.R
## File Version: 0.161


mgsem_test_fun <- function(test, coef, opt_fun_args)
{
    if (test){
        requireNamespace('miceadds')
        #- function evaluation
        ll <- mgsem_opt_fun(x=coef, opt_fun_args=opt_fun_args)
        #- numerical gradient
        grad1 <- mgsem_grad_fun_numeric_approx(x=coef, opt_fun_args=opt_fun_args)
        #- analytical gradient
        args <- list(x=coef, opt_fun_args=opt_fun_args)
        grad <- do.call( what=mgsem_grad_fun, args=args)

        # dfr <- cbind( grad, grad1)

        #- print
        miceadds::Revalpr('ll')
        miceadds::Revalpr_maxabs('grad','grad1')
        stop()
    }
}

Try the sirt package in your browser

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

sirt documentation built on Aug. 11, 2023, 5:07 p.m.