Density for the Husler-Reiss angular surface distribution.

dhurea(x, shape, log = FALSE)

Arguments

x

Same as Uniform.

shape

the positive (shape) parameter. It is often called \(lambda\) and it might not be a shape parameter at all.

log

Logical. If log = TRUE then the logarithm of the density is returned.

Value

dhurea gives the density.

Author

T. W. Yee

Details

See hurea, the VGAM family function for estimating the (shape) parameter \(s\) by maximum likelihood estimation, for the formula of the probability density function.

Note

Difficulties are encountered as the shape parameter approaches 0 with respect to integrate because the density converges to a degenerate distribution with probability mass at 0 and 1. That is, when \(s\) is around 0.5 the density is “u” shaped and the area around the endpoints becomes concentrated at the two points. See the examples below. Approximately, the density is “u” shaped for \(s < 1\) and unimodal for \(s > 2\).

Warning

The cases x == 0, x == 1, shape == 0 and shape == Inf may not be handled correctly.

See also

Examples

integrate(dhurea, 0, 1, shape = 0.20)  # Incorrect
#> 1.426387e-05 with absolute error < 2.4e-05
integrate(dhurea, 0, 1, shape = 0.35)  # struggling but okay
#> 1.000074 with absolute error < 5.3e-05
if (FALSE) x <- seq(0, 1, length = 501)
par(mfrow = c(2, 2))
plot(x, dhurea(x, 0.7), col = "blue", type = "l")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'x' not found
plot(x, dhurea(x, 1.1), col = "blue", type = "l")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'x' not found
plot(x, dhurea(x, 1.4), col = "blue", type = "l")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'x' not found
plot(x, dhurea(x, 3.0), col = "blue", type = "l")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'x' not found
 # \dontrun{}