Fit a quantile regression models below
$$Q_{Y_i|X_i,Z_i}(\tau) = \sum_{l=1}^L\int_\Omega \beta_l(\tau,t) X_{li}(t) dt + (1,Z_i^T)\gamma$$
where \(Q_{Y_i}(\tau) = F_{Y_i|X_i,Z_i}^{-1}(\tau)\) is the
\(\tau\)-th quantile of \(Y_i\) given \(X_i(t)\) and \(Z_i\),
\(\tau\in(0,1)\).
Model allows one or multiple functional covariate(s) as fixed effect(s),
and zero, one, or multiple scalar-valued covariate(s).
fcQR(
Y,
FC,
Z,
formula.Z,
tau = 0.5,
basis.type = c("Fourier", "Bspline"),
basis.order = 6L,
bs_degree = 3
)
fcQR returns an object of class "fcQR". It is a list that contains the following elements.
Result of the regression.
A list of Fourier_series or bspline_series object(s), represents the functional linear coefficient(s) of the functional covariates.
Type of funtion basis used.
Same as in the arguemnets.
Original data.
Degree of the splines, returned only if b-splines basis is used.
Response variable, can be an atomic vector, a one-column matrix or data frame, recommended form is a one-column data frame with column name
Functional covariate(s), can be a "functional_variable" object or a matrix or a data frame or a list of these object(s)
Scalar covariate(s), can be NULL
or not input (when there's no scalar covariate),
an atomic vector (when only one scalar covariate), a matrix or data frame,
recommended form is a data frame with column name(s)
A formula without the response variable, contains only scalar covariate(s). If not assigned, include all scalar covariates and intercept term.
Quantile \(\tau\in(0,1)\), default is 0.5. See rq
.
Type of funtion basis.
Can only be assigned as one type even if there is more than one functional covariates.
Available options: 'Fourier'
or 'Bspline'
or 'FPC'
,
represent Fourier basis, b-spline basis, and functional principal component (FPC) basis respectively.
For the detailed form for Fourier, b-splines, and FPC basis,
see
fourier_basis_expansion
,
bspline_basis_expansion
, and
FPC_basis_expansion
.
Indicate number of the function basis.
When using Fourier basis \(\frac{1}{2},\sin k t, \cos k t, k = 1,\dots,K\),
basis.order
is the number \(K\).
When using b-splines basis \(\{B_{i,p}(x)\}_{i=-p}^{k}\),
basis.order
is the number of splines, equal to \(k+p+1\).
When using FPC basis, basis.order
is the number of functional principal components.
(same as arguement df
in bs
.)
May set a individual number for each functional covariate.
When the element of this argument is less than the number of functional covariates,
it will be used recursively.
Degree of the piecewise polynomials if use b-splines basis, default is 3.
See degree
in bs
.
Heyang Ji
data(MECfda.data.sim.0.0)
res = fcQR(FC = MECfda.data.sim.0.0$FC, Y=MECfda.data.sim.0.0$Y, Z=MECfda.data.sim.0.0$Z,
basis.order = 5, basis.type = c('Bspline'))
Run the code above in your browser using DataLab