R/mle_party_split_with_btw.R

Defines functions mle_party_split_with_btw

#' mle_party
#' @keywords internal
#' @noRd
#' @importFrom  bbmle parnames mle2
mle_party_split_with_btw <- function(y, X, G_within_0, G_within_1,
                                     G_between_01, G_between_10,
                                     starting.values, boundL, boundU) {

  theta <- starting.values
  theta_L <- boundL
  theta_U <- boundU

  bbmle::parnames(ll_party_split_with_btw) <- names(theta)

  fit <- mle2(ll_party_split_with_btw, method="L-BFGS-B", start = theta,
              parnames = names(theta), vecpar = TRUE, lower = theta_L,
              upper = theta_U, control = list(maxit=1000),
              data = list(Y = y, X = X,
                          G_between_01 = G_between_01,
                          G_between_10 = G_between_10,
                          G_within_0 = G_within_0, G_within_1 = G_within_1))

  return(fit)
}

Try the econet package in your browser

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

econet documentation built on April 28, 2022, 1:07 a.m.