resmth.Bspl: Fit simple nonparametric regression model with cubic...

Description Usage Arguments Value Examples

View source: R/spaddinf.R

Description

Fit simple nonparametric regression model with cubic B-splines

Usage

1
resmth.Bspl(Y, X, d, AAt, sigma.hat, plot = FALSE, x = NULL, alpha = 0.05)

Arguments

Y

a response vector

X

vector of covariate observations

d

the number functions in the cubic B-spline basis

Value

a list containing the fitted function and a vector containing the values of the fitted function at the design points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data <- data_gen(n = 200, q = 50, r = .9)

spadd.presmth.Bspl.out <- spadd.presmth.Bspl(X = data$X,
                                             Y = data$Y,
                                             d.pre = 20,
                                             lambda = 1,
                                             eta = 3,
                                             n.foi = 6)

resmth.Bspl.out <- resmth.Bspl(Y = data$Y.oracle[,1],
                               X = data$X[,1],
                               d = 6,
                               AAt = spadd.presmth.Bspl.out$AAt[[1]],
                               sigma.hat = spadd.presmth.Bspl.out$sigma.hat[1],
                               plot = TRUE)

gregorkb/spaddinf documentation built on July 23, 2021, 4:02 a.m.