fglm_trunc {FGLMtrunc} | R Documentation |
Fit a truncated Functional Generalized Linear Model
Description
Fit a truncated functional linear or logistic regression model using nested group lasso penalty.
The solution path is computed efficiently using active set algorithm with warm start. Optimal tuning parameters (\lambda_s, \lambda_t
)
are chosen by Bayesian information criterion (BIC).
Usage
fglm_trunc(
Y,
X.curves,
S = NULL,
grid = NULL,
family = c("gaussian", "binomial"),
degree = 3,
nbasis = NULL,
knots = NULL,
nlambda.s = 10,
lambda.s.seq = NULL,
precision = 1e-05,
parallel = FALSE
)
Arguments
Y |
|
X.curves |
|
S |
(optional) |
grid |
A sequence of |
family |
Choice of exponential family for the model. The function then uses corresponding canonical link function to fit model. |
degree |
Degree of the piecewise polynomial. Default 3 for cubic splines. |
nbasis |
Number of B-spline basis.
If |
knots |
|
nlambda.s |
(optional) Length of sequence of smoothing regularization parameters. Default 10. |
lambda.s.seq |
(optional) Sequence of smoothing regularization parameters. |
precision |
(optional) Error tolerance of the optimization. Default 1e-5. |
parallel |
(optional) If TRUE, use parallel |
Details
Details on spline estimator
For an order q
B-splines (q = degree + 1
since an intercept is used) with k
internal knots 0 < t_1
<...< t_k
< T,
the number of B-spline basis equals q + k
. Without truncation (\lambda
_t=0), the function returns smoothing estimate that is
equivalent to the method of Cardot and Sarda (2005), and optimal smoothing parameter is chosen by Generalized Cross Validation (GCV).
Details on family
The model can work with Gaussian or Bernoulli responses. If family="gaussian"
, identity link is used. If family="binomial"
, logit link is used.
Details on scalar predictors
FGLMtrunc
allows using scalar predictors together with functional predictors. If scalar predictors are used, their estimated coefficients
are included in alpha
form fitted model.
Value
A list with components:
grid |
The |
knots |
The |
degree |
The degree of the piecewise polynomial used. |
eta.0 |
Estimate of B-spline coefficients |
beta.0 |
Estimate of functional parameter |
eta.truncated |
Estimate of B-spline coefficients |
beta.truncated |
Estimate of functional parameter |
lambda.s0 |
Optimal smoothing regularization parameter without truncation chosen by GCV. |
lambda.s |
Optimal smoothing regularization parameter with truncation chosen by BIC. |
lambda.t |
Optimal truncation regularization parameter chosen by BIC. |
trunc.point |
Truncation point |
alpha |
Intercept (and coefficients of scalar predictors if used) of truncated model. |
scalar.pred |
Logical variable indicating whether any scalar predictor was used. |
call |
Function call of fitted model. |
family |
Choice of exponential family used. |
References
Xi Liu, Afshin A. Divani, and Alexander Petersen. "Truncated estimation in functional generalized linear regression models" (2022). Computational Statistics & Data Analysis.
Hervé Cardot and Pacal Sarda. "Estimation in generalized linear models for functional data via penalized likelihood" (2005). Journal of Multivariate Analysis.
See Also
bSpline from splines2 R package for usage of B-spline basis.
Examples
# Gaussian response
data(LinearExample)
Y_linear = LinearExample$Y
Xcurves_linear = LinearExample$X.curves
fit1 = fglm_trunc(Y_linear, Xcurves_linear, nbasis = 20, nlambda.s = 1)
print(fit1)
plot(fit1)