Learn R Programming

partialCI (version 1.2.0)

yfit.pci: Fetch series from Yahoo and perform a partial cointegration fit.

Description

Fetch series from Yahoo and perform a partial cointegration fit.

Usage

yfit.pci(target, factors, start, end, na.rm=FALSE, ...)

Arguments

target

The ticker symbol of the stock price series that is to be modeled.

factors

A list of ticker symbols of stock price series to be used in modeling target

start

The starting date for which data is to be fetched, given in the format YYYYMMDD. Default: 2 years ago today.

end

The ending date for which data is to be fetched, given in the format YYYYMMDD. Default: today.

na.rm

If TRUE, then NA's will be removed from the data.frame of fetched prices. A heuristic approach is used to decide between deleting securities versus deleting days.

...

Additional optional parameters to be passed to fit.pci

Value

An S3 object of class pci.fit representing the best fit that was found.

See Also

fit.pci

Examples

Run this code
# NOT RUN {
# Compare a cointegration fit Coca-Cola and Pepsi to a partial cointegration fit.
# Note that yegcm(X, Y) has a different parameter ordering than yfit.pci(Y, X)
# yegcm("PEP", "KO", start=as.numeric(format(Sys.Date() - 365*2, "%Y%m%d")))
# yfit.pci("KO", "PEP")
# }

Run the code above in your browser using DataLab