r.mod: Functional regression models for simple and composite...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/scenarios.R

Description

Sampling from the functional linear models considered in the simulation study of Cuesta-Albertos et al. (2019).

Usage

1
2
r.mod(n, scenario, delta = 0, t = seq(0, 1, l = 201), R2 = 0.95,
  composite = TRUE)

Arguments

n

the sample size.

scenario

an index from 1 to 9 denoting the simulation scenario.

delta

an index from 0 to 3 denoting the degree of departure of the data from the null hypothesis of functional linearity, encoded with 0.

t

time locations for the functional data.

R2

proportion of variance of the response Y explained by the linear model when delta = 0. This is used to compute the variance of the error ε of the regression model.

composite

flag to indicate the generation of data according to a functional linear model with non-null coefficient (TRUE) or with a null coefficient (FALSE).

Details

The samples are generated from the regression model

Y = <X, β> + δ Δ(X)+\varepsilon,

where δ Δ(X) is computed by m.dev. The description of the scenarios is detailed in the supplementary material of Cuesta-Albertos et al. (2019).

Value

A list with the following elements:

X.fdata

the sample of functional data, an fdata object of length n.

Y

the scalar responses, a vector of length n.

beta.fdata

the functional coefficient, an fdata object.

Author(s)

Eduardo García-Portugués (edgarcia@est-econ.uc3m.es).

References

Cuesta-Albertos, J.A., García-Portugués, E., Febrero-Bande, M. and González-Manteiga, W. (2019). Goodness-of-fit tests for the functional linear model based on randomly projected empirical processes. Annals of Statistics, 47(1):439-467. https://doi.org/10.1214/18-AOS1693

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Generate samples for all scenarios
samp <- list()
k <- 1
for (i in 1:9) {
  for (delta in 0:3) {
    samp[[k]] <- r.mod(n = 10, scenario = i, delta = delta, R2 = 0.95, 
                       composite = TRUE)
    k <- k + 1
  }
}

egarpor/rp.flm.test documentation built on Oct. 20, 2021, 12:31 a.m.