Package 'glober'

Title: Estimating Functions with Multivariate B-Splines
Description: Generalized LassO applied to knot selection in multivariate B-splinE Regression (GLOBER) implements a novel approach for estimating functions in a multivariate nonparametric regression model based on an adaptive knot selection for B-splines using the Generalized Lasso. For further details we refer the reader to the paper Savino, M. E. and Lévy-Leduc, C. (2023), <arXiv:2306.00686>.
Authors: M. E. Savino
Maintainer: Mary E. Savino <[email protected]>
License: GPL-2
Version: 1.0
Built: 2024-11-21 06:47:36 UTC
Source: CRAN

Help Index


Estimating Functions with Multivariate B-Splines

Description

glober consists of two functions: "glober.1d.R" and "glober.2d.R". For further information on how to use these functions, we refer the reader to the vignette of the package.

Details

Eight datasets are also provided within this package and used in examples of this manual and in the vignette.

Author(s)

Mary E. Savino

Maintainer: Mary E. Savino <[email protected]>

References

Savino, M. E. and Levy-Leduc, C. A novel approach for estimating functions in the multivariate setting based on an adaptive knot selection for B-splines with an application to a chemical system used in geoscience (2023), arXiv:2306.00686.


Output values of the evaluation of a function with one input variable and defined as a linear combination of B-splines

Description

The evaluations were obtained by using the fda\texttt{fda} package with 201 input values contained in the xpred_1D.rda file.

Usage

data("f_1D")

Format

Numeric vector of 201 values.


Output values of the evaluation of a function with two input variables and defined as a linear combination of a tensor product of univariate B-splines

Description

The evaluations were obtained by using the fda\texttt{fda} package with 10000 input values contained in the xpred_2D.rda file.

Usage

data("f_2D")

Format

Numeric vector of 10000 values.


Estimation of functions with one input variable

Description

This function implements the method described in Savino, M and Levy-Leduc, C (2023) for estimating functions in the one-dimensional setting with observations which are assumed to satisfy a nonparametric regression model. The observation points belong to a compact set of R\mathbb{R}.

Usage

glober.1d(x, y, xpred, ord, parallel = FALSE, nb.Cores = 1)

Arguments

x

matrix of one column or vector containing the values of the input variables.

y

vector containing the corresponding response variable associated to the input values x\texttt{x}.

xpred

matrix of one column or vector containing the input variables for which ff has to be estimated.

ord

order of the B-spline basis used in the regression model. Default is 3 (quadratic B-splines).

parallel

logical, if TRUE then a parallelized version of the code is used. Default is FALSE.

nb.Cores

numerical, number of cores used for parallelization, if parallel is set to TRUE.

Value

festimated

estimation of ff at xpred\texttt{xpred}.

knotSelec

selected knots used in the definition of the B-splines.

rss

residual sum-of-squares (RSS) of the model.

rsq

R-squared of the model, calculated as 1RSSTSS1 - \frac{RSS}{TSS} where TSS is the total sum-of-squares of the model.

Examples

# --- Loading values of x --- #
data('x_1D')
# --- Loading values of the corresponding y --- #
data('y_1D')
# --- Loading values of xpred --- #
data('xpred_1D')

# --- Estimation of f at xpred --- #
glober.1d(x = x_1D, y = y_1D, xpred = xpred_1D, ord = 3, parallel = FALSE)


# --- Parallel computing --- #
glober.1d(x = x_1D, y = y_1D, xpred = xpred_1D, ord = 3, parallel = TRUE, nb.Cores = 2)

Estimation of functions with two input variables

Description

This function implements the method described in Savino, M and Levy-Leduc, C (2023) for estimating functions in the two-dimensional setting with observations which are assumed to satisfy a nonparametric regression model. The observation points belong to a compact set of R2\mathbb{R}^2.

Usage

glober.2d(x, y, xpred, ord, parallel = FALSE, nb.Cores = 1)

Arguments

x

matrix of two columns containing the values of the input variables.

y

vector containing the corresponding response variable associated to the input values x\texttt{x}.

xpred

matrix of one column or vector containing the input variables for which ff has to be estimated.

ord

order of the B-spline basis used in the regression model. Default is 3 (quadratic B-splines).

parallel

logical, if TRUE then a parallelized version of the code is used. Default is FALSE.

nb.Cores

numerical, number of cores used for parallelization, if parallel is set to TRUE.

Value

festimated

estimation of ff at xpred\texttt{xpred}.

knotSelec

list of selected knots for each dimension used in the definition of the B-splines.

rss

residual sum-of-squares (RSS) of the model.

rsq

R-squared of the model, calculated as 1RSSTSS1 - \frac{RSS}{TSS} where TSS is the total sum-of-squares of the model.

Examples

# --- Loading values of x --- #
data('x_2D')
# --- Loading values of the corresponding y --- #
data('y_2D')
# --- Loading values of xpred --- #
data('xpred_2D')

# --- Estimation of f at xpred --- #
glober.2d(x = x_2D, y = y_2D, xpred = xpred_2D, ord = 3, parallel = FALSE)


# --- Parallel computing --- #
glober.2d(x = x_2D, y = y_2D, xpred = xpred_2D, ord = 3, parallel = TRUE, nb.Cores = 2)

Observation vector x of one variable

Description

An example of observations for the estimation of a function ff with one input variable.

Usage

data("x_1D")

Format

Numeric vector of 70 values.


Observation matrix x of two variables

Description

An example of 100 observations for the estimation of a function ff with two input variables.

Usage

data("x_2D")

Format

Numeric matrix of 100 rows and 2 columns.


Values of the single input variable for which a function has to be estimated

Description

An example of input values containing the observation set and values for which an estimation of a given function ff of one input variable is needed.

Usage

data("xpred_1D")

Format

Numeric vector of 201 values.


Values of the two input variables for which a function has to be estimated

Description

An example of input values containing the observation set and values for which an estimation of a given function ff of two input variables is needed.

Usage

data("xpred_2D")

Format

Numeric matrix of 10000 rows and 2 columns.


Values of the response variable of the noisy observation set of one input variable

Description

An example of noisy observations obtained by adding a Gaussian noise to f(xi)f(x_i) contained in f_1D.rda and associated to the input values contained in x_1D.rda.

Usage

data("y_1D")

Format

Numeric vector of 70 values.


Values of the response variable of the noisy observation set of two input variables

Description

An example of noisy observations obtained by adding a Gaussian noise to f(xi)f(x_i) contained in f_2D.rda and associated to the input values contained in x_2D.rda.

Usage

data("y_2D")

Format

Numeric vector of 100 values.