View source: R/univariate_polynomial.R
gen.piece.poly | R Documentation |
Generate univariate data from piecewise polynomials (currently, only the linear, quadratic functions and cubic functions are considered).
gen.piece.poly(init_coef_vec, cpt_vec, kappa_mat, n, sigma)
init_coef_vec |
A (r+1)-dim |
cpt_vec |
A K-dim |
kappa_mat |
A (r+1)xK |
n |
An |
sigma |
A |
A vector of data generated from piecewise polynomials.
Haotian Xu
Yu and Chatterjee (2020) <arXiv:2007.09910>.
r = 2 init_coef_vec = c(-2, 2, 9) cpt_true = c(100, 200) n = 300 sigma = 1 kappa_mat = cbind(c(3, 9, -27), c(-3, 9, -27)) plot.ts(gen.piece.poly(init_coef_vec, cpt_true, kappa_mat, n, sigma), ylab = "y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.