View source: R/changepoint.sim1D.R
changepoint.sim1D | R Documentation |
This function simulates one-dimension change-point data for three data types, and one smooth data type for testing change-point regression estimators.
changepoint.sim1D(n,sigma=1,data.type = "continuousWithJump")
n |
Integer value for sample size. |
sigma |
Numeric value of standard deviation. |
data.type |
Character value for different data types. The options for
change-point data are: constant functions seperated by two jumps
( |
This function produces a data.frame, consisting of the simulated data and the data generating process.
X |
Numeric vector of explanatory data |
Y |
Numeric vector of response data |
oracle |
Numeric vector of the data generating process for |
Thompson, J.R.J. (2024) “Iterative Smoothing for Change-point Regression Function Estimation”, Journal of Applied Statistics, 1-25. <doi:10.1080/02664763.2024.2352759>
## 1D continuous data of nonlinear functions with a jump change-point
changepoint.data <- changepoint.sim1D(100)
plot(changepoint.data$X,changepoint.data$Y,xlab = "X",ylab = "Y",pch=1,col="grey",las=1)
lines(changepoint.data$X,changepoint.data$oracle,col="red",lty=1)
## 1D continuous data of constant functions with two jump change-points
changepoint.data <- changepoint.sim1D(100,data.type="uniformJump")
plot(changepoint.data$X,changepoint.data$Y,xlab = "X",ylab = "Y",pch=1,col="grey",las=1)
lines(changepoint.data$X,changepoint.data$oracle,col="red",lty=1)
## 1D continuous data of linear functions with two derivative change-points
changepoint.data <- changepoint.sim1D(100,data.type="gradualJump")
plot(changepoint.data$X,changepoint.data$Y,xlab = "X",ylab = "Y",pch=1,col="grey",las=1)
lines(changepoint.data$X,changepoint.data$oracle,col="red",lty=1)
## 1D continuous data of a nonlinear continuous function
changepoint.data <- changepoint.sim1D(100,data.type="continuous")
plot(changepoint.data$X,changepoint.data$Y,xlab = "X",ylab = "Y",pch=1,col="grey",las=1)
lines(changepoint.data$X,changepoint.data$oracle,col="red",lty=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.