Description Usage Arguments Value Author(s) Examples
Function for generating a random variate with density p. It should be called after ranlip.PrepareHatFunctionAuto() and/or ranlip.PrepareHatFunction().
1 |
dist |
The distribution function p(x) where x is the array of size dim.. |
output |
The output is a random variate with the density p. |
Gleb Beliakov, Daniela L. Calderon, Deakin University
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | dim<-3
left<-c(0,0,0)
right<-c(5,5,5)
ranlip.Init(dim, left, right);
num <- 10
numfine <- 4
MinLip <- 1
Fn <- function(x,dim){
out <- exp(-sum(x*x))
return(out)
}
ranlip.PrepareHatFunctionAuto(num, numfine, MinLip, Fn)
r<-ranlip.RandomVec( Fn)
print(r)
r<-ranlip.RandomVec( Fn)
print(r)
ranlip.FreeMem()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.