SMR {SMR} | R Documentation |
The externally studentized normal midrange distribution
Description
Computes the probability density, the cumulative distribution function and the quantile function and generates random samples for the externally studentized normal midrange distribution with the numbers means equal to size
, the degrees of freedom equal to df
and the number of
points of the Gauss-Legendre quadrature equal to np
.
Usage
dSMR(x, size, df, np=32, log = FALSE)
pSMR(q, size, df, np=32, lower.tail = TRUE, log.p = FALSE)
qSMR(p, size, df, np=32, eps = 1e-13, maxit = 5000, lower.tail = TRUE, log.p = FALSE)
rSMR(n, size, df = Inf)
Arguments
x , q |
vector of quantiles |
p |
vector of probabilities |
size |
sample size. Only for |
n |
vector size to be simulated |
df |
degrees of freedom |
np |
number of points of the gaussian quadrature |
log , log.p |
logical argument; if |
lower.tail |
logical argument; if |
eps |
stopping criterion for Newton-Raphson's iteraction method. |
maxit |
maximum number of interaction in the Newton-Raphson method. |
Details
Assumes np = 32 as default value for dSMR, pSMR and qSMR. If df
is not specified, it assumes the default value Inf
in rSMR
. When df=1
, the convergence of the routines requires np>250
to obtain the desired result accurately.
The Midrange distribution has density
where, is the quantile of externally studentized midrange distribution,
(
size
) is the sample size and is the degrees of freedon.
The externally studentized midrange distribution function is given by
where, is the quantile of externally studentized midrange distribution,
(
size
) is the sample size and is the degrees of freedon.
Value
dSMR
gives the density, pSMR
gives the cumulative distribution function, qSMR
gives the quantile function, and rSMR
generates random deviates.
References
BATISTA, B. D. de O.; FERREIRA, D. F. SMR: An R package for computing the externally studentized normal midrange distribution. The R Journal, v. 6, n. 2, p. 123-136, dez. 2014.
Examples
library(SMR)
#example 1:
x <- 2
q <- 1
p <- 0.9
n <- 30
size <- 5
df <- 3
np <- 32
dSMR(x, size, df, np)
pSMR(q, size, df, np)
qSMR(p, size, df, np)
rSMR(n, size, df)
#example 2:
x <- c(-1, 2, 1.1)
q <- c(1, 0, -1.5)
p <- c(0.9, 1, 0.8)
n <- 10
size <- 5
df <- 3
np <- 32
dSMR(x, size, df, np)
pSMR(q, size, df, np)
qSMR(p, size, df, np)
rSMR(n, size, df)