bp {spc4sts} | R Documentation |
Box-Pierce-Type Statistic
Description
Compute a Box-Pierce-type (BP) statistic for pixels in a given image. bp2()
cannot be used for pixels with the boundary problem, but is more efficient than bp()
for other pixels.
Usage
bp(img, i1, i2, w, K)
bp2(img, i1, i2, w , K)
Arguments
img |
the given image |
i1 |
the row index of the pixel to compute the BP statistic for. |
i2 |
the column index of the pixel to compute the BP statistic for. |
w |
the dimension of the spatial (square) moving window of the BP statistic. Must be an odd number >= 3. |
K |
the weighted (kernel) matrix. |
Value
The BP statistic.
Warning
For pixels with the boundary problem, bp()
must be used.
Note
bp()
is only used in sms()
for pixels with the boundary problem. It is less efficient than bp2()
for other pixels.
Author(s)
Anh Bui
References
Bui, A.T. and Apley., D.W. (2018a) "A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics, 60, 1-13.
See Also
Examples
img <- matrix(rnorm(100),10,10)
w <- 3
K <- kerMat((w + 1)/2)
## for pixels with the boundary problem, e.g., Pixel (5,1),
# running bp2(img,5,1,w,K) will produce an error; instead, use bp() in this case:
bp(img,5,1,w,K)
## for pixels without the boundary problem, e.g., Pixel (5,5),
# both can be used, but bp2() is more efficient than bp()
bp2(img,5,5,w,K)
bp(img,5,5,w,K)