Description Usage Arguments Details Value Author(s) References Examples
Generate data for simulations.
1 2 3 | SimuBlocks(n, sigma = 0.1, seed = NA)
SimuWave(n, sigma = 0.1, seed = NA)
SimuDoppler(n, sigma = 0.1, seed = NA)
|
n |
The number of observations. |
sigma |
A positive value to specify the standard deviation of the Gaussian noise. |
seed |
a single value to specify the seed used for generating data. See |
Let x = i/n, i=1,…,n. Assume that y_x follows an underlying trend y0_x with additive noise ε_x, i.e.,
y_x = y0_x + ε_x,
where y0_x is a smooth curve representing relatively long-term movements and ε_x is often assumed to follow i.i.d. N(0, σ^2).
A list with the following components:
y |
The simulated data of length n. |
x |
The locations of |
y0 |
The true signal of length n. |
tau |
Locations of the true knots. |
SetA |
Indexs of the true knots. |
Canhong Wen, Xueqin Wang, Shijie Quan, Zelin Hong and Aijun Zhang.
Maintainer: Canhong Wen <wench@ustc.edu.cn>
Wen, C., Zhu, J., Wang, X., and Zhang, A. (2019) L0 trend filtering, technique report.
1 2 3 4 5 6 7 | ##------ Piecewise constant trend filtering example in Wen et al.(2018).-----
set.seed(1)
data <- SimuBlocks(2048)
fit <- samias(data$y, kmax = 15) # With default input argument
plot(fit, type="coef", main = "Blocks") # Plot the optimal estimate
lines(data$x, data$y0, type="s") # Add the true signal for reference
plot(fit, type= "vpath", main = "Blocks") # Plot the solution path
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.