-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
59 lines (47 loc) · 1.43 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# fable.binary
<!-- badges: start -->
The R package *fable.binary* provides a collection of time series forecasting models suitable for binary time series. These models work within the fable framework, which provides the tools to evaluate, visualise, and combine models in a workflow consistent with the tidyverse.
## Installation
You can install the **development** version from
[GitHub](https://github.com/tidyverts/fable.binary)
```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("tidyverts/fable.binary")
```
## Examples
```{r example, echo = TRUE}
library(fable.binary)
library(ggplot2)
library(dplyr)
# Fit models
fit <- melb_rain |>
model(
nn = BINNET(Wet ~ fourier(K = 1, period = "year")),
logistic = LOGISTIC(Wet ~ fourier(K = 5, period = "year"))
)
# Functions for computing on models
fit |> tidy()
fit |> select(logistic) |> glance()
fit |> select(logistic) |> report()
fit |> select(nn) |> glance()
fit |> select(nn) |> report()
augment(fit)
# Produce forecasts. For neural network, use
fc <- forecast(fit, h = "2 years")
as_tibble(fc) |>
ggplot(aes(x = Date, y = .mean, col = .model)) +
geom_line() +
labs(y = "Probability of rain")
```