Skip to contents

Classifies the hazard rate as increasing, decreasing, bathtub-shaped or upside-down bathtub-shaped, and returns the mode of the density.

Usage

bd_hazard_shape(a, b, c, k, n_grid = 400L, range_p = c(1e-04, 1 - 1e-04))

# S3 method for class 'bd_shape'
print(x, ...)

Arguments

a

Shape parameter (beta generator).

b

Shape parameter governing the tail.

c

Shape parameter (baseline).

k

Scale parameter (baseline).

n_grid

Number of grid points between the lower and upper evaluation quantiles.

range_p

Two probabilities bounding the evaluation range.

x

A `"bd_shape"` object.

...

Ignored.

Value

A list of class `"bd_shape"` with the classification, the grid of times, the hazard, Glaser's \(\eta(t) = -f'(t)/f(t)\), and the mode.

Details

Glaser's criterion works through \(\eta(t) = -f'(t)/f(t)\): monotone increasing \(\eta\) gives an increasing hazard, monotone decreasing gives a decreasing hazard, and a single interior turning point gives a bathtub or upside-down bathtub. Here \(\eta\) is formed analytically from the log-density and evaluated on a grid, and the hazard itself is checked alongside it, so the two must agree before a shape is reported.

Examples

s <- bd_hazard_shape(a = 1.5, b = 3, c = 2, k = 1)
s$shape
#> [1] "upside-down bathtub"
s$mode
#> [1] 0.6403874