ms_predictors_2tail: Model Selection Among 6 Distributions with predictors from...

View source: R/04c_ms_predictors_2tail.R

ms_predictors_2tailR Documentation

Model Selection Among 6 Distributions with predictors from the fitdistcp Package

Description

Applies model selection using AIC, WAIC1, WAIC2 and leave-one-out logscore to the input data x,t, for 6 two tail models with predictors in the fitdistcp packages (although for the GEV, the logscore is NA for mathematical reasons).

The code is straightforward, and the point is to illustrate what is possible using the model selection outputs from the fitdistcp routines.

GEVD is temperamental in that it doesn't work if the shape parameter is extreme.

Usage

ms_predictors_2tail(x, t)

Arguments

x

data vector

t

predictor vector

Details

The 11 models are: norm_p1, gumbel_p1, logis_p1, lst_k3_p1, cauchy_p1 and gev_p1.

Value

Plots QQ plots to the screen, for each of the 6 models, and returns a data frame containing

  • AIC scores, AIC weights

  • WAIC1 scores, WAIC1 weights

  • WAIC2 scores, WAIC2 weights

  • logscores and logscore weights

Author(s)

Stephen Jewson stephen.jewson@gmail.com

Examples

 # because it's too slow for CRAN
set.seed(2)
nx=100
predictor=c(1:nx)/nx
x=rnorm(nx,mean=predictor,sd=1)
print(ms_predictors_2tail(x,predictor))





fitdistcp documentation built on June 8, 2025, 1:04 p.m.