-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
70 lines (48 loc) · 1.9 KB
/
README.Rmd
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# TrendLSW
<!-- badges: start -->
[![R-CMD-check](https://github.com/EuanMcGonigle/TrendLSW/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/EuanMcGonigle/TrendLSW/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/EuanMcGonigle/TrendLSW/branch/main/graph/badge.svg)](https://app.codecov.io/gh/EuanMcGonigle/TrendLSW?branch=main)
<!-- badges: end -->
Implements wavelet methods for analysis of nonstationary time series. See
> McGonigle, E. T., Killick, R., and Nunes, M. (2022). Trend locally stationary wavelet processes. *Journal of Time Series Analysis*, 43(6), 895-917.
>
> McGonigle, E. T., Killick, R., and Nunes, M. (2022). Modelling time-varying first and second-order structure of time series via wavelets and differencing. *Electronic Journal of Statistics*, 6(2), 4398-4448.
for full details.
## Installation
You can install the released version of `TrendLSW` from [CRAN](https://CRAN.R-project.org) with:
```
install.packages("TrendLSW")
```
You can install the development version of `TrendLSW` from [GitHub](https://github.com/) with:
```
devtools::install_github("https://github.com/EuanMcGonigle/TrendLSW")
```
## Usage
For detailed examples, see the help files within the package. We can generate a small example for performing trend and spectrum estimation as follows:
```{r}
library(TrendLSW)
set.seed(1)
noise <- rnorm(512) * c(seq(from = 1, to = 3, length = 256), seq(from = 3, to = 1, length = 256))
trend <- seq(from = 0, to = 5, length = 512)
x <- trend + noise
```
Apply the `TLSW` function:
```{r}
x.TLSW <- TLSW(x)
```
Visualise the estimated trend and spectrum:
```{r TLSW-plot}
plot(x.TLSW)
```