Description Usage Arguments Details Value Author(s) References See Also Examples
This function performs k-fold cross-validation (CV) of the multi-source sparse Tweedie model (MSTweedie) partly based on the glmnet::cv
function. The Tweedie model deviance is the statistical criterion for model selection.
1 2 3 4 5 |
x |
A data frame containing the predictors, the responses (identifying the sources either by different columns in the simultaneous case or via an additionnal index column) and, optionnaly, the observation weigths. |
y |
Either (1) a single integer identifying the column of |
w |
A single integer identifying the column of |
source |
When |
rho |
Power used for the mean-variance relation of the Tweedie distribution. Possible range is [1,2], default is 1.5. |
nlambda |
The length of the regularization path. Disregarded if |
lambda.min |
The fraction of the first regularization parameter (which is computed to be the smallest such that no predictors are included) defining the last regularization parameter. Disregarded if |
lambda |
(Optional) User specified sequence of regularization parameter with positive values. When omitted, the sequence is computed starting from the smallest value excluding all predictors from the model and decreasing to a fraction |
nfolds |
Number of folds in the k-folds CV. Default is 10. |
kktstop |
Logical flag for using the KKT conditions to stop the fit before the end of the regularization parameter sequence. Default is |
foldid |
(Optional) An list of vector of values between 1 and |
adaptive |
Exponent of the adaptive penalty weights; suggested value is 1 (See reference for details.) When the argument is 0, no adaptation is performed. |
x.normalize |
Logical flag for stadardization of the predictors prior to fitting the model. If |
reg |
Either |
eps |
Convergence threshold. Default is 5e-4. |
sr |
Logical flag for using the strong rule in the fit. Default is |
maxit |
Maximum number of inner-loop iterations. Default is 10,000. |
pf |
Penalty weights in the penalty term by feature. Mostly used internally when the Adaptive Lasso is used in cross-validation. Expects a vector of length |
alpha |
Parameter controlling the balance between across-feature and within-feature sparsity in the penalty term (1-α)||β||_q +α||β||_1. Possible range is [0,1], default is 0. |
... |
Further arguments to be passed to |
The function runs the MSTweedie
function on the first dataset to get the sequence of regularization paramter and the coefficient estimates. Then, it performs CV along the solution path and computes the out-of-sample Tweedie deviance based on the predicted responses. For each value of the regularization parameter, the error is averaged over the number of folds used and the standard error is computed.
lambda |
A vector containing the sequence of regularization parameters. |
cvm |
A vector containing the Tweedie deviance mean across the folds along the solution path. |
cvsd |
A vector containing the Tweedie deviance standard error across the folds along the solution path. |
cvupper |
|
cvlo |
|
reg |
The type of regularization used in the algorithm. |
alpha |
The value of the argument |
name |
|
MSTweedie.fit |
The |
time |
Computing time. |
lambda.min |
Regularization parameter at minimum CV error. |
lambda.1se |
Largest regularization parameter within one standard error of the minimum. |
Simon Fontaine, Yi Yang, Bo Fan, Wei Qian and Yuwen Gu.
Maintainer: Simon Fontaine fontaines@dms.umontreal.ca
Fontaine, S., Yang, Y., Fan, B., Qian, W. and Gu, Y. (2018). "A Unified Approach to Sparse Tweedie Model with Big Data Applications to Multi-Source Insurance Claim Data Analysis," to be submitted.
Friedman, J., Hastie, T., Simon, N., Qian, J. and Tibshirani, R. (2017). "glmnet
: Lasso and Elastic-Net Regularized Generalized Linear Models." A vignette for R
package glmnet
. Available from https://cran.r-project.org/web/packages/glmnet.
glmnet
package.
MSTweedie
,
coef.cv.MSTweedie
,
plot.cv.MSTweedie
,
predict.cv.MSTweedie
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.