跳到主要內容

資料序列stationary檢定方法

在這裡指的stationary是指stationary process或stationary time series.

什麼是stationary process?

簡單來說就是在一個process中的data distribution不會經過時間推移或者改變位置就改變, 平均數與變異數也會維持固定, 白雜訊(AWGN)即是一個好例子.
但有些資料序列可能呈現趨勢性(trend), 可能要經過去趨勢性(de-trend)才能顯示stationary的特性, 有些則需要將序列作差分才能顯示

為什麼要確定資料為stationary?

在經濟計量學中, 通常先利用檢定方式確定資料是否呈現stationary, 如否的話檢定資料呈現何種特性, 並做些前處理(如去趨勢性或差分)將資料處理成stationary以方便建立model, 可作為預測未來經濟數據用途

那如何確定資料序列是否為stationary呢? 在這邊Survey了一下幾種常用資料序列檢定方法, 大致可分為兩種:

一、Autoregressive Unit Root Tests

包括以下兩種檢定方式, 其特性是Null hypothesis是假定資料序列擁有unit root(non-stationary), 所以結果出來如果為0表示為擁有unit root,須作差分處理, 1則表示為可能有趨勢性的資料序列, 須作去趨勢性才能呈現stationary

1.Augmented Dickey–Fuller test (ADF): Matlab指令為"adftest"

2.Phillips-Perron test: Matlab指令為"pptest"

二、Stationarity Tests

Null hyphthesis與Autoregressive Unit Root Tests相反, 所以結果為0表示為有趨勢性資料, 結果為1表示為需作差分資料, 主要包括下面這個檢定方式

1.KPSS test: Matlab指令為"kpsstest"

另, 所參考文獻中常出現I(0)或I(1), I(0)表示資料序列不需作差分即可顯示stationary, 而I(1)則代表須作一次差分, 資料序列才能呈現stationary

這個網誌中的熱門文章

Windows好用的command line指令

這邊可以下載toolkit,雖然是2003的, 可以在XP上執行: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en 提供功能如下: Acctinfo.dll (documented in Readme.htm) Adlb.exe: Active Directory Load Balancing Tool Admx.msi: ADM File Parser Atmarp.exe: Windows ATM ARP Server Information Tool Atmlane.exe: Windows ATM LAN Emulation Client Information Autoexnt.exe: AutoExNT Service Cdburn.exe: ISO CD-ROM Burner Tool Checkrepl.vbs: Check Replication Chklnks.exe: Link Check Wizard Chknic.exe: Network Interface Card Compliance Tool for Network Load Balancing Cleanspl.exe: Spooler Cleaner Clearmem.exe: Clear Memory Clusdiag.msi: Cluster Diagnostics and Verification Tool Clusfileport.dll: Cluster Print File Port Clusterrecovery.exe: Server Cluster Recovery Utility Cmdhere.inf: Command Here Cmgetcer.dll: Connection Manager Certificate Deployment Tool Compress.exe: Compress Files Confdisk.exe: Disk Configuration Tool Consume.exe: Memory Consum...

簡單記錄使用matlab作小波轉換的指令

1.C = cwt(data,scale,'wavelet function') cwt作連續小波轉換。data填入欲轉換data, scale可填入多個連續數字(如1:288), 但不可填入太多, 否則C coefficient array memory會爆掉, wavelet function則填入要用來轉換的function, 如Haar, db series, ...等 2.[CA, CD] = dwt(data,'wavelet function') dwt指令只有作一階離散小波轉換, 得到的approximation與detail coefficient分別存入CA與CD中 3.[C,L] = wavedec(data,N,'wavelet function') wavedec指令作多階離散小波轉換, 階數由N決定, C是由離散小波轉換後的approximation與detail組合而成, 以三階為例, C的組成是這樣: A(3) D(3) D(2) D(1) (A是approximation, D是detail, 後面數字則是階數) 而L array中則是包含C的組成裡面, 各個approximation與detail的長度, 以上面為例, L的組成是這樣: length(A(3)) length(D(3)) length(D(2)) length(D(1)) 所以可利用L來存取C中不同的approximation或是detail