Learn R Programming

StockDistFit (version 1.0.0)

best_dist: 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)

Value

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

Arguments

aic_df

A data frame containing AIC values for different distributions

dist_names

A vector of distribution names corresponding to the AIC values

Examples

Run this code

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"))


Run the code above in your browser using DataLab