countpeaks | R Documentation |
This function computes the number of peaks in a double vector, with
peak defined as per \insertCiteGoldfeld65;textualskedastic. The function
is used in the Goldfeld-Quandt nonparametric test for heteroskedasticity in
a linear model. NA
and NaN
values in the sequence are ignored.
countpeaks(x)
x |
A double vector. |
An integer value between 0
and length(x) - 1
representing the number of peaks in the sequence.
goldfeld_quandt
set.seed(9586)
countpeaks(stats::rnorm(20))
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
countpeaks(mtcars_lm$residuals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.