Description Usage Arguments Details Value Examples
View source: R/zero_est_core.R
Fits a Hurdle polynomial with either abk or pms parametrization.
1 2 3 4 5 6 7 8 9 |
V |
A matrix of 0/1s, equal to Y != 0. |
Y |
A data matrix of the same size as |
left |
An integer between 1 and |
right |
A vector of integers between 1 and |
parametrization |
A string, either |
value_only |
If |
control |
A list of arguments to be passed to |
For "abk"
parametrization, consult ?zi_fit_abk
for control
.
For "pms"
parametrization, consult ?zi_fit_pms
for model fitting using Hurdle polynomials of an exact degree, or ?zi_fit_pms_choose_degree
for automatically determining the degree given a maximum degree allowed.
If parametrization == "abk"
, calls zi_fit_abk(V, Y, left, right, value_only)
with other arguments set to those in the control
list.
If parametrization == "pms" && is.null(control[["max_uniform_degree"]])
, calls zi_fit_pms(V, Y, left, right, value_only)
with other arguments set to those in the control
list.
If parametrization == "pms" && !is.null(control[["max_uniform_degree"]])
, calls zi_fit_pms_choose_degree(V, Y, left, right, value_only)
with other arguments set to those in the control
list.
For the list of arguments for zi_fit_abk()
, zi_fit_pms()
and zi_fit_pms_choose_degree()
, please refer to their documentation.
If value_only == TRUE
, returns the minimized negative log likelihood only. Otherwise, returns
nll |
A number, the minimized negative log likelihood. |
par |
A vector of length |
n |
An integer, the sample size. |
effective_df |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | m <- 3; n <- 1000
adj_mat <- make_dag(m, "complete")
dat <- gen_zero_dat(1, "abk", adj_mat, n, k_mode=1, min_num=10, gen_uniform_degree=1)
zi_fit(dat$V, dat$Y, 3, 1:2, "abk", TRUE, list(use_C=FALSE, maxit=1000, runs=2, report=0))
zi_fit(dat$V, dat$Y, 3, 1:2, "abk", TRUE, list(use_C=TRUE, maxit=1000, runs=2, report=0))
zi_fit(dat$V, dat$Y, 3, 1:2, "abk", FALSE, list(use_C=FALSE, maxit=1000, runs=2, report=0))
zi_fit(dat$V, dat$Y, 3, 1:2, "abk", FALSE, list(use_C=TRUE, maxit=1000, runs=2, report=0))
dat <- gen_zero_dat(1, "pms", adj_mat, 1000, k_mode=1, min_num=10, gen_uniform_degree=1)
zi_fit(dat$V, dat$Y, 3, 1:2, "pms", value_only=TRUE,
list(p_V_degree=2, p_Y_degree=2, p_Y_V_degree=2, mu_V_degree=2, mu_Y_degree=2))
zi_fit(dat$V, dat$Y, 3, 1:2, "pms", value_only=FALSE,
list(p_V_degree=2, p_Y_degree=2, p_Y_V_degree=2, mu_V_degree=2, mu_Y_degree=2))
zi_fit(dat$V, dat$Y, 3, 1:2, "pms", value_only=TRUE,
list(max_uniform_degree=2L, print_best_degree = TRUE))
zi_fit(dat$V, dat$Y, 3, 1:2, "pms", value_only=FALSE,
list(max_uniform_degree=2L, print_best_degree = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.