Description Usage Arguments Details Value Author(s) References See Also Examples

Compute the time localized variance from an evolutionary wavelet spectrum of a time series

1 |

`spec` |
An evolutionary wavelet spectrum, such as that computed
by |

One can compute the local variance of a time series by first
computing its evolutionary wavelet spectrum, e.g., by using
`ewspec`

, and then applying `localvar`

on the
`S`

component of that returned by `ewspec`

.

A vector representing the local variance estimate at successive times.

Guy Nason

Cardinali, A. and Nason, Guy P. (2013) Costationarity of
Locally Stationary Time Series Using costat.
*Journal of Statistical Software*, **55**, Issue 1.

Cardinali, A. and Nason, G.P. (2010) Costationarity of locally stationary
time series. *J. Time Series Econometrics*, **2**, Issue 2, Article 1.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
#
# Let's look at a iid standard normal sequence, variance should be 1, always
# for all times.
#
zsim <- rnorm(64)
#
# Note, in the following I use var as the method of deviance estimation,
# as described in the help there it can be more accurate when transformations
# are not used.
#
z.ews <- ewspec(zsim, smooth.dev=var)$S
#
# Compute the local variance
#
z.lv <- localvar(z.ews)
#
# Plot the local variance against time
#
## Not run: ts.plot(z.lv)
#
# Should be around 1. Note, the vertical scale of the plot might be
# deceptive, as R plots expand the function to the maximum available
# space. If you look again it should be quite close to 1 (e.g. on the
# example I am looking at now the variance is within +/- 0.15 of 1.
#
# However, it might not be close to 1 because the sample size is quite small,
# only 64, so repeat the above analysis with a larger sample size, e.g. 1024.
#
``` |

costat documentation built on May 19, 2017, 12:35 p.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.