randcorr.sample.sink: Sample from the (unnormalized) distribution sin(x)^k, 0 < x <...

Description Usage Arguments Value Details References See Also Examples

View source: R/randcorr.R

Description

Sample from the (unnormalized) distribution sin(x)^k, 0 < x < pi, k >= 1

Usage

1

Arguments

k

The k parameter of the distribution. If this is a vector, the function draws a random variate for every entry in k.

Value

A vector of samples with length equal to the length of k

Details

This code generates samples from the sin(x)^k distribution using the specified vector k.

References

Enes Makalic and Daniel F. Schmidt An efficient algorithm for sampling from sin^k(x) for generating random correlation matrices, arXiv:1809.05212, 2018.

See Also

randcorr

Examples

1
2
3
4
5
6
7
8
# -----------------------------------------------------------------
# Example 1: Draw a random variate from sin(x), 0<x<pi
x = randcorr.sample.sink(1)

# Example 2: Draw a million random variate from sin^3(x), 0<x<pi
x = randcorr.sample.sink( matrix(3, 1e6,1) )
mean(x)
var(x)

randcorr documentation built on May 2, 2019, 7:01 a.m.