时间序列因果关系
When examining a time series, it is quite common to have an intervention influence that series at a particular point.
在检查时间序列时,在特定时间点对该序列产生干预影响是很常见的。
Some examples of this could be:
例如:
- An advertising campaign that results in a significant change in sales 导致销售发生重大变化的广告活动
- A positive change in traffic policy that results in lower road deaths 交通政策的积极变化,可减少道路死亡人数
- A change in economic policy that affects asset prices 影响资产价格的经济政策变化
The problem with analysing the effects of interventions is that one is then unable to examine how that series would have trended without that intervention.
分析干预措施效果的问题在于,如果没有该干预措施,人们将无法检查该系列趋势。
For instance, suppose that a company implements an advertising campaign with the intent of boosting sales. While sales data can be recorded post-intervention — it is not possible to say what the sales would have been without that intervention.
例如,假设一家公司实施了旨在促进销售的广告活动。 虽然销售数据可以记录后干预-这是不可能说什么销售本来没有这种干预。
我们的例子 (Our Example)
For this example, let us consider the impact of an interest rate change on currency fluctuations.
对于此示例,让我们考虑利率变化对货币波动的影响 。
When a central bank manipulates interest rates — this is hypothesised to have a significant impact on a currency as it affects the perceived value of that currency relative to others in the market.
当中央银行操纵利率时,假设这会对货币产生重大影响,因为它会影响该货币相对于市场上其他货币的感知价值。
However, what if we wish to quantify such an impact? Let’s see how this works with the causalimpact package. This package was originally developed by Google for R, but we will use the Python version (pycasualimpact) in this example.
但是,如果我们希望量化这种影响怎么办? 让我们看看它如何与causalimpact包一起工作。 该软件包最初是由Google for R开发的,但是在此示例中,我们将使用Python版本(pycasualimpact)。
Let’s consider fluctuations in the GBP/USD for t