R語言 arima函數


 

arima(stats)
arima()所屬R語言包:stats

                                        ARIMA Modelling of Time Series
                                         時間序列的ARIMA模型建模

                                       

描述----------Description----------

Fit an ARIMA model to a univariate time series.
適合一個單變量時間序列的ARIMA模型。


用法----------Usage----------


arima(x, order = c(0, 0, 0),
      seasonal = list(order = c(0, 0, 0), period = NA),
      xreg = NULL, include.mean = TRUE,
      transform.pars = TRUE,
      fixed = NULL, init = NULL,
      method = c("CSS-ML", "ML", "CSS"),
      n.cond, optim.method = "BFGS",
      optim.control = list(), kappa = 1e6)



參數----------Arguments----------

參數:x
a univariate time series
單變量的時間序列


參數:order
A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order

, the degree of differencing, and the MA order.
非季節性的ARIMA模型的規范的三個組成部分(p, d, q)是的AR秩序,一定程度的差異,以及馬秩序。


參數:seasonal
A specification of the seasonal part of the ARIMA model, plus the period (which defaults to frequency(x)). This

should be a list with components order and period, but a specification of just a numeric vector of length 3 will

be turned into a suitable list with the specification as the order.
一個規范的季節ARIMA模型的一部分,加上期間(默認frequency(x))。這應該是一個組件列表order和period,但只是一個

長度為3的數字向量的規范將到一個合適的名單與order規范。


參數:xreg
Optionally, a vector or matrix of external regressors, which must have the same number of rows as x.
或者,一個向量或矩陣的外部回歸,必須有相同數量的行x。


參數:include.mean
Should the ARMA model include a mean/intercept term?  The default is TRUE for undifferenced series, and it

is ignored for ARIMA models with differencing.
ARMA模型應包括平均/截距項?默認的是TRUE非差系列,它是有差異的ARIMA模型忽略。


參數:transform.pars
Logical.  If true, the AR parameters are transformed to ensure that they remain in the region of stationarity.  

Not used for method = "CSS".
邏輯。如果情況屬實,AR參數的改變,以確保它們保持在平穩的區域。不習慣method = "CSS"。


參數:fixed
optional numeric vector of the same length as the total number of parameters.  If supplied, only NA entries

in fixed will be varied.  transform.pars = TRUE will be overridden (with a warning) if any AR parameters are

fixed. It may be wise to set transform.pars = FALSE when fixing MA parameters, especially near non-invertibility.  
可選的數字作為參數的總數相同長度的向量。如果提供,僅NA項fixed將各不相同。 transform.pars = TRUE將重寫(警告),

如有AR參數是固定的。它可能是明智的設置transform.pars = FALSE固定MA參數時,特別是附近的非可逆性。


參數:init
optional numeric vector of initial parameter values.  Missing values will be filled in, by zeroes except for

regression coefficients.  Values already specified in fixed will be ignored.
可選的數字矢量的初始參數值。失蹤的值將被填補,除了回歸系數為零。已經fixed指定的值將被忽略。


參數:method
Fitting method: maximum likelihood or minimize conditional sum-of-squares.  The default (unless there are

missing values) is to use conditional-sum-of-squares to find starting values, then maximum likelihood.
擬合方法:最大的可能性或減少有條件的平方的總和。默認(除非有缺失值)使用條件和平方找到初始值,然后最大可能性。


參數:n.cond
Only used if fitting by conditional-sum-of-squares: the number of initial observations to ignore.  It will be

ignored if less than the maximum lag of an AR term.
只用了,如果有條件和最小二乘擬合:忽略了初步意見。它會被忽略,如果小於最大的一個AR長期滯后。


參數:optim.method
The value passed as the method argument to optim.
methodoptim參數傳遞的值。


參數:optim.control
List of control parameters for optim.
名單optim的控制參數。


參數:kappa
the prior variance (as a multiple of the innovations variance) for the past observations in a differenced model.

  Do not reduce this.
前方差(創新方差的倍數)差分模型在過去的觀測。不減少。


Details

詳情----------Details----------

Different definitions of ARMA models have different signs for the AR and/or MA coefficients.  The definition used

here has
ARMA模型有不同的定義有不同的AR和/或MA系數的跡象。這里所用的定義有

