Description Usage Arguments Examples
Adjusting extreme values of series.
1 |
x |
numeric vector. |
limit |
threshold for recognizing extreme value. |
subs_method |
indicate method for substituting extreme values, |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ##
usad1 = USAccDeaths
usad1[2:5] = mean(USAccDeaths) * 3 # first obs will become a extreme since the trend has been changed by 2:5
(ext1 = extrmadj(usad1))
plot(ext1$extr_infr$x, type = "l") # original
lines(ext1$x.nextr, type = "l", col = "red") # substituted
##
usad2 = USAccDeaths
usad2[15] = - mean(USAccDeaths) * 3
(ext2 = extrmadj(usad2))
plot(ext2$extr_infr$x, type = "l") # original
lines(ext2$x.nextr, type = "l", col = "red") # substituted
## substituted by mean of nearest non-extrmadj
(ext3 = extrmadj(usad2, subs_method = "near"))
plot(ext3$extr_infr$x, type = "l") # original
lines(ext3$x.nextr, type = "l", col = "red") # substituted
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.