Learn R Programming

gmatrix (version 0.3)

normal: GPU Normal Distribution

Description

Density, distribution function, quantile function and random generation for the normal distribution with mean equal to mean and standard deviation equal to sd. All functions performed on the GPU.

Usage

gdnorm(x, mean = 0, sd = 1, log = FALSE, type = "d") grnorm(n, mean = 0, sd = 1, type = "d") gqnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE, warn = TRUE, type = "d") gpnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE, warn = TRUE, type = "d")

Arguments

x,q
vector of quantiles
p
vector of probabilities
n
number of observations
mean
vector of means
sd
vector of standard deviations
log, log.p
logical; if TRUE, probabilities p are given as log(p)
lower.tail
logical; if TRUE (default), probabilities are P[X < x] otherwise, P[X > x].
warn
logical; if FALSE then additional warnings are disabled.
type
specify the type; may be "double", "single" (or short form "d" or "s")

Value

gdnorm gives the density, gpnorm gives the distribution function, gqnorm gives the quantile function, and grnorm generates random deviates.

Details

Very similar to the R stats functionality. However, gqnorm and gpnorm are implement currently in a way that is NOT numerically precise in the deep tails. Future releases may fix this problem.

See Also

dnorm

Examples

Run this code
myRndNums1 = grnorm(100) #standard normals
myRndNums2 = grnorm(100, mean=c(1,2), sd=c(1,2,4,6))

Run the code above in your browser using DataLab