randcorr.sample.sink {randcorr} | R Documentation |
Sample from the (unnormalized) distribution sin(x)^k, 0 < x < pi, k >= 1
Description
Sample from the (unnormalized) distribution sin(x)^k, 0 < x < pi, k >= 1
Usage
randcorr.sample.sink(k)
Arguments
k |
The |
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
Examples
# -----------------------------------------------------------------
# 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)
[Package randcorr version 1.0 Index]