eBsc {eBsc}R Documentation

Empirical Bayes Smoothing Splines with Correlated Errors

Description

Empirical Bayes smoothing splines with correlated errors. The method uses a recursive algorithm for signal extraction with a non-parametric estimation of the correlation matrix of the errors.

Usage

eBsc(y, q, method, parallel, R0, zero_range, ARpMAq, trace, tol.lambda, tol.rho, max.iter)

Arguments

y

Is a univariate numeric vector without missing values.

q

Is the value of q if known. If left empty the method considers all possibles q's between 1 and 6 and selects the best one according to the Tq criteria. q=NULL is the default.

method

Is a method used for the fit. It can take the values "D" (deterministic fit), "P" (parametric fit) and "N" (non-parametric fit). For example: i) to fit a model with known correlation matrix R.known one should select method = "D" and R0 = R.known; ii) to fit a model with a nonparametric estimation of the correlation and a starting correlation matrix R.start, one should select method = "N" and R0 = R.start; and iii) to fit a model with an ARMA parametric structure R.ARMA, one should select method="P" and ARpMAq=c(1,0). method = "N" is the default.

parallel

Is a logical parameter indicating if parallel computation should be used. parallel=FALSE is the default.

R0

Is the starting correlation matrix. If method = "D" this matrix is not changed by the algorithm.

zero_range

Is the interval to look for zeros in the estimating equation for the smoothing parameter (lambda).

ARpMAq

Is the desired ARMA structure for the noise process.

trace

If true, the process of the algorithm is traced and reported.

tol.lambda

Tolerance level for lambda.

tol.rho

Tolerance level for rho.

max.iter

Maximum number of iterations.

Details

The method assumes the data is equidistant.

Value

A list object of class eBsc containing the following information.

q.hat

estimadted q

lambda.hat

estimated lambda

R.hat

estimated correlation matrix

f.hat

estimated function

cb.hat

estimated condidence bands at a 95% confidence level

sigma2.hat

estimated variance

etq.hat

estimating equation for q

data

data used to fit the model

call

Call of eBsc

Author(s)

Francisco Rosales, Paulo Serra, Tatyana Krivobokova

References

Serra, P. and Krivobokova, T. (2015)
Adaptive Empirical Bayesian Smoothing Splines

See Also

stl (package stats), HoltWinters (package stats)

Examples


library(eBsc)
n <- 250
sigma <- 0.05
beta <- function(x,p,q){
  gamma(p+q)/(gamma(p)*gamma(q))*x^(p-1)*(1-x)^(q-1)
}
x <- seq(0, 1, length.out = n)
mu <- (6 * beta(x, 30, 17) + 4 * beta(x, 3, 11))/10;
mu <- (mu - min(mu))/(max(mu) - min(mu))
noise <- rnorm(n)
y <- mu + sigma * noise

#q assumed known and equal to 3, and correlation unknown
fit <- eBsc(y, method = "N", q=3)
plot(fit, full = FALSE)


[Package eBsc version 4.17 Index]