1.3 Financial econometrics packages in R
- There are several packages which are helpful in analyzing financial time-series and support different approaches. The packages required for this course are shown in the following table
Package | Description |
---|---|
xts |
Provides fast and flexible tools for managing financial time-series data |
quantmod |
Supports quantitative financial modeling |
PerformanceAnalytics |
Focuses on performance and risk analysis of financial portfolios |
rugarch |
Implements univariate GARCH models for volatility forecasting |
rmgarch |
Extends univariate to multivariate GARCH models |
TTR |
Provides technical trading rules and non-parametric volatility measures |
highfrequency |
Analyzes realized measures of volatility and co-volatility by intraday prices |
evir |
Implements extreme value theory methods for measuring the risk |
Once installed, packages do not need to be reinstalled, but they must be loaded from the library each time you use them in a new session.
To summarize the results in well-formatted and customizable tables an additional package
modelsummary
should be installed and loaded from the library. This package supportsdatasummary()
command to visualize descriptive statistics andmodelsummary()
command to visualize econometric model output.New object
dt
is a data frame with one column. Commanddatasummary()
requires data to be of typedata frame
. Data frame, in general, may contain multiple columns of different types (numeric, character, factor or integer). Rows and columns of any data frame can be named/renamed, which helps in referencing to specific data in later usage.The first argument of command
datasummary()
is two-sidedformula
which uses~
symbol, while last argumentfmt
controls the number of digits.