# What is frequency in time series in general and in my examples?

1. I have 2 years day-wise data of stock price.
What frequency should I take in this case for next 1 year day-wise prediction?

2. I have one day minute-wise data.
What frequency should I take for next day forecast minute-wise?

Actually I want to know what is the frequency w.r.t. time series and prediction?

I have given you a scenario : I have 2 years day-wise data of stock price. What frequency should I take in this case for next 1 year day-wise prediction? I.e., I want to convert my raw data of stock price for last two years (daily basis) and I want to convert this into a time series for an ARIMA model. I want to know what value for the frequency argument I should give inside ts() of the R software, and how it is decided. Is it clear now?

• What are you mean say "frequency"? Timeframe? 1 hour, 1 day, 1 week, 1 month?
– Nick
Aug 2, 2016 at 7:14
• yes, you need to clarify Aug 2, 2016 at 7:15
• 0 down vote accept I have given tou a scenario : I have 2 years day wise data of stock price.what frequency I should take in this case for next 1 year day wise prediction. ie i want to convert my raw data of stock price for last two years(daily basis) and I want to convert this into a time series for ARIMA model.I want to know what value for frequency argument I should give inside ts() of R s/w. And how it is decided . Is it clear now? Aug 3, 2016 at 7:28

I assume that you have raised this question in context of frequency argument while modeling the time series using some tool, say R.

The interpretation of frequency for time series packages is generally 'the number of observations in a series if you consider the natural time interval of measurement'. For example, if you measure value of some variable once in a month, and you have data for multiple years, you can use value of 12 for frequency.

But things get tricky where there could be multiple levels of seasonality. For example, if you measure number of visitors to a web page every hour, there will be seasonality by hour as well as by day.

Bottom line is, very hard to tell you one single number purely based on information that you have given. You can study Rob J. Hyndman's blog post "Seasonal periods" for more details.

• Yes, This is related to Time series in R. Aug 2, 2016 at 10:08

In most time series analysis, there are two frequencies of interest. One is the sampling frequency $$f_s.$$ This is defined as how often you take a sample: once a year, once a day, one a minute, once every nanosecond, etc. The other frequency of importance is the frequency of whatever the phenomenon is that you're trying to capture. This could be extremely high frequency, on the order of GHz, for radio frequency investigations, or it could be more on the order of Hz for temperature-based phenomena. Let us call this phenomenon frequency $$f_p.$$ Now the Nyquist criterion says that you must sample at least twice the frequency of your phenomenon: $$f_s>2f_p.$$ However, in practice, I recommend $$10$$ times the frequency: $$f_s=10f_p.$$ You will generally get better results that way - much less likely to get aliasing, for example.

In summary:

1. Ask yourself how fast the phenomenon you want to capture is occurring. This is the frequency $$f_p.$$
2. Set your sampling frequency equal to $$f_s=10f_p.$$

In terms of your example, the frequency you need to enter into your R code is undoubtedly $$f_s,$$ but hopefully this explanation will show you how to come up with that frequency.

I also struggle with this very same definition. This is what I understand from all the info pick around different sources. The frequency is the number of observation in which you notice the next batch of the very same number of observation might interpret as next season(tipical phenomena picked up in the series will repeating over) When you plot a series set to freq=10, you will notice the x-axis division contains the same number of observation as the value of the param freq. Though you have to be able to visually tell what is the sazonality of your ts in order set the freq properly