norm_fit | R Documentation |
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.
norm_fit(vec)
vec |
a numeric vector to be fitted with a normal distribution. |
A list with the following components:
a numeric vector with the estimated mean and standard deviation parameters of the fitted normal distribution.
a numeric value representing the Akaike information criterion (AIC) of the fitted distribution.
a numeric value representing the Bayesian information criterion (BIC) of the fitted distribution.
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
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.