qqnormGpu {clrng} | R Documentation |
qqnormGpu
Description
Calculate quantiles on a GPU and produce a Q-Q plot in R.
Usage
qqnormGpu(
y,
ylim,
mu = 0,
sigma = 1,
lower.tail = 1,
main = "Normal Q-Q Plot",
xlab = "Theoretical Quantiles",
ylab = "Sample Quantiles",
Nglobal = getOption("clrng.Nglobal"),
Nlocal = c(2, 2),
type = getOption("clrng.type"),
verbose = FALSE,
...
)
Arguments
y |
data sample. |
ylim |
limits on the plot region. |
mu |
mean of Normal distribution, default is 0. |
sigma |
variance of Normal distribution, default is 1. |
lower.tail |
a logical value specifying whether use lower tail probability, default is TRUE. |
main |
plot label. |
xlab |
plot label. |
ylab |
plot label. |
Nglobal |
a (non-empty) integer vector specifying size of work items for use, with default value from global option 'clrng.Nglobal'. |
Nlocal |
a (non-empty) integer vector specifying size of local group size of the index space, default is c(2,2). |
type |
a character string specifying "double" or "float" of random numbers, with default value from global option 'clrng.type'. |
verbose |
a logical value, if TRUE, print extra information, default is FALSE. |
... |
other graphical parameters. |
Value
a Normal Q-Q plot.
Examples
library(clrng)
if (detectGPUs() >= 1) {
setContext(grep("gpu", listContexts()$device_type)[1])
y <- stats::rt(256, df = 5) # generates 256 random numbers from a Student's t-distribution
clrng::qqnormGpu(y, ylim=c(-4,5), mu=0, sigma=1, Nglobal=c(16,4))
x<-stats::rnorm(256)
clrng::qqnormGpu(x, Nglobal=c(8,6)) } else {
message("No GPU context available")
}