问题描述
ts()
函数如何使用其frequency
参数?将错误的值分配为frequency
有什么作用?
How does the ts()
function use its frequency
parameter? What is the effect of assigning wrong values as frequency
?
我正在尝试使用1.5年的网站使用情况数据来建立时间序列模型,以便可以预测未来一段时间的使用情况.我每天都在使用数据. frequency
在这里应该是什么-7或365或365.25?
I am trying to use 1.5 years of website usage data to build a time series model so that I can forecast the usage for coming periods. I am using data at daily level. What should be the frequency
here - 7 or 365 or 365.25?
推荐答案
frequency
是季节性周期重复的那个"时期.我在吓人引号中使用"the",因为当然,时间序列数据通常存在多个周期.例如,每日数据通常显示每周模式(频率为7)和年度模式(频率为365或365.25-差异通常无关紧要).
The frequency
is "the" period at which seasonal cycles repeat. I use "the" in scare quotes since, of course, there are often multiple cycles in time series data. For instance, daily data often exhibit weekly patterns (a frequency of 7) and yearly patterns (a frequency of 365 or 365.25 - the difference often does not matter).
在您的情况下,我认为每周模式占主导地位,因此我将分配frequency=7
.如果您的数据表现出其他模式(例如假日效应),则可以使用考虑多种季节性的专门方法,或者使用虚拟编码和基于回归的框架.
In your case, I would assume that weekly patterns dominate, so I would assign frequency=7
. If your data exhibits additional patterns, e.g., holiday effects, you can use specialized methods accounting for multiple seasonalities, or work with dummy coding and a regression-based framework.
这篇关于频率参数在ts中的作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!