GMMlogreturn | R Documentation |
Gaussian mixtures for modeling the distribution of financial log-returns.
GMMlogreturn(y, ...)
## S3 method for class 'GMMlogreturn'
summary(object, ...)
y |
A numeric vector providing the log-returns of a financial stock. |
... |
Further arguments passed to |
object |
An object of class |
Let P_t
be the price of a financial stock for the current time frame
(day for instance), and P_{t-1}
the price of the previous time frame.
The log-return at time t
is defined as:
y_t = \log( \frac{P_t}{P_{t-1}} )
A univariate heteroscedastic GMM using Bayesian regularization
(as described in mclust::priorControl()
) is fitted to the observed
log-returns. The number of mixture components is automatically selected
by BIC, unless specified with the optional G
argument.
Returns an object of class 'GMMlogreturn'
.
Luca Scrucca
Scrucca L. (2024) Entropy-based volatility analysis of financial log-returns using Gaussian mixture models. Unpublished manuscript.
VaR.GMMlogreturn()
, ES.GMMlogreturn()
.
set.seed(123)
z = sample(1:2, size = 250, replace = TRUE, prob = c(0.8, 0.2))
y = double(length(z))
y[z == 1] = rnorm(sum(z == 1), 0, 1)
y[z == 2] = rnorm(sum(z == 2), -0.5, 2)
GMM = GMMlogreturn(y)
summary(GMM)
y0 = extendrange(GMM$data, f = 0.1)
y0 = seq(min(y0), max(y0), length = 1000)
plot(GMM, what = "density", data = y, xlab = "log-returns",
breaks = 21, col = 4, lwd = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.