ppeak | R Documentation |
This function computes \sum_{k} P(n,k)
, i.e. the probability that a
sequence of n
independent and identically distributed random variables
contains \ge k
(\le k)
peaks, with peaks as defined in
\insertCiteGoldfeld65;textualskedastic. The function may be used to
compute p
-values for the Goldfeld-Quandt nonparametric test for
heteroskedasticity in a linear model. Computation time is very slow for
n > 170
if usedata
is set to FALSE
.
ppeak(k, n, lower.tail = FALSE, usedata = TRUE)
k |
An integer or a sequence of integers strictly incrementing by 1,
with all values between 0 and |
n |
A positive integer representing the number of observations in the sequence. |
lower.tail |
A logical. Should lower tailed cumulative probability be
calculated? Defaults to |
usedata |
A logical. Should probability mass function values be
read from |
A double between 0 and 1 representing the probability of at least
(at most) k peaks occurring in a sequence of n
independent and
identically distributed continuous random variables. The double has a
names
attribute with the values corresponding to the
probabilities.
dpeak
, goldfeld_quandt
# For an independent sample of size 250, the probability of at least 10
# peaks is 0.02650008
ppeak(k = 10, n = 250, lower.tail = FALSE, usedata = TRUE)
# For an independent sample of size 10, the probability of at most 2 peaks
# is 0.7060615
ppeak(k = 2, n = 10, lower.tail = TRUE, usedata = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.