Learn R Programming

hwwntest (version 1.3.2)

Macdonald: Compute the Macdonald density function for a specified parameter value m at a vector of x values.

Description

Compute the Macdonald density function for a specified parameter value m at a vector of x values.

Usage

Macdonald(x, m)

Value

The density

Arguments

x

The x ordinates that you want to evaluate the density at. A vector of real numbers.

m

The parameter of the Macdonald's density

Author

Delyan Savchev and Guy Nason

Details

This function computes the Macdonald probability density function for parameter m and values at which to evaluate the density supplied in x. The mean and variance of this density is zero and one respectively.

References

Nason, G.P. and Savchev, D. (2014) White noise testing using wavelets. Stat, 3, 351-362. tools:::Rd_expr_doi("10.1002/sta4.69")

See Also

compute.rejection, hwwn.test

Examples

Run this code
#
# Work out density at x=0, 0.5 and 1 for the m=1 Macdonald density
#
Macdonald(x=c(0,0.5,1), m=2)
#[1] 0.3535534 0.2975933 0.2075131
#
# Check that the density integrates to one, e.g. for m=3
#
integrate(Macdonald, lower=-20, upper=20, m=3)
#1 with absolute error < 4.7e-07

Run the code above in your browser using DataLab