and so the MA coefficients differ in sign from those of S-PLUS. Further, if include.mean is true (the default for an

ARMA model), this formula applies to X - m rather than X.  For ARIMA models with differencing, the differenced

series follows a zero-mean ARMA model. If am xreg term is included, a linear regression (with a constant term if

include.mean is true and there is no differencing) is fitted with an ARMA model for the error term.
所以馬系數不同,S-PLUS標志。此外,如果include.mean是真實的(默認為ARMA模型),該公式適用於X - m而不是X。

ARIMA模型與差異,差分系列如下零平均ARMA模型。如果上午xreg項,線性回歸(常數項,如果include.mean是真實而有差異)

與ARMA模型擬合誤差項。


The variance matrix of the estimates is found from the Hessian of the log-likelihood, and so may only be a rough guide.
從黑森州的對數似然估計的方差矩陣被發現,所以可能只是一個粗略的指南。

Optimization is done by optim.  It will work best if the columns in xreg are roughly scaled to zero mean and unit

variance, but does attempt to estimate suitable scalings.
優化完成optim。它將工作最好的,如果在列xreg大致縮小到零均值和單位方差,但沒有試圖估計合適的結垢。


值----------Value----------

A list of class "Arima" with components:
一類"Arima"與組件的列表:


參數:coef
a vector of AR, MA and regression coefficients, which can be extracted by the coef method.
AR,MA和回歸系數,可以通過coef方法提取向量。


參數:sigma2
the MLE of the innovations variance.
創新方差MLE。


參數:var.coef
the estimated variance matrix of the coefficients coef, which can be extracted by the vcov method.
系數的估計方差矩陣coef,它可以通過vcov方法提取。


參數:loglik
the maximized log-likelihood (of the differenced data), or the approximation to it used.
最大化日志的可能性(差分數據),或近似的使用。


參數:arma
A compact form of the specification, as a vector giving the number of AR, MA, seasonal AR and seasonal

MA coefficients, plus the period and the number of non-seasonal and seasonal differences.
一個緊湊的形式規范,作為向量提供的AR,MA,季節性AR和季節性馬系數,加上期間和非季節性和季節性差異。


參數:aic
the AIC value corresponding to the log-likelihood. Only valid for method = "ML" fits.
AIC值,相應的對數似然。只method = "ML"有效適合。


參數:residuals
the fitted innovations.
擬合的創新。


參數:call
the matched call.
匹配的呼叫。


參數:series
the name of the series x.
名稱系列x。


參數:code
the convergence value returned by optim.
收斂值返回optim。


參數:n.cond
the number of initial observations not used in the fitting.
不是在裝修中使用的初步意見。


參數:model
A list representing the Kalman Filter used in the fitting.  See KalmanLike.
代表卡爾曼濾波的列表,在裝修中使用。看到KalmanLike。


擬合方法----------Fitting methods----------

The exact likelihood is computed via a state-space representation of the ARIMA process, and the innovations

and their variance found by a Kalman filter.  The initialization of the differenced ARMA process uses stationarity

and is based on Gardner et al. (1980).  For a differenced process the non-stationary components are given

a diffuse prior (controlled by kappa).  Observations which are still controlled by the diffuse prior (determined by

having a Kalman gain of at least 1e4) are excluded from the likelihood calculations. (This gives comparable

results to arima0 in the absence of missing values, when the observations excluded are precisely those dropped

by the differencing.)
通過ARIMA過程的狀態空間表示,創新和卡爾曼濾波器的方差計算精確的可能性。差的ARMA過程的初始化使用的平穩性和Gardner等。

(1980年)。一個差的過程非平穩組件彌漫事先(控制kappa)。仍然彌漫事先控制的意見(由卡爾曼增益至少1e4)從計算的可能性

排除。 (這使比較的結果arima0缺失值的情況下,排除的意見時,恰恰是那些下跌的差異。)

Missing values are allowed, and are handled exactly in method "ML".
遺漏值是允許的,准確的處理方法"ML"。

If transform.pars is true, the optimization is done using an alternative parametrization which is a variation on

that suggested by Jones (1980) and ensures that the model is stationary.  For an AR(p) model the

parametrization is via the inverse tanh of the partial autocorrelations: the same procedure is applied (separately)

