Description Usage Arguments Details Value Examples
View source: R/zero_est_core.R
Fits a linear Hurdle conditional model with abk parametrization.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | zi_fit_abk(
V,
Y,
left,
right,
use_C = TRUE,
tol = 1e-08,
maxit = 1000,
runs = 2,
value_only = TRUE,
report = 0,
step_size = 0.1,
lm_tol = 0.01,
maxsize = 1e-10,
method = 5
)
|
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 |
use_C |
A logical. Function calls |
tol |
A positive number. If |
maxit |
An integer, the maximum number of integers, argument to |
runs |
A positive integer, number of reruns; if larger than |
value_only |
If |
report |
An integer indicating verbosity. If |
step_size |
A double, the step size of the first trial step. Defaults to 0.1. |
lm_tol |
A double, accuracy of the line minimization. |
maxsize |
A double, the final size of the simplex. |
method |
A positive integer indicating the method to use. 5 is recommended and default. |
A linear Hurdle conditional model with abk parametrization for the left
node given those in right
has log density with respect to the sum of the Lebesgue measure and a point mass at 0 equal to (in terms of y
)
a*v+b*y-y^2*k/2-log(1+sqrt(2pi/k)*exp(a+b^2/(2k))),
where v = (y != 0)
, k
is constant and a
and b
are linear functions in the values for right
and their indicators.
This function fits such a model using Y[,left]
, Y[,right]
and V[,right] = (Y[,right] != 0)
.
If right
is empty, fits an unconditional univariate Hurdle using mle1d_abk()
.
If use_C == TRUE
, calls zi_fit_C()
.
If use_C == FALSE
, calls zi_fit_R()
.
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 | 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_abk(dat$V, dat$Y, 3, 1:2, use_C=FALSE, maxit=1000, runs=2, value_only=TRUE, report=0)
zi_fit_abk(dat$V, dat$Y, 3, 1:2, use_C=TRUE, maxit=1000, runs=2, value_only=TRUE, report=0)
zi_fit_abk(dat$V, dat$Y, 3, 1:2, use_C=FALSE, maxit=1000, runs=2, value_only=FALSE, report=0)
zi_fit_abk(dat$V, dat$Y, 3, 1:2, use_C=TRUE, maxit=1000, runs=2, value_only=FALSE, report=0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.