best_dist {StockDistFit}R Documentation

Find the best distribution based on AIC values

Description

This function takes in a data frame of AIC values for different distributions and a vector of distribution names, and returns a data frame with the best distribution for each row based on the minimum AIC value. #' You can also write the distribution as "norm" or "cauchy" provided they follow the order in the data frame.

Usage

best_dist(aic_df, dist_names)

Arguments

aic_df

A data frame containing AIC values for different distributions

dist_names

A vector of distribution names corresponding to the AIC values

Value

A data frame with the best distribution for each row based on the minimum AIC value

Note

This function takes the data frame obtained from fit_multiple_dist function

Examples


data <- asset_loader(system.file("extdata", package = "StockDistFit"), c("AAPL", "TSLA"), "Close")
df = fit_multiple_dist(c("norm_fit", "cauchy_fit"), data)
best_dist(df, c("norm_fit", "cauchy_fit"))



[Package StockDistFit version 1.0.0 Index]