norm_fit {StockDistFit} | R Documentation |
Fit Normal Distribution to a Vector/stock prices.
Description
This function takes a numeric vector and fits a normal distribution to it using the fitdist function from the fitdistrplus package. It returns a list with the mean and standard deviation parameters of the fitted normal distribution, as well as the AIC and BIC values of the fitted distribution.
Usage
norm_fit(vec)
Arguments
vec |
a numeric vector to be fitted with a normal distribution. |
Value
A list with the following components:
- par
a numeric vector with the estimated mean and standard deviation parameters of the fitted normal distribution.
- aic
a numeric value representing the Akaike information criterion (AIC) of the fitted distribution.
- bic
a numeric value representing the Bayesian information criterion (BIC) of the fitted distribution.
See Also
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.normal_fit
,
skew.ged_fit
Examples
# Fit a normal distribution to a vector of returns
stock_prices <- c(10, 11, 12, 13, 14, 17, 18)
returns <- diff(log(stock_prices))
norm_fit(returns)