yegcm: Engle-Granger cointegration model from Yahoo! price series

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fetches the Yahoo! price series for two securities and constructs an Engle-Granger cointegration model from them

Usage

1
2
3
4
yegcm(ticker1, ticker2, 
  start = as.numeric(format(Sys.Date() - 365, "%Y%m%d")), 
  end = as.numeric(format(Sys.Date(), "%Y%m%d")), 
  ...)

Arguments

ticker1

the ticker symbol of the first security

ticker2

the ticker symbol of the second security

start

starting date, given in the format YYYYMMDD. Default: One year ago.

end

ending date, given in the format YYYYMMDD. Default: Today.

...

additional parameters passed to egcm

Details

Uses the getYahooData function of the TTR package to retrieve the adjusted closing prices of the two securities over the specified date range. Then, constructs an Engle-Granger cointegration model from this data, and returns it.

Value

An Engle-Granger cointegration model

Author(s)

Matthew Clegg [email protected]

References

Engle, R. F. and C. W. Granger. (1987) Co-integration and error correction: representation, estimation, and testing. Econometrica, 251-276.

See Also

egcm getYahooData

Examples

1
2
3
4
e <- yegcm("SPY", "VOO", 20130101, 20140101)
print(e)
plot(e)
summary(e)

matthewclegg/egcm documentation built on May 21, 2019, 12:59 p.m.