IsStationary: Check the stationarity of time series (spread)

Description Usage Arguments Value Author(s) Examples

View source: R/Cointegration.R

Description

Check the stationarity of time series by Phillips-Perron Test for Unit Roots and Augmented Dickey-Fuller Test.

Usage

1
IsStationary(spread, threshold) 

Arguments

spread

checked time series object(xts)

threshold

threshhold value of p-value

Value

the vector which have the result of each test passed or not.

Author(s)

Shinichi Takayanagi, Kohta Ishikawa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#load library
library(PairTrading)

#load sample stock price data
data(stock.price)

#select 2 stocks
price.pair <- stock.price[,1:2]["2008-12-31::"]

#Estimate parameters & plot spread
reg <- EstimateParameters(price.pair, method = lm)

#check stationarity
IsStationary(reg$spread, 0.1)

PairTrading documentation built on May 2, 2019, 6:11 p.m.