Skip to content

Directed Local Testing in the Functional Linear Regression Model

License

Notifications You must be signed in to change notification settings

christophrust/FLRtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Directed Local Testing in the Functional Linear Model

This R package implements the testing procedure described in the manuscript Directed Local Testing in the Functional Linear Model.

Installation

devtools::install_github("https://github.com/christophrust/FLRTest.git")

Example

set.seed(123)

## number of discretization points
p <- 100

## number of observations
N <- 1000

## draw some curves
grd <- seq(0,1,length = p)
X <- t(c(1,1:(p-1))^(-1.5) *
  vapply(1:p, function(j) sqrt(2) * cos((j-1) * pi * grd), numeric(p)) %*%
  matrix(rnorm(N * p), ncol = N))

## generate data via the functional linear model
beta <- pmax(sin(5*grd), 0)
y <- X %*% beta/p + rnorm(N, sd=0.01)

## estimate a FLM and perform the test
est  <- EstFLM(y, X, type = "spline", df=20, intercept = TRUE)
test <- dirTest(est)

## plot results + true functional coefficient
plot(test)
lines(grd, beta, lty = 2, lwd = 2)

About

Directed Local Testing in the Functional Linear Regression Model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published