View source: R/01_seasonal_fit.R
| fit_seasonal_trend | R Documentation |
Fits a truncated Fourier series to daily atmospheric temperature observations.
fit_seasonal_trend(temp, day_of_year)
temp |
Numeric vector of observed daily average temperatures. |
day_of_year |
Numeric vector of day-of-year indices (1 to 365/366). |
A list containing the fitted OLS model, fitted values, and isolated residuals.
doy <- rep(1:365, times = 2)
temp <- 15 + 10 * sin(2 * pi * doy / 365) + stats::rnorm(730, sd = 2)
fit <- fit_seasonal_trend(temp, doy)
print(fit$rmse)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.