predict.MSTweedie: Prediction based on a MSTweedie object

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function predicts the response (or the link function) given features at some regularization parameter.

Usage

1
2
## S3 method for class 'MSTweedie'
predict(fit, newx, tasks, s, type = c("response", "link"))

Arguments

fit

MSTweedie object.

newx

A list of matrices all with nvars columns used to predict the responses. Each matrix is associated with a source from the original fit MSTweedie object in the order of argument tasks. Default is the original dataset (fit$x).

tasks

A vector of the same length as newx containing the index of the source associated with the respective matrix in newx. Default is all sources in original order.

s

Either an integer identifying the index of regularization parameter to use or the parameter itself (must match one of fit.)

type

Whether to return the "response""} or the \code{"link"" (linear predictor).

Value

A list of length length(tasks) of vectors corresponding to the prediction of either the reponses or the link function (see type).

Author(s)

Simon Fontaine, Yi Yang, Bo Fan, Wei Qian and Yuwen Gu.

Maintainer: Simon Fontaine fontaines@dms.umontreal.ca

References

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.

See Also

MSTweedie, coef.MSTweedie

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#import package
library(MSTweedie)

#load data
data(AutoClaim)

# performs 10-folds CV with L1/Linf regularization
fit <- MSTweedie(x = AutoClaim, y=1, source=4, reg='Linf')

# predict first source at 34th lambda
head(predict.MSTweedie(fit, s=34L)[[1]])

fontaine618/MSTweedie documentation built on May 25, 2019, 5:22 p.m.