FunRegPoI | R Documentation |
Functional Linear Regression with Points of Impact
FunRegPoI(Y, X_mat, grd, add.vars = NULL, estimator = c("PESES", "KPS", "CKS"), maxPoI = 8, A_m, X_B, ...)
Y |
A vector of length N containing the scalar dependent variable. |
X_mat |
A p \times N-matrix holding the functional predictors, where p
is the number of grid points provided by |
grd |
A vector of length p giving the location of the (equidistant) grid where the functional observations are observed. |
add.vars |
Additional explanatory variables (optional, e.g. seasonal dummies or further scalar valued covariates, supplied as a matrix. |
estimator |
Character, one of "PESES" , "KPS" (Kneip, Poss and Sarda, 2016), "CKS" (Crambes, Kneip and Sarda, 2016), see details. |
maxPoI |
Maximum number of PoIs. |
A_m |
An optional p \times p matrix holding the scalar product of
the basis function's second derivatives. Specifying this argument
togehter with the |
X_B |
An optional p \times p matrix of the natural cubic spline
basis evaluated at |
... |
Further arguments passed to |
FunRegPoI
estimates the functional linear regression model with
points of impact. It offers the usage of different estimators, such as
the originally suggested FPCA-based approach or an estimation
approach based on smoothing splines. In particular, the PESES approach
as proposed in Liebl, Rameseder, Rust (2017), is implemented.
FunRegPoI
estimates the functional linear regression model with points
of impact (Kneip, Poss, Sarda, 2010). In addition to the proposed
FPCA-based estimator, an estimation procedure based on smoothing
splines is available. This approach is based on the work of Crambes, Kneip and Sarda
(2009) which is extended to the situation with points of impact in
Liebl, Rameseder, Rust (2017). The default estimator in this situation
is called "PESES"
and implements the proposed estimation
procedure which consists in a sequential selection procedure, see
Liebl, Rameseder, Rust (2017) for a more detailed description:
Preselect potential points of impact.
Estimate a β-curve and PoI coefficients given the potential points of impact.
Sub-Select relevant points of impact.
re-Estimate a final β-curve and PoI cofficients given the selected points of impact.
re-Select the final set of points of impact.
Object of class "FunRegPoI"
:
coefficients |
A list holding the estimated β-curve ( |
residuals |
A vector of length p with residuals of the fit. |
fitted |
A vector of length p with fitted values of the estimate. |
call |
Type of the estimator (PESES , CKS, or KPS). |
model |
A list containing the relevant model parameters, such as |
kSeqRes |
A list of same length as |
The estimation procedure retransforms any grd
covering a domain
different from [0,1] onto the unit interval. Also the estimation
output is defined on this interval and has to be interpreted
accordingly. Of course, this has no effect on the estimates of the
points of impact coefficients, but their location also is transformed
to the unit interval.
Dominik Liebl, Stefan Rameseder and Christoph Rust
Crambes, C., Kneip, A., Sarda, P. (2009) Smoothing Splines Estimators for Functional Linear Regression. The Annals of Statistics, 37(1), 35-72.
Kneip A., Poss, D., Sarda, P. (2016) Functional Linear Regression with Points of Impact. The Annals of Statistics, 44(1), 1-30.
Liebl, D., Rameseder, S., Rust, C. (2018) Improving Estimation in Functional Linear Regression with Points of Impact: Insights into Google AdWords. Available at www.dliebl.com/files/Liebl_Rameseder_Rust_2017.pdf
FunRegPoISim
, calSecDerNatSpline
library(FunRegPoI) ## Define Parameters for Simulation DGP_name <- "Easy" k_seq <- c(1,seq(2, 62, 4)) error_sd <- 0.125 N <- 500 p <- 300 domain <- c(0,1) grd <- seq(domain[1],domain[2],length.out = p) set.seed(1) ## simulate some data: PoISim <- FunRegPoISim(N = N , grd, DGP = DGP_name , error_sd = error_sd) # PESES EstPeses <- FunRegPoI(Y = PoISim$Y , X_mat = PoISim$X , grd, estimator = "PESES", k_seq = k_seq) # KPS EstKPS <- FunRegPoI(Y = PoISim$Y , X_mat = PoISim$X , grd, estimator = "KPS", k_seq = k_seq) # CKS EstCKS <- FunRegPoI(Y = PoISim$Y , X_mat = PoISim$X , grd, estimator = "CKS") par(mfrow=c(3,1)) plot(EstPeses, main = "PESES") lines(x = grd , y = PoISim$trueBetaCurve , col ="red") abline( v = PoISim$trueTauGrd , col ="red" , lwd = 2) plot(EstKPS, main = "KPS") lines(x = grd , y = PoISim$trueBetaCurve , col ="red") abline( v = PoISim$trueTauGrd , col ="red" , lwd = 2) plot(EstCKS, main = "KPS") lines(x = grd , y = PoISim$trueBetaCurve , col ="red") abline( v = PoISim$trueTauGrd , col ="red" , lwd = 2) dev.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.