Time Series 简明教程
Time Series - Parameter Calibration
Introduction
任何统计或机器学习模型都有一些参数,这些参数极大地影响对数据的建模方式。例如,ARIMA 具有 p、d、q 值。这些参数将被决定,使得实际值和建模值之间的误差最小。参数校准被称为模型拟合中最关键和最耗时的任务。因此,为我们选择最优参数非常重要。
Any statistical or machine learning model has some parameters which greatly influence how the data is modeled. For example, ARIMA has p, d, q values. These parameters are to be decided such that the error between actual values and modeled values is minimum. Parameter calibration is said to be the most crucial and time-consuming task of model fitting. Hence, it is very essential for us to choose optimal parameters.
Methods for Calibration of Parameters
有各种方式校准参数。本节将详细讨论其中一些。
There are various ways to calibrate parameters. This section talks about some of them in detail.
Hit-and-try
一种常见的校准模型的方法是手动校准,你在其中首先可视化时间序列,直观地尝试一些参数值并反复更改它们,直到达到足够好的拟合。它要求对我们尝试的模型有一个很好的理解。对于 ARIMA 模型,手工校准是借助自相关图来进行“p”参数、偏自相关图来进行“q”参数和 ADF 测试来确认时间序列的平稳性和设定“d”参数。我们将在接下来的章节中详细讨论所有这些。
One common way of calibrating models is hand calibration, where you start by visualizing the time-series and intuitively try some parameter values and change them over and over until you achieve a good enough fit. It requires a good understanding of the model we are trying. For ARIMA model, hand calibration is done with the help of auto-correlation plot for ‘p’ parameter, partial auto-correlation plot for ‘q’ parameter and ADF-test to confirm the stationarity of time-series and setting ‘d’ parameter. We will discuss all these in detail in the coming chapters.
Grid Search
另一种校准模型的方法是通过网格搜索,其本质上意味着你尝试为所有可能的参数组合构建一个模型,并选择误差最小的那个。这非常耗时,因此当要校准的参数数量及其取值范围较少时才有用,因为这涉及多个嵌套的 for 循环。
Another way of calibrating models is by grid search, which essentially means you try building a model for all possible combinations of parameters and select the one with minimum error. This is time-consuming and hence is useful when number of parameters to be calibrated and range of values they take are fewer as this involves multiple nested for loops.
Genetic Algorithm
遗传算法根据生物学原理工作,即好的解决方案最终会演化到最“最佳”的解决方案。它使用突变、交叉和选择的生物学操作来最终达到最佳解决方案。
Genetic algorithm works on the biological principle that a good solution will eventually evolve to the most ‘optimal’ solution. It uses biological operations of mutation, cross-over and selection to finally reach to an optimal solution.
为了获得更多知识,你可以阅读有关其他参数优化技术的资料,例如贝叶斯优化和粒子群优化。
For further knowledge you can read about other parameter optimization techniques like Bayesian optimization and Swarm optimization.