Internal function k-fold cross-validation for zipath, produces a plot, and returns cross-validated log-likelihood values for lambda
cv.zipath_fit(X, Z, Y, weights, offsetx, offsetz, nlambda=100, lambda.count=NULL,
lambda.zero=NULL, nfolds=10, foldid, plot.it=TRUE, se=TRUE,
n.cores=2, trace=FALSE, parallel=FALSE, ...)
an object of class "cv.zipath"
is returned, which is a
list with the components of the cross-validation fit.
a fitted zipath object for the full data.
matrix for cross-validated log-likelihood at each (count.lambda, zero.lambda)
sequence
matrix of BIC values with row values for lambda
and column values for k
th cross-validation
The mean cross-validated log-likelihood - a vector of length
length(count.lambda)
.
estimate of standard error of cv
.
an optional vector of values between 1 and nfold
identifying what fold each observation is in.
index of (count.lambda, zero.lambda)
that gives maximum cv
.
value of (count.lambda, zero.lambda)
that gives maximum cv
.
predictor matrix of the count model
predictor matrix of the zero model
response variable
optional numeric vector of weights.
optional numeric vector with an a priori known component to be included in the linear predictor of the count model.
optional numeric vector with an a priori known component to be included in the linear predictor of the zero model.
number of lambda
value, default value is 10.
Optional user-supplied lambda.count sequence; default is
NULL
Optional user-supplied lambda.zero sequence; default is
NULL
number of folds >=3, default is 10
an optional vector of values between 1 and nfold
identifying what fold each observation is in. If supplied,
nfold
can be missing and will be ignored.
a logical value, to plot the estimated log-likelihood values if TRUE
.
a logical value, to plot with standard errors.
The number of CPU cores to use. The cross-validation loop will attempt to send different CV folds off to different cores.
a logical value, print progress of cross-validation or not
a logical value, parallel computing or not
Other arguments that can be passed to zipath
.
Zhu Wang <zwang145@uthsc.edu>
The function runs zipath
nfolds
+1 times; the
first to compute the (lambda.count, lambda.zero)
sequence, and then to
compute the fit with each of the folds omitted. The log-likelihood value is
accumulated, and the average value and standard deviation over the
folds is computed. Note that cv.zipath
can be used to search for
values for count.alpha
or zero.alpha
: it is required to call cv.zipath
with a fixed vector foldid
for different values of count.alpha
or zero.alpha
.
The method for coef
by default
return a single vector of coefficients, i.e., all coefficients are concatenated. By setting the model
argument, the estimates for the corresponding model components can be extracted.
Zhu Wang, Shuangge Ma, Michael Zappitelli, Chirag Parikh, Ching-Yun Wang and Prasad Devarajan (2014) Penalized Count Data Regression with Application to Hospital Stay after Pediatric Cardiac Surgery, Statistical Methods in Medical Research. 2014 Apr 17. [Epub ahead of print]
Zhu Wang, Shuangge Ma, Ching-Yun Wang, Michael Zappitelli, Prasad Devarajan and Chirag R. Parikh (2014) EM for Regularized Zero Inflated Regression Models with Applications to Postoperative Morbidity after Cardiac Surgery in Children, Statistics in Medicine. 33(29):5192-208.
Zhu Wang, Shuangge Ma and Ching-Yun Wang (2015) Variable selection for zero-inflated and overdispersed data with application to health care demand in Germany, Biometrical Journal. 57(5):867-84.