Description Usage Arguments Details Value Author(s) References Examples
Calculates discontinuous smoother
1 |
y |
input vector |
gamma |
The |
Uses the potts filter algorithm described by Friedrich et al.
Vector with same length as input y
Sander Bollen
Friedrich, F., Kempe, a, Liebscher, V., & Winkler, G. (2008). Complexity Penalized M-Estimation. Journal of Computational and Graphical Statistics, 17(1), 201-224. doi:10.1198/106186008X285591
1 2 3 4 5 6 7 8 9 | #generate piecewise vector with gaussian noise
y <- 1:450
y[1:150] <- 2
y[151:300] <- 3
y[301:450] <- 1
y <- y + rnorm(450)
#calculate smoother
y_smooth <- discontSmooth(y,20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.