Learn R Programming

ssym (version 1.1)

rvgs: Random generation for some symmetric continuous distributions.

Description

rvgs is used to random generation from some standard symmetric continuous distributions.

Usage

rvgs(n, family, xi)

Arguments

n
number of observations.
family
a description of the distribution to be generated. Supported families include Normal, Student, Powerexp, Hyperbolic, Slash, Sinh-normal and Sinh-t, which correspond to normal,
xi
a numeric value or numeric vector that represents the extra parameter of the specified distribution.

Value

  • xa vector of n observations.

Examples

Run this code
m1 <- "Standard Sinh-t distributions"
n <- 1000000
xi <- c(10,6,4)
plot(density(rvgs(n,"Sinh-t",xi=c(25,10))),xlim=c(-4.5,4.5),ylim=c(0,0.3),xlab="",
     ylab="",col=1,main="")
par(new=TRUE)
plot(density(rvgs(n,"Sinh-t",xi=c(25,6))),xlim=c(-4.5,4.5),ylim=c(0,0.3),xlab="",
     ylab="",col=2,main="")
par(new=TRUE)
plot(density(rvgs(n,"Sinh-t",xi=c(25,4))), xlim=c(-4.5,4.5), ylim=c(0,0.3), xlab="y",
     ylab="f(y)", main=m1, col=3)
legend(-4,0.3,bty="n",legend=paste("xi = (",25,",",xi,")"),col=1:4,lty=1)

Run the code above in your browser using DataLab