Beruflich Dokumente
Kultur Dokumente
QuickR Search
accessing the power of R
Time Series
TreeBased Models
# save a numeric vector containing 48 monthly observations
Bootstrapping # from Jan 2009 to Dec 2014 as a time series object
myts <- ts(myvector, start=c(2009, 1), end=c(2014, 12), frequency=12)
Matrix Algebra
Seasonal Decomposition
A time series with additive trend, seasonal, and irregular components can be decomposed using the stl()
R in Action (2nd ed) significantly
function. Note that a series with multiplicative effects can often by transformed into series with additive
expands upon this material. Use
effects through a log transformation (i.e., newts < log(myts)).
promo code ria38 for a 38%
discount.
# Seasonal decomposition
fit <- stl(myts, s.window="period")
Top Menu plot(fit)
# additional plots
Home monthplot(myts)
library(forecast)
The R Interface
seasonplot(myts)
Data Input
Data Management
# predictive accuracy
library(forecast)
accuracy(fit)