Description Usage Arguments Value Details References See Also Examples
Sample from the (unnormalized) distribution sin(x)^k, 0 < x < pi, k >= 1
1 |
k |
The |
A vector of samples with length equal to the length of k
This code generates samples from the sin(x)^k distribution using the specified vector k
.
Enes Makalic and Daniel F. Schmidt An efficient algorithm for sampling from sin^k(x) for generating random correlation matrices, arXiv:1809.05212, 2018.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.