outsamp {signalextraction} | R Documentation |
Out of sample values based on the direct filter approach.
outsamp(object, newdata=NULL, sequel=TRUE, ...)
object |
An R object of class
"dfa" , typically the result of dfa() . |
newdata |
For out-of-sample values, this has to be
a numerical vector. It can be of arbitrary length but has
to contain further observations of the time series x. If
newdata is omitted (and therefore equals
NULL ), then the in-sample fitted values are
returned. |
sequel |
Logical, defaults to TRUE and only has
an effect if there are newdata . If set to
TRUE , it is assumed that the new data are a direct
sequel to the original series and thus, these original
values are used for the asymmetric filter. If sequel
is FALSE , then the observations prior to the start
of the new series are estimated by a backcast. |
... |
Further arguments passed to or from other methods. |
This function yields a so-called nowcast for a time series, by
applying the asymmetrical filter obtained from dfa
.
Initial values, at the beginning of a time series, are estimated by
backcasting it. This function, outsamp
can also be used to
produce out-of-sample nowcasts, where the asymmetrical filter is
applied to a time series that was not involved in its estimation.
Output is a numerical vector of the same length as the input vector. It contains the filtered time series.
Marc Wildi & Marcel Dettling, <[wia/dem]@zhwin.ch>
Marc Wildi, Real-Time Signal Extraction (Beyond Maximum Likelihood Principles), Springer. To appear in 2007.
data(fit) ## Instead of calling data(fit), one could run (time consuming) ## set.seed(21) ## data(x) ## fit <- dfa(x) outsamp(fit) plot(outsamp(fit)) plot(outsamp(fit, newdata=rnorm(100), sequel=FALSE))