estimate_season: Get the median value for each seasonal period

View source: R/initialize_states.R

estimate_seasonR Documentation

Get the median value for each seasonal period

Description

Get the median value for each seasonal period

Usage

estimate_season(x, m, na_fill)

Arguments

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)

Value

Numeric vector of length equal to that of x

Examples

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)


timradtke/heuristika documentation built on April 24, 2023, 1:55 a.m.