Hands-On Time Series Analysis with R
Perform time series analysis and forecasting using R
Rami Krispin
- 448 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Hands-On Time Series Analysis with R
Perform time series analysis and forecasting using R
Rami Krispin
About This Book
Build efficient forecasting models using traditional time series models and machine learning algorithms.
Key Features
- Perform time series analysis and forecasting using R packages such as Forecast and h2o
- Develop models and find patterns to create visualizations using the TSstudio and plotly packages
- Master statistics and implement time-series methods using examples mentioned
Book Description
Time series analysis is the art of extracting meaningful insights from, and revealing patterns in, time series data using statistical and data visualization approaches. These insights and patterns can then be utilized to explore past events and forecast future values in the series.
This book explores the basics of time series analysis with R and lays the foundations you need to build forecasting models. You will learn how to preprocess raw time series data and clean and manipulate data with packages such as stats, lubridate, xts, and zoo. You will analyze data and extract meaningful information from it using both descriptive statistics and rich data visualization tools in R such as the TSstudio, plotly, and ggplot2 packages. The later section of the book delves into traditional forecasting models such as time series linear regression, exponential smoothing (Holt, Holt-Winter, and more) and Auto-Regressive Integrated Moving Average (ARIMA) models with the stats and forecast packages. You'll also cover advanced time series regression models with machine learning algorithms such as Random Forest and Gradient Boosting Machine using the h2o package.
By the end of this book, you will have the skills needed to explore your data, identify patterns, and build a forecasting model using various traditional and machine learning methods.
What you will learn
- Visualize time series data and derive better insights
- Explore auto-correlation and master statistical techniques
- Use time series analysis tools from the stats, TSstudio, and forecast packages
- Explore and identify seasonal and correlation patterns
- Work with different time series formats in R
- Explore time series models such as ARIMA, Holt-Winters, and more
- Evaluate high-performance forecasting solutions
Who this book is for
Hands-On Time Series Analysis with R is ideal for data analysts, data scientists, and all R developers who are looking to perform time series analysis to predict outcomes effectively. A basic knowledge of statistics is required; some knowledge in R is expected, but not mandatory.
Frequently asked questions
Information
Forecasting with ARIMA Models
- The stationary state of time series data
- The random walk process
- The AR and MA processes
- The ARMA and ARIMA models
- The seasonal ARIMA model
- Linear regression with the ARIMA errors model
Technical requirement
- forecast: Version 8.5 and above
- TSstudio: Version 0.1.4 and above
- plotly: Version 4.8 and above
- dplyr: Version 0.8.1 and above
- lubridate: Version 1.7.4 and above
- stats: Version 3.6.0 and above
- datasets: Version 3.6.0 and above
- base: Version 3.6.0 and above
The stationary process
- The mean and variance of the series do not change over time
- The correlation structure of the series, along with its lags, remains the same over time
- An Autoregressive (AR) process: Establish a relationship between the series and its past p lags with the use of a regression model (between the series and its p lags)
- A Moving Average (MA) process: Similar to the AR process, the MA process establishes the relationship with the error term at time t and the past error terms, with the use of regression between the two components (error at time t and the past error terms)
- Integrated (I) process: The process of differencing the series with its d lags to transform the series into a stationary state
set.seed(12345)
stationary_ts <- arima.sim(model = list(order = c(1,0,0),
ar = 0.5 ),
n = 500)
library(TSstudio)
ts_plot(stationary_ts,
title = "Stationary Time Series",
Ytitle = "Value",
Xtitle = "Index")