- mod.caroll.lik <- measerr_mle(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula, truth_formula=truth_formula)
- fischer.info <- solve(mod.caroll.lik$hessian)
- coef <- mod.caroll.lik$par
- ci.upper <- coef + sqrt(diag(fischer.info)) * 1.96
- ci.lower <- coef - sqrt(diag(fischer.info)) * 1.96
+ if(confint_method=='quad'){
+ mod.caroll.lik <- measerr_mle(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula, truth_formula=truth_formula, method='optim')
+ fischer.info <- solve(mod.caroll.lik$hessian)
+ coef <- mod.caroll.lik$par
+ ci.upper <- coef + sqrt(diag(fischer.info)) * 1.96
+ ci.lower <- coef - sqrt(diag(fischer.info)) * 1.96
+ } else { # confint_method == 'bbmle'
+
+ mod.caroll.lik <- measerr_mle(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula, truth_formula=truth_formula, method='bbmle')
+ coef <- coef(mod.caroll.lik)
+ ci <- confint(mod.caroll.lik, method='spline')
+ ci.lower <- ci[,'2.5 %']
+ ci.upper <- ci[,'97.5 %']
+ }