FLiRTI {PFLR} | R Documentation |
FLiRTI Regression Model
Description
Calculates functional regression that's interpretable using the FLiRTI method.
Usage
FLiRTI(
Y,
X,
d,
cons,
domain,
extra = list(Mf = 6:30, lambda = seq(5e-04, 100, length.out = 50))
)
Arguments
Y |
Vector of length n, centred response. |
X |
Matrix of n x p, covariate matrix, should be dense. |
d |
Integer, degree of the B-spline basis functions. |
cons |
Divide subinterval into how many small ones. |
domain |
The range over which the function X(t) is evaluated and the coefficient function |
extra |
List containing parameters which have default values:
|
Value
beta: Estimated \beta
(t) at discrete points.
extra: List containing other values which may be of use:
X: Matrix of n x p used for model.
Y: Vector of length n used for model.
domain: The range over which the function X(t) was evaluated and the coefficient function
\beta
(t) was expanded by the B-spline basis functions.delta: Estimated cutoff point.
OptM: Optimal number of B-spline knots selected by BIC.
Optlambda: Optimal shrinkage parameter selected by BIC.
Examples
library(fda)
betaind = 1
snr = 2
nsim = 200
n = 50
p = 21
Y = array(NA,c(n,nsim))
X = array(NA,c(n,p,nsim))
domain = c(0,1)
lambda = seq(0.0005,0.01,length.out = 10)
Mf = 6:13
extra=list(Mf=Mf,lambda=lambda)
for(itersim in 1:nsim)
{
dat = ngr.data.generator.bsplines(n=n,nknots=64,norder=4,p=p,domain=domain,snr=snr,betaind=1)
Y[,itersim] = dat$Y
X[,,itersim] = dat$X
}
fltyfit = FLiRTI(Y=Y[1:n,1],(X[1:n,,1]),d=3,cons=4,domain=domain,extra=extra)