to the AR and seasonal AR terms.  The MA terms are not constrained to be invertible during optimization,

but they will be converted to invertible form after optimization if transform.pars is true.
transform.pars如果是真實的,使用替代參數化,這是由瓊斯(1980年)的建議,並確保該模型是靜止的變化進行優化。對於

AR(p)模型的參數化是通過反偏自相關的tanh:應用相同的過程(分別)AR和季節性AR條款。馬條款沒有約束在優化過程中是

可逆的,但他們將被轉換后優化transform.pars如果是真正的可逆形式。

Conditional sum-of-squares is provided mainly for expositional purposes.  This computes the sum of squares of

the fitted innovations from observation n.cond on, (where n.cond is at least the maximum lag of an AR term),

treating all earlier innovations to be zero.  Argument n.cond can be used to allow comparability between different fits.

  The "part log-likelihood" is the first term, half the log of the estimated mean square.  Missing values are allowed, but

will cause many of the innovations to be missing.
有條件的總和平方提供主要用於expositional目的。這擬合創新的平方的總和計算,從觀察n.cond(其中n.cond至少是最大的一個AR

長期滯后),處理所有早期的創新,是零。參數n.cond可以用來允許不同的配合之間的可比性。 的一部分日志的可能性“是第一個任期

內,有一半的估計均方的日志。遺漏值是允許的,但將導致許多創新的缺失。

When regressors are specified, they are orthogonalized prior to fitting unless any of the coefficients is fixed.  It can be

helpful to roughly scale the regressors to zero mean and unit variance.
當回歸是指定的,它們是正交前裝修,除非是固定的系數。它可以幫助大致規模回歸到零均值和單位方差。


注意----------Note----------

The results are likely to be different from S-PLUS's arima.mle, which computes a conditional likelihood and does not

include a mean in the model.  Further, the convention used by arima.mle reverses the signs of the MA coefficients.
其結果很可能是從不同,S-PLUS的arima.mle,計算條件的可能性,不包括在模型中的平均。此外,arima.mle公約反轉的MA系數的

跡象。


arima is very similar to arima0 for ARMA models or for differenced models without missing values, but handles

differenced models with missing values exactly. It is somewhat slower than arima0, particularly for seasonally differenced models.
arima很相似arima0ARMA模型或不遺漏值差的模型,但完全處理缺失值的差模型。它比arima0是有點慢,特別是季節性差分模型。


參考文獻----------References----------

Series and Forecasting. Springer, New York. Sections 3.3 and 8.3.
State Space Methods.  Oxford University Press.
AS154. An algorithm for exact maximum likelihood estimation of autoregressive-moving average models by means of Kalman

filtering. Applied Statistics 29, 311–322.


2nd Edition, Harvester Wheatsheaf, sections 3.3 and 4.4.
series with missing observations. Technometrics 20 389–395.
R News, 2/2, 2–7. http://www.r-project.org/doc/Rnews/Rnews_2002-2.pdf

參見----------See Also----------

predict.Arima, arima.sim for simulating from an ARIMA model, tsdiag, arima0, ar
predict.Arima,arima.sim模擬ARIMA模型,tsdiag,arima0,ar


舉例----------Examples----------


arima(lh, order = c(1,0,0))
arima(lh, order = c(3,0,0))
arima(lh, order = c(1,0,1))

arima(lh, order = c(3,0,0), method = "CSS")

arima(USAccDeaths, order = c(0,1,1), seasonal = list(order=c(0,1,1)))
arima(USAccDeaths, order = c(0,1,1), seasonal = list(order=c(0,1,1)),
      method = "CSS") # drops first 13 observations.[降至第一個13意見。]
# for a model with as few years as this, we want full ML[一個模型,因為這幾年,我們要充分的ML]

arima(LakeHuron, order = c(2,0,0), xreg = time(LakeHuron)-1920)

## presidents contains NAs[#總統包含定居]
## graphs in example(acf) suggest order 1 or 3[#例如圖(ACF)建議1階或3]
require(graphics)
(fit1 <- arima(presidents, c(1, 0, 0)))
tsdiag(fit1)
(fit3 &lt;- arima(presidents, c(3, 0, 0)))  # smaller AIC[較小的工商行政管理機關]
tsdiag(fit3)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM