Skip to content

marinaferent/tSeriesTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tSeriesTools

R package for testing for unit root and stationarizing series.

The package contains functions that: (1) test for unit root and display type of non-stationarity based on Ayat and Burridge (2000) sequencial procedure (2) based on the exact type of non-stationarity identified, stationarize the series

Installation

library(devtools)
## Loading required package: usethis
install_github("marinaferent/tSeriesTools")
## Skipping install of 'tSeriesTools' from a github remote, the SHA1 (e32e4bd0) has not changed since last install.
##   Use `force = TRUE` to force installation

Usage

library(tSeriesTools)

unitRootDF_ABsequential() - Tests a series for unit root using the Dickey-Fuller test and following the Ayat and Burridge (2000) sequential procedure. It returns a text: A text: “Stationary, no trend”, “Stationary around a linear trend”, “Random walk with drift”, “Unit root and linear trend”.

Example

library(quantmod)
## Loading required package: xts

## Loading required package: zoo

## 
## Attaching package: 'zoo'

## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric

## Loading required package: TTR

## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(urca)
getSymbols("AAPL", src="yahoo")
## [1] "AAPL"
unitRootDF_ABsequential(AAPL$AAPL.Close)
## [1] "Unit root and linear trend"
unitRootDF_ABsequential(AAPL$AAPL.Close, 0.01)
## [1] "Random walk with drift"

stationarize() - Takes a time series of type “Stationary around a linear trend”, “Random walk with drift”, or “Unit root and linear trend” and returns a time series that is “Stationary, no trend”.

Example

library(quantmod)
library(urca)
getSymbols("AAPL", src="yahoo")
## [1] "AAPL"
type=unitRootDF_ABsequential(AAPL$AAPL.Close)
aapl_stationary=stationarize(ts(AAPL$AAPL.Close), type=type)

About

Unit root tests and stationarizing series

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages