Learn R Programming

goffda (version 0.0.7)

elem-flmfr: Covariate, error, and kernel of a functional linear model with functional response

Description

Simulation of \(X\), a random variable in the Hilbert space of square-integrable functions in \([a, b]\), \(L^2([a, b])\), and \(\varepsilon\), a random variable in \(L^2([c, d])\). Together with the bivariate kernel \(\beta\), they are the necessary elements for sampling a Functional Linear Model with Functional Response (FLMFR): $$Y(t) = \int_a^b X(s) \beta(s,t) ds + \varepsilon(t).$$

The next functions sample \(X\) and \(\varepsilon\), and construct \(\beta\), using different proposals in the literature:

  • r_cm2013_flmfr is based on the numerical example given in Section 3 of Crambes and Mas (2013). Termed as S1 in Section 2 of Garc<U+00ED>a-Portugu<U+00E9>s et al. (2019).

  • r_ik2018_flmfr is based on the numerical example given in Section 4 of Imaizumi and Kato (2018), but zeroing the first Functional Principal Components (FPC) coefficients of \(\beta\) (so the first FPC are not adequate for estimation). S3 in Section 2 of Garc<U+00ED>a-Portugu<U+00E9>s et al. (2019).

  • r_gof2019_flmfr gives a numerical example in Section 2 of Garc<U+00ED>a-Portugu<U+00E9>s et al. (2019), denoted therein as S2.

Usage

r_cm2013_flmfr(n, s = seq(0, 1, len = 101), t = seq(0, 1, len = 101),
  std_error = 0.15, n_fpc = 50, concurrent = FALSE)

r_ik2018_flmfr(n, s = seq(0, 1, l = 101), t = seq(0, 1, l = 101), std_error = 1.5, parameters = c(1.75, 0.8, 2.4, 0.25), n_fpc = 50, concurrent = FALSE)

r_gof2019_flmfr(n, s = seq(0, 1, len = 101), t = seq(0, 1, len = 101), std_error = 0.35, concurrent = FALSE)

Arguments

n

number of trajectories to sample.

s, t

grid points where functional covariates and responses are valued, respectively.

std_error

standard deviation of the random variables involved in the generation of the functional error error_fdata. Defaults to 0.15.

n_fpc

number of FPC to be taken into account for the data generation. Must be greater than 4 when r_ik2018_flmfr is applied, since the first \(4\) FPC are null. Defaults to 50.

concurrent

flag to consider a concurrent FLMFR (degenerate case). Defaults to FALSE.

parameters

vector of parameters, only required for r_ik2018_flmfr. Defaults to c(1.75, 0.8, 2.4, 0.25).

Value

A list with the following elements:

X_fdata

functional covariates, an fdata object of length n.

error_fdata

functional errors, an fdata object of length n.

beta

either the matrix with \(\beta(s, t)\) evaluated at the argvals of X_fdata and Y_fdata (if concurrent = FALSE) or a vector with \(\beta(t)\) evaluated at the argvals of X_fdata (if concurrent = TRUE).

Details

Descriptions of the processes \(X\) and \(\varepsilon\), and of \(\beta\) can be seen in the references.

References

Cardot, H. and Mas, A. (2013). Asymptotics of prediction in functional linear regression with functional outputs. Bernoulli, 19(5B):2627--2651. https://doi.org/10.3150/12-BEJ469

Imaizumi, M. and Kato, K. (2018). PCA-based estimation for functional linear regression with functional responses. Journal of Multivariate Analysis, 163:15--36. https://doi.org/10.1016/j.jmva.2017.10.001

Garc<U+00ED>a-Portugu<U+00E9>s, E., <U+00C1>lvarez-Li<U+00E9>bana, J., <U+00C1>lvarez-P<U+00E9>rez, G. and Gonzalez-Manteiga, W. (2019). A goodness-of-fit test linear model with functional response. arXiv:1909.07686. https://arxiv.org/abs/1909.07686

Examples

Run this code
# NOT RUN {
# FLMFR based on Imaizumi and Kato (2018) adopting different Hilbert spaces
s <- seq(0, 1, l = 201)
t <- seq(2, 4, l = 301)
r_ik2018 <- r_ik2018_flmfr(n = 50, s = s, t = t, std_error = 1.5,
                           parameters = c(1.75, 0.8, 2.4, 0.25), n_fpc = 50)
plot(r_ik2018$X_fdata)
plot(r_ik2018$error_fdata)
image(x = s, y = t, z = r_ik2018$beta, col = viridisLite::viridis(20))

# FLMFR based on Cardot and Mas (2013) adopting different Hilbert spaces
r_cm2013 <- r_cm2013_flmfr(n = 50, s = s, t = t, std_error = 0.15,
                           n_fpc = 50)
plot(r_cm2013$X_fdata)
plot(r_cm2013$error_fdata)
image(x = s, y = t, z = r_cm2013$beta, col = viridisLite::viridis(20))

# FLMFR in Garc<U+00ED>a-Portugu<U+00E9>s et al. (2019) adopting different Hilbert spaces
r_gof2019 <- r_gof2019_flmfr(n = 50, s = s, t = t, std_error = 0.35,
                             concurrent = FALSE)
plot(r_gof2019$X_fdata)
plot(r_gof2019$error_fdata)
image(x = s, y = t, z = r_gof2019$beta, col = viridisLite::viridis(20))

# Concurrent model in Garc<U+00ED>a-Portugu<U+00E9>s et al. (2019)
r_gof2019 <- r_gof2019_flmfr(n = 50, s = s, t = s, std_error = 0.35,
                             concurrent = TRUE)
plot(r_gof2019$X_fdata)
plot(r_gof2019$error_fdata)
plot(r_gof2019$beta)
# }

Run the code above in your browser using DataLab