predict_famTEMsel: 'famTEMsel' prediction function

Description Usage Arguments Value Author(s) See Also

View source: R/famTEMsel.main.R

Description

predict_famTEMsel makes predictions given a (new) set of functional covariates newX, a (new) set of scalar covariates newZ and a (new) vector of treatment indicators newA based on a constrained functional additive model famTEMsel.obj. Specifically, predict_famTEMsel predicts the responses y based on the (X,Z)-by-A interaction effect (plus the A main effect) portion of the full model that includes the unspecified X main effect term.

Usage

1
2
predict_famTEMsel(famTEMsel.obj, newX = NULL, newZ = NULL,
  newA = NULL, type = "response", lambda.index = NULL)

Arguments

famTEMsel.obj

a famTEMsel object

newX

a (n by p) list of new values for the functional covariates X at which predictions are to be made; the jth element of the list corresponds to a n-by-n.eval[j] matrix of the observed jth functional covariates; n.eval[j] represents the number of evaluation points of the jth functional covariates; if NULL, X from the training set is used.

newZ

a (n by q) matrix of new values for the scalar covariates Z at which predictions are to be made; if NULL, Z from the training set is used.

newA

a (n by 1) vector of new values for the treatment A at which predictions are to be made; if NULL, A from the training set is used.

type

the type of prediction required; the default "response" gives the predicted responses y based on the whole model; the alternative "terms" gives the component-wise predicted responses from each of the p components (and plus the treatment-specific intercepts) of the model.

lambda.index

an index of the tuning parameter lambda at which predictions are to be made; one can supply lambda.opt.index obtained from the function cv.samTEMsel; the default is NULL, in which case the predictions based on the most non-sparse model is returned.

Value

predicted

a (n-by-length(lambda.index)) matrix of predicted values; a (n-by-length(lambda.index)*(p+q+1)) matrix of predicted values if type = "terms", where the last column corresponds to the (treatment-specific) intercept.

U

a n-by-(p+q) matrix of the index variables; the first p columns correspond to the 1-D projections of the p functional covariates and the last q columns correspond to the q scalar covariates.

Author(s)

Park, Petkova, Tarpey, Ogden

See Also

famTEMsel,cv.famTEMsel, plot_famTEMsel


syhyunpark/famTEMsel documentation built on Feb. 6, 2020, 12:13 a.m.