The estimation functions of the smoots package estimate the nonparametric trend function or its derivatives on the rescaled time interval [0,1]. With this function the derivative estimates can be rescaled in accordance with a given vector with time points.
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]; pass the list element ye
of the output of the functions dsmooth or gsmooth
(if the argument v>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.
Returns
A numeric vector with the rescaled derivative estimates is returned.
Details
The derivative estimation process is based on the additive time series model
yt=m(xt)+ϵt,
where yt is the observed time series with equidistant design, xt is the rescaled time on [0,1], m(xt) is a smooth and deterministic trend function and ϵ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 xt, the derivative estimates returned by these functions are valid for xt 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 xt, are still valid for the actual time points.
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")
Author(s)
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn University),