Description Usage Arguments Details Value Examples
Fit a FPLM model for different spline basis sizes and picks the best one according to a specified model selection criterion.
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
)
|
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. |
Add some details regarding the criteria, valid ranges (asympotics) and floss options
A list including the following components:
fitfitted parameters
splchosen number of splines for the non-parametric component
freqchosen number of splines for the funcitonal regression coefficient
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.