Learn R Programming

glober (version 1.0)

glober.1d: 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 \(\mathbb{R}\).

Usage

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

Value

festimated

estimation of \(f\) at \(\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 \(1 - \frac{RSS}{TSS}\) where TSS is the total sum-of-squares of the model.

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 \(\texttt{x}\).

xpred

matrix of one column or vector containing the input variables for which \(f\) 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.

Examples

Run this code
# --- 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)

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

Run the code above in your browser using DataLab