Title: | Smooth-Rough Partitioning of the Regression Coefficients |
---|---|
Description: | Performs the change-point detection in regression coefficients of linear model by partitioning the regression coefficients into two classes of smoothness. The change-point and the regression coefficients are jointly estimated. |
Authors: | Hyeyoung Maeng [aut, cre], Piotr Fryzlewicz [aut] |
Maintainer: | Hyeyoung Maeng <[email protected]> |
License: | GPL |
Version: | 1.2.0 |
Built: | 2024-12-11 07:11:46 UTC |
Source: | CRAN |
This function performs the natural cubic spline interpolation of a design matrix.
ncs(x)
ncs(x)
x |
The design matrix. |
Usually only called by srp.c
and srp.l
.
cf0 |
The coefficient matrix for B-splines obtained by natural cubic spline interpolation of |
Hyeyoung Maeng, [email protected]
x <- matrix(rnorm(100), ncol=10) ncs(x)$cf0
x <- matrix(rnorm(100), ncol=10) ncs(x)$cf0
This function performs the predictions from the results of Smooth-Rough Partition fitting.
## S3 method for class 'srp.c' predict(object, x, ...)
## S3 method for class 'srp.c' predict(object, x, ...)
object |
An object of class either 'srp.c', returned by |
x |
A new matrix you wish to fit Smooth-Rough Partition model. The dimension of row is the number of covariates. |
... |
Further parameters that can be passed to |
The Smooth-Rough Partition model is described in "Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
yhat |
The vector of predicted values. |
Hyeyoung Maeng, [email protected]
This function performs the predictions from the results of Smooth-Rough Partition fitting.
## S3 method for class 'srp.l' predict(object, x, ...)
## S3 method for class 'srp.l' predict(object, x, ...)
object |
An object of class 'srp.l', returned by |
x |
A new matrix you wish to fit Smooth-Rough Partition model. The dimension of row is the number of covariates. |
... |
Further parameters that can be passed to |
The Smooth-Rough Partition model is described in "Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
yhat |
The vector of predicted values. |
Hyeyoung Maeng, [email protected]
This function performs the optimisation of the number of unconstrained regression parameters in Smooth-Rough Partition model by minimising SIC criterion and gives the change-point of smoothness in regression parameters.
sic.c(x.basis = x.basis, B.basis = B.basis, x = x, y = y, cf0 = cf0, maxq = maxq, fixedq = F, L = L, inisp = inisp)
sic.c(x.basis = x.basis, B.basis = B.basis, x = x, y = y, cf0 = cf0, maxq = maxq, fixedq = F, L = L, inisp = inisp)
x.basis |
The b-spline basis defined for interpolated x in |
B.basis |
The b-spline basis defined for constrained regression coefficient. |
x |
The design matrix used in |
y |
The response variable used in |
cf0 |
The coefficient matrix obtained by natural cubic spline interpolation of x in |
maxq |
The maximum number of unconstrained parameters if |
fixedq |
If TRUE, |
L |
The dimension of b-spline expansion for constrained parameters used in |
inisp |
The initial value for the optimisation of tuning parameters in |
Usually only called by srp.c
.
The following components are obtained only when fixedq
is FALSE:
qhat |
The optimal number of unconstrained parameters. |
sicq |
The vector of Schwarz criterion with length |
The following components are obtained only when fixedq
is TRUE:
muhat |
The estimator of constant parameter. |
bhat |
The vector of evaluated constrained functional regression coefficient. |
ahat |
The vector of unconstrained regression coefficient estimators. |
etahat |
The vector containing both |
yhat |
The vector of estimated response variable. |
sp |
The vector of two tuning parameters estimated by minimising generalised cross validation (GCV). |
L |
The number of b-spline bases used for constrained regression parameters. |
Hyeyoung Maeng, [email protected]
library(fda) x <- matrix(rnorm(10000), ncol=100) y <- matrix(rnorm(100), ncol=1) p <- dim(x)[1] + 1 t <- seq(0, 1, length.out=dim(x)[1])*(dim(x)[1]) x.basis <- as.fd(splinefun(t, x[, 1], method="natural"))$basis B.basis <- create.bspline.basis(rangeval=c(0, dim(x)[1]), norder=4, nbasis=35) result <- sic.c(x.basis=x.basis, B.basis=B.basis, x=x, y=y, cf0=ncs(x)$cf0, maxq=10, L=35, inisp=1) plot(result$sicq, type="b")
library(fda) x <- matrix(rnorm(10000), ncol=100) y <- matrix(rnorm(100), ncol=1) p <- dim(x)[1] + 1 t <- seq(0, 1, length.out=dim(x)[1])*(dim(x)[1]) x.basis <- as.fd(splinefun(t, x[, 1], method="natural"))$basis B.basis <- create.bspline.basis(rangeval=c(0, dim(x)[1]), norder=4, nbasis=35) result <- sic.c(x.basis=x.basis, B.basis=B.basis, x=x, y=y, cf0=ncs(x)$cf0, maxq=10, L=35, inisp=1) plot(result$sicq, type="b")
This function performs the optimisation of the number of unconstrained regression parameters in (simpler) Smooth-Rough Partition model by minimising SIC criterion and gives the change-point in regression parameters.
sic.l(x.basis = x.basis, M.basis = M.basis, x = x, y = y, cf0 = cf0, maxq = maxq, fixedq = F)
sic.l(x.basis = x.basis, M.basis = M.basis, x = x, y = y, cf0 = cf0, maxq = maxq, fixedq = F)
x.basis |
The b-spline basis defined for interpolated x in |
M.basis |
The monomial basis defined for constrained regression coefficient. |
x |
The design matrix used in |
y |
The response variable used in |
cf0 |
The coefficient matrix obtained by natural cubic spline interpolation of x in |
maxq |
The maximum number of unconstrained parameters if |
fixedq |
If TRUE, |
Usually only called by srp.l
.
The following components are obtained only when fixedq
is FALSE:
qhat |
The optimal number of unconstrained parameters. |
sicq |
The vector of Schwarz criterion with length |
The following components are obtained only when fixedq
is TRUE:
muhat |
The estimator of constant parameter. |
bhat |
The vector of evaluated constrained functional regression coefficient. |
ahat |
The vector of unconstrained regression coefficient estimators. |
etahat |
The vector containing both |
yhat |
The vector of estimated response variable. |
Hyeyoung Maeng, [email protected]
library(fda) x <- matrix(rnorm(10000), ncol=100) y <- matrix(rnorm(100), ncol=1) p <- dim(x)[1] + 1 t <- seq(0, 1, length.out=dim(x)[1])*(dim(x)[1]) x.basis <- as.fd(splinefun(t, x[, 1], method="natural"))$basis M.basis <- create.monomial.basis(rangeval=c(0, dim(x)[1]), nbasis=2) result <- sic.l(x.basis=x.basis, M.basis=M.basis, x=x, y=y, cf0=ncs(x)$cf0, maxq=10) plot(result$sicq, type="b")
library(fda) x <- matrix(rnorm(10000), ncol=100) y <- matrix(rnorm(100), ncol=1) p <- dim(x)[1] + 1 t <- seq(0, 1, length.out=dim(x)[1])*(dim(x)[1]) x.basis <- as.fd(splinefun(t, x[, 1], method="natural"))$basis M.basis <- create.monomial.basis(rangeval=c(0, dim(x)[1]), nbasis=2) result <- sic.l(x.basis=x.basis, M.basis=M.basis, x=x, y=y, cf0=ncs(x)$cf0, maxq=10) plot(result$sicq, type="b")
The srp package performs the change-point detection in regression coefficients of a linear model by partitioning the regression coefficients into two classes of smoothness. To start with, see the function srp.c
.
Hyeyoung Maeng, [email protected]
"Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
This function performs the Smooth-Rough Partition linear regression with the input matrix.
srp.c(x, y, maxq = max(30, ceiling(0.1 * dim(x)[1])), L = 35, norder = 4, inisp = 1, plot = T)
srp.c(x, y, maxq = max(30, ceiling(0.1 * dim(x)[1])), L = 35, norder = 4, inisp = 1, plot = T)
x |
A matrix you wish to fit Smooth-Rough Partition model. The dimension of row is the number of variables which are pre-ordered in terms of their importance in prediction. |
y |
A vector you wish to use as a response variable in case of regressing |
maxq |
An integer specifying the maximum number of unconstrained parameters which the model can have. The default is max(30, ceiling(0.1*dim(x)[1])). |
L |
An integer specifying the dimension of b-spline expansion for the constrained (smoothed) parameters. The default is 35. |
norder |
An integer specifying the order of b-splines. The default of 4 performs cubic splines. |
inisp |
An initial value for optimising the tuning parameters and the default is 1. |
plot |
If true, it gives the plot of estimated regression coefficients. |
The estimation procedure of Smooth-Rough Partition model is described in "Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
muhat |
The estimator of constant parameter. |
bhat |
The vector of evaluated constrained functional regression coefficient. |
ahat |
The vector of unconstrained regression coefficient estimators. |
etahat |
The vector containing both |
yhat |
The vector of estimated response variable. |
SIC |
The vector of Schwarz criterion with length |
qhat |
The optimal number of unconstrained parameters selected in the model. |
sp |
The vector of two tuning parameters estimated by minimising generalised cross validation (GCV). |
L |
The number of bases used for constrained regression parameters. |
norder |
The order of b-splines specified. |
Hyeyoung Maeng, [email protected]
x <- matrix(rnorm(10000), ncol=100) srp.c(x)
x <- matrix(rnorm(10000), ncol=100) srp.c(x)
This function performs same as srp.c
except that constrained functional coefficient is estimated as a linear function.
srp.l(x, y, maxq = max(30, ceiling(0.1 * dim(x)[1])), plot = T)
srp.l(x, y, maxq = max(30, ceiling(0.1 * dim(x)[1])), plot = T)
x |
A matrix you wish to fit Smooth-Rough Partition model. The dimension of row is the number of variables which are pre-ordered in terms of their importance in prediction. |
y |
A vector you wish to use as a response variable in case of regressing |
maxq |
An integer specifying the maximum number of unconstrained parameters which the model can have. The default is max(30, ceiling(0.1*dim(x)[1])). |
plot |
If true, it gives the plot of estimated regression coefficients. |
The estimation procedure of Smooth-Rough Partition model is described in "Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
muhat |
The estimator of constant parameter. |
bhat |
The vector of evaluated constrained (linear) functional regression coefficient. |
ahat |
The vector of unconstrained regression coefficient estimators. |
etahat |
The vector containing both |
yhat |
The vector of estimated response variable. |
SIC |
The vector of Schwarz criterion with length |
qhat |
The optimal number of unconstrained parameters selected in the model. |
Hyeyoung Maeng, [email protected]
x <- matrix(rnorm(10000), ncol=100) srp.l(x)
x <- matrix(rnorm(10000), ncol=100) srp.l(x)
True regression coefficients used for simulations in "Regularised forecasting via smooth-rough partitioning of the regression coefficients", H. Maeng and P. Fryzlewicz (2018), preprint.
data(truebeta)
data(truebeta)
A matrix with 356 rows and 4 variables:
true regression coefficients for case 1
true regression coefficients for case 2
true regression coefficients for case 3
true regression coefficients for case 4