| po_2d_fit | R Documentation |
The po_2d_fit function fits functional regression models for partially
observed bidimensional functional data, where each surface is only observed
over part of the common domain.
po_2d_fit(formula, data, family = stats::gaussian(), offset = NULL)
formula |
a formula object with at least one |
data |
a |
family |
a |
offset |
an offset vector. The default value is |
An object of class po_2d_fit. It is a list containing the
following items:
An item named fit of class sop. See sop.fit.
An item named Beta which is a list with one entry per functional term,
each containing the estimated coefficient surface (beta), its standard
error (se), the lower and upper pointwise confidence limits (lower,
upper) and the grids (x, y).
An item named intercept which is the estimated intercept of the model.
An item named theta which is the basis coefficient vector of the
estimated bidimensional functional coefficient.
An item named covar_theta which is the covariance matrix of the basis
coefficients, used to build the pointwise confidence intervals.
An item named M which holds the observed domain information for each
functional term.
An item named ffpo_2d_evals which is the result of the evaluations of the
ffpo_2d terms in the formula.
ffpo_2d
# PARTIALLY OBSERVED BIDIMENSIONAL FUNCTIONAL DATA EXAMPLE
# set seed for reproducibility
set.seed(123)
# generate example data with partially observed surfaces
sim <- data_generator_po_2d(n = 30, grid_x = 8, grid_y = 8)
X <- sim$noisy_surfaces_miss
y <- sim$response
mp <- sim$missing_points
mpts <- sim$miss_points
# Fit the model using an 'ffpo_2d' term for the partially observed surfaces.
# 'miss_points' and 'missing_points' describe the missing observations in the
# two complementary formats expected by 'ffpo_2d'.
fit <- po_2d_fit(
response ~ ffpo_2d(
X = X, miss_points = mpts, missing_points = mp, nbasis = rep(5, 4)
),
data = list(response = y, X = X)
)
# Inspect the structure of the returned object
str(fit, max.level = 1)
# The basis coefficients of the functional coefficient can be accessed directly
fit$theta
# A summary of the underlying fit can be obtained using the summary function
summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.