什么是时间序列预测?
时间序列预测是探索和分析在一定时期内记录或收集的时间序列数据的方法。这种技术被用来预测价值和进行未来预测。并非所有以时间值或日期值为特征的数据都可以被视为时间序列数据。任何适合于时间序列预测的数据都应该由一个有规律的、连续的时间间隔内的观测值组成。
时间序列预测的应用
- 时间序列预测用于股票价格预测,以预测每一天的股票收盘价。
- 电子商务和零售公司使用预测来预测不同产品的销售和销售单位。
- 天气预测是另一个可以使用时间序列预测的应用。
- 政府部门用它来预测一个州的人口,在任何特定地区,或整个国家。
时间序列成分
为了使用时间序列数据并开发一个模型,你需要了解数据随时间变化的模式。这些模式被分为四个部分,分别是:
趋势
它代表了时间序列数据的逐渐变化。趋势模式描述了长期增长或下降。
水平
它指的是系列数据的基线值,如果它是一条直线。
季节性
它代表了在一个时间单位内发生的短期模式,并无限期地重复。
噪声
它代表不规则的变化,是纯粹的随机性。这些波动是不可预见的,不可预测的,而且不能用模型来解释。
时间序列分析是研究在一个时间间隔内收集的数据点序列的具体方法。R语言中的时间序列是用来观察一个物体在一定时间内的表现的。分析师以一致的时间间隔记录这些数据,以获得准确的数据点进行分析。时间序列预测有助于根据以前的观察值预测未来的值。
下面是一个用Time Series Analysis in R的计量经济代考高分案例:
Q1:Use the following instructions in R to analyze the dataset given.
(a) Write the appropriate R code to load the dataset of ”air passengers” and check whether the dataset is in time series format.
(b) Write the appropriate R code to print the summary statistics of the dataset.
(c) Write the appropriate R code to create a time series plot of the dataset.
(d) Write the appropriate R code to plot the autocorrelation function (ACF).
(e)Write the appropriate R code to fit an AR(1) model using the built-in arima(.) function and print the estimated model.
(f) Write the appropriate R code to plot the series along with the fitted values obtained from your AR(1) prediction
Q2:Use the daily Shanghai composite index dataset given in the data.csv file in the learning mall under the R programming folder.
(a) Write the appropriate R code to calculate the log-returns from the daily adjusted close price series omitting the NaN values in the dataset.
(b) Write the appropriate R code to plot the histogram of log-returns with the normal density function superimposed in the plot.
(c) Write the appropriate R code to plot the partial autocorrelations of log-returns and squared logreturns what do you observe?
(d)Write the appropriate R code to identify the order of the AR model for the log returns and squared log-return time series given.
(e) Based on your results in pard (d) explain whether the results indicate any contradiction with the efficient market hypothesis.
Q3:Suppose that the simple return of a monthly bond index follows the MA(1) model
Rt = at + 0.2at−1, σa = 0.025.
Assume that a100 = 0.01.
(a) Compute the 1-step and 2-step ahead forecasts of the return at the forecast origin t = 100.
(b) What are the standard deviations of the associated forecast errors?
(c) Compute the lag-1 and lag-2 autocorrelations of the return series.