ray: random numbers which obey Rayleighed distribution

Description Usage Arguments Value Examples

Description

generate samples from a Rayleigh(sigma) distribution

Usage

1
ray(x, sigma, R = 10000, antithetic = TRUE)

Arguments

x

the initiation sequence

sigma

the parameter of Rayleigh density

R

the number of replication samples,the default is 10000.

antithetic

the method which generates the cdf.default is TRUE

Value

a random vector that the number is length(x)

Examples

1
2
3
4
5
6
7
8
## Not run: 
x <- seq(.1,2.5,length=5);
set.seed(123)
MC1<- ray(x,sigma=2,anti=FALSE) #for (X1+X2)/2 which X1,X2 is independent
MC2<- ray(x,sigma=2,anti=TRUE)  #for antithetic variables (X+X')/2
print(round(rbind(x, MC1, MC2, Phi),5))

## End(Not run)

qyc1996/StatComp18003 documentation built on May 5, 2019, 11:08 p.m.