% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_seasonal_fit.R
\name{fit_seasonal_trend}
\alias{fit_seasonal_trend}
\title{Fit Fourier Seasonal Baseline Trend}
\usage{
fit_seasonal_trend(temp, day_of_year)
}
\arguments{
\item{temp}{Numeric vector of observed daily average temperatures.}

\item{day_of_year}{Numeric vector of day-of-year indices (1 to 365/366).}
}
\value{
A list containing the fitted OLS model, fitted values, and isolated residuals.
}
\description{
Fits a truncated Fourier series to daily atmospheric temperature observations.
}
\examples{
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)
}
