RandomVecN: Generates variate function with density p

Description Usage Arguments Value Author(s) Examples

Description

Function for generating n random variates with density p. It should be called after ranlip.PrepareHatFunctionAuto() and ranlip.PrepareHatFunction().

Usage

1

Arguments

n

The number of random vectors desired

dist

The distribution function p(x) where x is the array of size dim..

Value

output

The output is n random variates with the density p, in a matrix arranged by rows.

Author(s)

Gleb Beliakov, Daniela L. Calderon, Deakin University

Examples

 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
    dim<-2
	left<-c(-2,-2)
	right<-c(2,2)

	ranlip.Init(dim, left, right);

	num <- 10
	numfine <- 4
	MinLip <- 1

	Fn <- function(x,dim){
		r<-x[1]*x[1]+x[2]*x[2]
		out <- exp(-( (x[1]+0.2)^2+(x[2]+0.1)^2)/1.1 )*(1-exp(-sqrt(r)))
		return(out)
	}
	

	ranlip.PrepareHatFunctionAuto(num, numfine, MinLip, Fn)
	
	rv<-ranlip.RandomVecN(100, Fn)
	

	plot(rv[,1],rv[,2],cex=0.5)
 
    ranlip.FreeMem()
                

ranlip documentation built on June 24, 2021, 9:08 a.m.

Related to RandomVecN in ranlip...