rescale {smoots}R Documentation

Rescaling Derivative Estimates

Description

The estimation functions of the smoots package estimate the nonparametric trend function or its derivatives on the rescaled time interval [0,1][0, 1]. With this function the derivative estimates can be rescaled in accordance with a given vector with time points.

Usage

rescale(y, x = seq_along(y), v = 1)

Arguments

y

a numeric vector or matrix with the derivative estimates obtained for time points on the interval [0,1][0, 1]; pass the list element ye of the output of the functions dsmooth or gsmooth (if the argument v >0> 0) to this argument.

x

a numeric vector of length length(y) with the actual (equidistant) time points ordered from past to present; the default is seq_along(y).

v

the order of derivative that is implemented for y; the default is 1.

Details

The derivative estimation process is based on the additive time series model

yt=m(xt)+ϵt,y_t = m(x_t) + \epsilon_t,

where yty_t is the observed time series with equidistant design, xtx_t is the rescaled time on [0,1][0, 1], m(xt)m(x_t) is a smooth and deterministic trend function and ϵt\epsilon_t are stationary errors with E(eps_[t]) = 0 (see also Beran and Feng, 2002). Since the estimates of the main smoothing functions in smoots are obtained with regard to the rescaled time points xtx_t, the derivative estimates returned by these functions are valid for xtx_t only. Thus, by passing the returned estimates to the argument y, a vector with the actual time points to the argument x and the order of derivative of y to the argument v, a rescaled estimate series is calculated and returned. The function can also be combined with the numeric output of confBounds.

Note that the trend estimates, even though they are also obtained for the rescaled time points xtx_t, are still valid for the actual time points.

Value

A numeric vector with the rescaled derivative estimates is returned.

Author(s)

Examples

data <- smoots::gdpUS
Xt <- log(data$GDP)
time <- seq(from = 1947.25, to = 2019.5, by = 0.25)
d_est <- smoots::dsmooth(Xt)
ye_rescale <- smoots::rescale(d_est$ye, x = time, v = 1)
plot(time, ye_rescale, type = "l", main = "", ylab = "", xlab = "Year")


[Package smoots version 1.1.4 Index]