Learn R Programming

fitdistcp (version 0.1.1)

ms_predictors_1tail: Model Selection Among 5 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 5 one tailed models with predictors in the fitdistcp package.

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

The input data may be automatically shifted so that the minimum value is positive.

For the Pareto, the data is so that the minimum value is slightly greater than 1.

Usage

ms_predictors_1tail(x, t)

Value

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

  • AIC scores, AIC weights

  • WAIC1 scores, WAIC1 weights

  • WAIC2 scores, WAIC2 weights

  • logscores and logscore weights

Arguments

x

data vector

t

predictor vector

Author

Stephen Jewson stephen.jewson@gmail.com

Details

The 5 models are: exp_p1, pareto_p1k2, lnorm_p1, frechet_p2k1, weibull_p2.

Examples

Run this code
 # because it's too slow for CRAN
set.seed(2)
nx=100
predictor=c(1:nx)/nx
x=rlnorm(nx,meanlog=predictor,sdlog=0.1)
print(ms_predictors_1tail(x,predictor))




Run the code above in your browser using DataLab