# Selecting correct frequency for time series data

I have a large dataset consisting of 13, 513 temperature observations for a given city. I am trying to forecast the following month's daily temperatures (in other words, my goal is to forecast the following 30 observations). When removing seasonality, should I choose this based on a frequency of 365 days or 30 days?

Code:

## Setting Up Data
values <- seq(from = as.Date("1993-01-01"), to = as.Date("2029-12-30"), by = 'day')
values <- format(values, format = "%m-%d")
dta$Date <- values colnames(dta) <- c("Temp", "Date") ## Calculating Moving Averages dta$$cnt_ma <- ma(dta$$Temp, order = 7) # Weekly dta$$cnt_ma30 <- ma(dta$$Temp, order = 30) # Monthly dta$$cnt_ma365 <- ma(dta$$Temp, order = 365) # Yearly ## Entering means for NA's dta2 <- replace(dta, TRUE, lapply(dta, na.aggregate)) ##### Removing Seasonality ##### count_ma <- ts(na.omit(dta2$Temp), frequency = 365)
decomp <- stl(count_ma, "periodic")
plot(decomp)

## Test for Stationarity

Acf(count_ma, main = '')
Pacf(count_ma, main = '')

## Fitting Model via auto.arima
fit <- auto.arima(deseasonal_cnt, seasonal = F)
tsdisplay(residuals(fit), main = "(0,1,5) Model Residuals")

par(mfrow = c(1,1))
fcast <- forecast(fit, h = 30)
plot(fcast)


Here's the plot of the data after removing seasonality:

Here's the plot of the data with the forecasted values:

• You're not really asking the correct frequency for time series data. You're really asking how much historical data is needed to predict future data. In other words, I would recommend you change your title to reflect what you're really asking. Commented Apr 22, 2020 at 22:37
• Generally speaking, the more data you have, the better! You say you have $13513$ temperature observations for a given city. How many channels is that? How many time slices is that? Commented Apr 22, 2020 at 22:38
• @AdrianKeister I am quite new at this forecasting material. I'm not 100% sure what you mean by "channels" or "time slices". My dataset is composed of daily observations of a city for roughly 37 years. I this what you're referring to? Commented Apr 22, 2020 at 22:46
• Channels would refer to the number of different locations in the city at which you recorded temperatures. Time slices refers to the snapshots at which you have data. In your case, it looks like you have one channel over a very long period of time. To answer your question, I would just use a model that can incorporate seasonality. You have plenty of data to feed it! The yearly seasonality is going to be much more prominent than the monthly (if there even is any). Commented Apr 22, 2020 at 22:53
• @AdrianKeister Oh in that case yes! You are correct! The data is collected in one city over 37 years. I have created a model that takes in yearly seasonality, but it seems that my forecasts are way off since I get a flat curve when I plot... Commented Apr 22, 2020 at 23:00