View source: R/initialize_states.R
estimate_season | R Documentation |
Get the median value for each seasonal period
estimate_season(x, m, na_fill)
x |
Values to be explained by seasonal effects |
m |
The seasonal length |
na_fill |
Value used to replace NAs (usually 1 or 0 or NA) |
Numeric vector of length equal to that of x
x <- rt(n = 55, df = 3) + 5 * cospi((1:55) / 6)
x[seq_along(x) %% 12 == 0] <- NA_real_
plot(x, pch = 19)
lines(x)
s <- tulip:::estimate_season(x = x, m = 12, na_fill = 0)
lines(s, col = "blue", lty = 2)
tulip:::estimate_season(x = x[1:7], m = 12, na_fill = 0)
lines(s, col = "blue", lty = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.