dshm_diagnostics: Dignostics tool for Hurdle models

Description Usage Arguments Details Value Author(s)

View source: R/dshm_diagnostics.R

Description

dshm_diagnostics computes the Hurdle model cumulative distribution function (CDF) and it plots it against the empirical distribution function (EDF). It also calculates Kolmogorov-Smirnov test statistics.

Usage

1
dshm_diagnostics(model, mute = FALSE, plot = TRUE, plot.n = 1)

Arguments

model

Hurdle model fitted through dshm_fit.

mute

If TRUE returns p-value and test statistics for Kolmogorov-Smirnov test. Default is FALSE.

plot

If TRUE prints CDF vs EDF and fitted values vs. observed values plots. Default is TRUE.

plot.n

The number of available plots. If plot.n = 1 then the function prints only the CDF vs EDF plot while if plot.n = 2 the function prints both plots for CDF vs EDF plot and fitted values vs. observed values. Default is plot.n = 1.

Details

The Hurdle model CDF is calculated using the following equation:

CDF(n) = (1 - p)(1 - λ) + pλCDF(P(n > 0))

Where n are the number of observations, p is the probability of presence, λ is 0 for absence and 1 for presence, and CDF(P(n > 0)) is the zero-trucated Poisson cumulative distribution function, i.e the probability of observing x given the zero-trucated Poisson parameter.

For more information about fitting Hurdle models you can download the fitting_Hurdle.pdf tutorial.

Value

Two plots for CDF vs. EDF and observed values vs. fitted values. Kolmogorov-Smirnov test statistics and p-value.

Author(s)

Filippo Franchini filippo.franchini@outlook.com


FilippoFranchini/dshm documentation built on April 25, 2020, 9:40 p.m.