for working with financial time series, like daily stock prices or intraday data, which time series packages are preferred? xts, plain zoo, or timeSeries or something else? I use both xts and zoo, but sometimes not sure to use xts exclusively or sometimes zoo have advantage of lighter overhead; also, I remembered a review paper on all these packages by Rmetrics, which claims that xts cannot even finish some tests they did. But I cannot find the paper now.
Financial analysts use time series data such as stock price movements, or a company's sales over time, to analyze a company's performance.
Creating a time seriesThe ts() function will convert a numeric vector into an R time series object. The format is ts(vector, start=, end=, frequency=) where start and end are the times of the first and last observation and frequency is the number of observations per unit time (1=annual, 4=quartly, 12=monthly, etc.).
Time Series in R is used to see how an object behaves over a period of time. In R, it can be easily done by ts() function with some parameters. Time series takes the data vector and each data is connected with timestamp value as given by the user.
Time series forecasting uses information regarding historical values and associated patterns to predict future activity. Most often, this relates to trend analysis, cyclical fluctuation analysis, and issues of seasonality. As with all forecasting methods, success is not guaranteed.
I am rather happy with xts and zoo and alternate between the two.
Nothing forces you to use one exclusively. As zoo is a little older, some packages interface it rather than xts. But xts has extensions which provide extra functionality (e.g. the indexing) which make it a valid option.
Other folks may be perfectly happy with Rmetrics classes. It all depends, and is to some extent a matter of personal preferences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With