Diag_Non_Con_Trunc: Goodness of fit of non-extreme marginal distributions

View source: R/Diag_Non_Con_Trunc.R

Diag_Non_Con_TruncR Documentation

Goodness of fit of non-extreme marginal distributions

Description

Fits ten (truncated) non-extreme marginal distributions to a dataset and returns three plots demonstrating their relative goodness of fit. The distributions are the Birnbaum-Saunders "BS", exponential "Exp", two-parameter gamma "Gam(2)", three-parameter gamma "Gam(3)", mixed two-parameter gamma "GamMix(2)", mixed three-parameter gamma "GamMix(3)", lognormal "LNorm", truncated normal "TNorm", Tweedie "Twe" and the Weibull "Weib".

Usage

Diag_Non_Con_Trunc(
  Data,
  Omit = NA,
  x_lab = "Data",
  y_lim_min = 0,
  y_lim_max = 1
)

Arguments

Data

Numeric vector containing realizations of the variable of interest.

Omit

Character vector specifying any distributions that are not to be tested. Default "NA", all distributions are fit.

x_lab

Character vector of length one specifying the label on the x-axis of histogram and cumulative distribution plot.

y_lim_min

Numeric vector of length one specifying the lower y-axis limit of the histogram. Default is 0.

y_lim_max

Numeric vector of length one specifying the upper y-axis limit of the histogram. Default is 1.

Value

Dataframe $AIC giving the AIC associated with each distribution and the name of the best fitting distribution $Best_fit. Panel consisting of three plots. Upper plot: Plot depicting the AIC of the ten fitted distributions. Middle plot: Probability Density Functions (PDFs) of the fitted distributions superimposed on a histogram of the data. Lower plot: Cumulative Distribution Functions (CDFs) of the fitted distributions overlaid on a plot of the empirical CDF.

See Also

Copula_Threshold_2D

Examples

S20.OsWL<-Con_Sampling_2D(Data_Detrend=S20.Detrend.df[,-c(1,4)],
                         Data_Declust=S20.Detrend.Declustered.df[,-c(1,4)],
                         Con_Variable="OsWL",Thres=0.97)
Diag_Non_Con_Trunc(Data=S20.OsWL$Data$Rainfall,x_lab="Rainfall (Inches)",
                   y_lim_min=0,y_lim_max=2)

rjaneUCF/MultiHazard documentation built on Aug. 17, 2024, 2:14 p.m.