flm_term {goffda} | R Documentation |
Functional linear model term with bivariate kernel
Description
Computation of the functional linear term
\int_a^b \beta(s, t) X(s)\,\mathrm{d}s,
of a Functional Linear Model with Functional Response (FLMFR), where
X
is a random variable in the Hilbert space of
square-integrable functions in [a, b]
, L^2([a, b])
,
\beta
is the bivariate kernel of the FLMFR, and
\varepsilon
is a random variable in L^2([c, d])
.
Usage
flm_term(X_fdata, beta, t, int_rule = "trapezoid", equispaced = NULL,
concurrent = FALSE)
Arguments
X_fdata |
sample of functional data as an
|
beta |
matrix containing the values |
t |
grid points where responses are valued. |
int_rule |
quadrature rule for approximating the definite
unidimensional integral: trapezoidal rule ( |
equispaced |
flag to indicate if |
concurrent |
flag to consider a concurrent FLMFR (degenerate case).
Defaults to |
Value
Functional linear model term as the integral (in s
) between
X_fdata
and beta
, as an fdata
object of
length n
.
Author(s)
Javier Álvarez-Liébana.
References
García-Portugués, E., Álvarez-Liébana, J., Álvarez-Pérez, G. and Gonzalez-Manteiga, W. (2021). A goodness-of-fit test for the functional linear model with functional response. Scandinavian Journal of Statistics, 48(2):502–528. doi:10.1111/sjos.12486
Examples
## Generate a sample of functional responses via FLMFR
# Bivariate kernel beta(s,t) as an egg carton shape
s <- seq(0, 1, l = 101)
t <- seq(0, 1, l = 201)
beta <- outer(s, t, FUN = function(s, t) sin(6 * pi * s) + cos(6 * pi * t))
# Functional data as zero-mean Gaussian process with exponential variogram
X_fdata <- fda.usc::rproc2fdata(n = 50, t = s, sigma = "vexponential",
list = list(scale = 2.5))
# Functional error as an OU process with variance 0.075
sigma <- sqrt(0.075) * 2
error_fdata <- r_ou(n = 50, t = t, sigma = sigma)
Y_fdata <- flm_term(X_fdata = X_fdata, beta = beta, t = t) + error_fdata
plot(Y_fdata)
## Generate a sample of functional responses via concurrent model
# Function beta(t)
s <- seq(1, 3, l = 201)
t <- seq(2, 5, l = 201)
beta <- sin(pi * t) + cos(pi * t)
# Functional data as zero-mean Gaussian process with exponential variogram
X_fdata <- fda.usc::rproc2fdata(n = 50, t = s, sigma = "vexponential",
list = list(scale = 2.5))
# Functional error as an OU process with variance 0.075
sigma <- sqrt(0.075) * 2
error_fdata <- r_ou(n = 50, t = t, sigma = sigma)
Y_fdata <- flm_term(X_fdata = X_fdata, beta = beta, t = t,
concurrent = TRUE) + error_fdata
plot(Y_fdata)