FPLMBsplines: Best FPLMBsplines_fit given by a model selection criterion.

Description Usage Arguments Details Value Examples

View source: R/FPLMBsplines.R

Description

Fit a FPLM model for different spline basis sizes and picks the best one according to a specified model selection criterion.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
FPLMBsplines(
  y,
  x,
  u,
  t,
  range_freq = range_default,
  range_spl = range_default,
  norder = 4,
  fLoss = "lmrob",
  criterion = "bic1",
  trace = FALSE
)

Arguments

y

the vector of scalar responses.

x

a matrix of the functional covariates, where each row contains the functions evaluated on a (common) grid.

u

the values of the explanatory variable that enters the model non-parametrically.

t

the grid over which the functional covariates were evaluated.

range_freq

a vector of B-spline basis sizes to try for the functional regression coefficient.

range_spl

a vector of B-spline basis sizes to try for the non-parametric component.

norder

the order of the B-Splines.

fLoss

loss function to be minimized.

criterion

criterion for model selection.

trace

a logical argument indicating whether partial results are printed.

Details

Add some details regarding the criteria, valid ranges (asympotics) and floss options

Value

A list including the following components:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Synthetic data
n <- 100
m <- 50
u <- runif(n)
t <- runif(m)
b <- function(x) x^3
g <- function(x) sin(x)
x <- matrix(rnorm(n * m), nrow = n)
y <- x %*% b(t) * min(diff(t)) + g(u) + rnorm(n, sd = 0.1)

# Best FPLM fit
FPLM_fit <- FPLMBsplines(y, x, u, t,
  range_freq = 4:13, range_spl = 4:13,
  norder = 4, fLoss = "ls", criterion = "bic1", trace = FALSE
)

# Plot the estimates
par(mfrow = c(2, 1))
plot(t, FPLM_fit$fit$slope_fun, pch = 16)
plot(u, FPLM_fit$fit$eta_est, pch = 16)

msalibian/RobustFPLM documentation built on July 4, 2020, 5:46 p.m.