Learn R Programming

StockDistFit (version 1.0.0)

skew.normal_fit: Fit Skew Normal Distribution to a vector of returns/stock prices.

Description

This function fits the Skew Normal distribution to a given data vector using the snormFit function from the fGarch package. It returns the estimated parameters along with the AIC and BIC values for the fitted distribution.

Usage

skew.normal_fit(vec)

Value

a list containing the following elements:

params

a numeric vector of length 3 containing the estimated values for the parameters of the fitted distribution: location (mu), scale (sigma), and skewness (alpha).

aic

the Akaike information criterion (AIC) value for the fitted distribution.

bic

the Bayesian information criterion (BIC) value for the fitted distribution.

Arguments

vec

a numeric vector containing the data to be fitted.

See Also

norm_fit, t_fit, cauchy_fit, ghd_fit, hd_fit, sym.ghd_fit, sym.hd_fit, vg_fit, sym.vg_fit, nig_fit, ged_fit, skew.t_fit, skew.ged_fit

Examples

Run this code

stock_prices <- c(10, 11, 12, 13, 14, 17, 18)
returns <- diff(log(stock_prices))
skew.normal_fit(returns)


Run the code above in your browser using DataLab