Title: | Local Polynomial Expectile Regression |
---|---|
Description: | Provides the local polynomial expectile regression method and different bandwidth selection procedures. The codes include local polynomial univariate expectile regression with several data-driven methods for bandwidth selection; local linear bivariate and trivariate expectile regression; and partially linear expectile regression, allowing for different errors structures (homoscedastic error and various heteroscedastic error structures). For more details, see Adam and Gijbels (2021a) <doi:10.1007/s10463-021-00799-y> and Adam and Gijbels (2021b) <doi:10.1007/978-3-030-73249-3_8>. |
Authors: | Cécile Adam [aut, cre] Irène Gijbels [aut] |
Maintainer: | Cécile Adam <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.1 |
Built: | 2024-11-02 03:57:55 UTC |
Source: | https://github.com/cran/locpolExpectile |
Formula interface for the local linear expectile estimation for a bivariate covariate case.
expectreg_loclin_bivariate( Z1, Z2, Y, omega, kernel = gaussK, h, grid = cbind(seq(min(Z1), max(Z1), length.out = length(Z1)), seq(min(Z2), max(Z2), length.out = length(Z2))) )
expectreg_loclin_bivariate( Z1, Z2, Y, omega, kernel = gaussK, h, grid = cbind(seq(min(Z1), max(Z1), length.out = length(Z1)), seq(min(Z2), max(Z2), length.out = length(Z2))) )
Z1 |
The first covariate data values. |
Z2 |
The second covariate data values. |
Y |
The response data values. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
kernel |
The kernel used to perform the estimation. In default setting,
|
h |
Smoothing parameter, bandwidth. |
grid |
Matrix of evaluation points. In default setting, a grid of
equispaced grid-values on the domain of the variables |
expectreg_loclin_bivariate
local linear expectile estimator
proposed and studied by Adam and Gijbels (2021b) for a bivariate covariate case.
expectreg_loclin_bivariate
returns a matrix whose components are
the estimation of the bivariate expectile surface, of order according to the grid matrix.
The rows are the grid on the first covariate data values (i.e.
Z1
)
and the columns the grid on the second covariate data values (i.e. Z2
).
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) expectreg_loclin_bivariate(Z1=Z_1,Z2=Z_2,Y=Y,omega=0.1 ,kernel=gaussK,h=0.1,grid=cbind(seq(min(Z_1),max(Z_1) ,length.out=10),seq(min(Z_2),max(Z_2),length.out=10)))
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) expectreg_loclin_bivariate(Z1=Z_1,Z2=Z_2,Y=Y,omega=0.1 ,kernel=gaussK,h=0.1,grid=cbind(seq(min(Z_1),max(Z_1) ,length.out=10),seq(min(Z_2),max(Z_2),length.out=10)))
Formula interface for the local linear expectile estimation for a trivariate covariate setting.
expectreg_loclin_trivariate(Z, X1, X2, Y, omega, h, kernel = gaussK)
expectreg_loclin_trivariate(Z, X1, X2, Y, omega, h, kernel = gaussK)
Z |
The first covariate data values. |
X1 |
The second covariate data values. |
X2 |
The third covariate data values. |
Y |
The response data values. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h |
Smoothing parameter, bandwidth. |
kernel |
The kernel used to perform the estimation. In default setting,
|
expectreg_loclin_trivariate
local linear expectile estimator
proposed and studied by Adam and Gijbels (2021b) for a trivariate covariate matrix.
expectreg_loclin_trivariate
returns a vector whose components are
the estimation of the nonparametric part according to the observed values
(i.e. ).
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
Formula interface for the local polynomial expectile estimation.
expectreg_locpol( X, Y, j = 0, p = 1, omega, h, kernel = gaussK, starting_value = c("mean", "median", "omega-quantile"), grid = seq(min(X), max(X), length.out = 100) )
expectreg_locpol( X, Y, j = 0, p = 1, omega, h, kernel = gaussK, starting_value = c("mean", "median", "omega-quantile"), grid = seq(min(X), max(X), length.out = 100) )
X |
The covariate data values. |
Y |
The response data values. |
j |
The order of derivative of the expectile to be estimated. In default setting, |
p |
The order of the local polynomial estimator. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h |
Smoothing parameter, bandwidth. |
kernel |
The kernel used to perform the estimation. In default setting,
|
starting_value |
Method for the starting point. Choice between the estimated (unconditional) mean, median and omega-quantile. |
grid |
Vector of evaluation points. In default setting, a grid of 100
equispaced grid-values on the domain of the variable |
expectreg_locpol
local polynomial expectile estimator
proposed and studied by Adam and Gijbels (2021a).
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times expectreg_locpol(X=x,Y=y,omega=0.3,h=0.4,kernel=gaussK,starting_value="mean" ,grid=seq(min(x),max(x),length.out=10))
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times expectreg_locpol(X=x,Y=y,omega=0.3,h=0.4,kernel=gaussK,starting_value="mean" ,grid=seq(min(x),max(x),length.out=10))
Ont-to-one mapping (see Proposition 1 in Adam and Gijbels (2021a))
findroot(X, Y, omega, alpha, p = 1)
findroot(X, Y, omega, alpha, p = 1)
X |
The covariate data values. |
Y |
The response data values. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
alpha |
Alpha value corresponding to the omega value given by the one-to-one mapping |
p |
The order of the local polynomial estimator. In default setting,
|
findroot
returns the one-to-one mapping
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
General Rule-of-Thumb bandwidth selector for univariate expectile regression
proposed by Adam and Gijbels (2021a) see Formula (24). The weight function
is chosen to be equal to the indicator function on
.
h_GenROT(X, Y, j = 0, p = 1, kernel = gaussK, omega) compDerEst_exp(X, Y, p, omega)
h_GenROT(X, Y, j = 0, p = 1, kernel = gaussK, omega) compDerEst_exp(X, Y, p, omega)
X |
The covariate data values. |
Y |
The response data values. |
j |
The order of derivative to estimate. In default setting, |
p |
The order of the local polynomial estimator. In default setting,
|
kernel |
The kernel used to perform the estimation. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h_GenROT
provides the general Rule-of-Thumb bandwidth selector
for the expectile regression proposed by Adam and Gijbels (2021a).
compDerEst_exp
returns a data frame whose
components are:
X
The covariate data values.
Y
The response data values.
fit
The fitted values for the parametric estimation
(leading to the Rule-of-Thumb expression).
der
The derivative estimation at values.
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.1) #h=1.887636
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.1) #h=1.887636
General Rule-of-Thumb bandwidth selector for the expectile regression
proposed by Adam and Gijbels (2021b) see Formula (26) for a bivariate covariate setting.
The weight functions are chosen to be equal to the indicator
functions on for
k=1,2
(i.e. for the two covariates) and j=0
and p=1
.
h_GenROT_bivariate(Z1, Z2, Y, omega, kernel = gaussK)
h_GenROT_bivariate(Z1, Z2, Y, omega, kernel = gaussK)
Z1 |
The first covariate data values. |
Z2 |
The second covariate data values. |
Y |
The response data values. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
kernel |
The kernel used to perform the estimation. In default setting,
|
h_GenROT_bivariate
provides the general Rule-of-Thumb bandwidth selector
for the expectile regression, in the bivariate covariate setting,
proposed by Adam and Gijbels (2021b).
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) h=h_GenROT_bivariate(Z1=Z_1,Z2=Z_2,Y=Y,kernel=gaussK,omega=0.1) #h=0.1241427
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) h=h_GenROT_bivariate(Z1=Z_1,Z2=Z_2,Y=Y,kernel=gaussK,omega=0.1) #h=0.1241427
Rule-of-Thumb bandwidth selector for the expectile regression
in a location-scale setting using the one-to-one mapping. The weight function is chosen
to be equal to the indicator function on .
h_GenROT_with(X, Y, j = 0, p = 1, kernel = gaussK, omega)
h_GenROT_with(X, Y, j = 0, p = 1, kernel = gaussK, omega)
X |
The covariate data values. |
Y |
The response data values. |
j |
The order of derivative to estimate. In default setting, |
p |
The order of the local polynomial estimator. In default setting,
|
kernel |
The kernel used to perform the estimation. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h_GenROT_with
provides the Rule-of-Thumb bandwidth
selector in a location-scale setting using the one-to-one mapping for
univariate expectile regression proposed by Adam and Gijbels (2021a).
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT_with(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.1) #h=1.886125
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT_with(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.1) #h=1.886125
Rule-of-Thumb bandwidth selector for the expectile regression
in a location scale without using the one-to-one mapping. The weight function
is chosen to be equal to the indicator function on .
h_GenROT_without(X, Y, j = 0, p = 1, kernel = gaussK, omega) compDerEstError_exp(X, Y, p, omega)
h_GenROT_without(X, Y, j = 0, p = 1, kernel = gaussK, omega) compDerEstError_exp(X, Y, p, omega)
X |
The covariate data values. |
Y |
The response data values. |
j |
The order of derivative to estimate. In default setting, |
p |
The order of the local polynomial estimator. In default setting,
|
kernel |
The kernel used to perform the estimation. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h_GenROT_without
provides
the Rule-of-Thumb bandwidth selector in a location-scale setting without
using the one-to-one mapping for univariate expectile regression
proposed by Adam and Gijbels (2021a).
compDerEstError_exp
returns a data frame whose components are:
X
The covariate data values.
Y
The response data values.
fit
The fitted values for the parametric estimation.
der
The derivative estimation at values.
err
The estimation of the error vector
err_fit
The th expectile of the residuals
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT_without(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.3) #h=1.937706
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_GenROT_without(X=x,Y=y,j=0,p=1,kernel=gaussK,omega=0.3) #h=1.937706
Quantile-based bandwidth selector for univariate expectile regression based on the plug-in bandwidth selector proposed by Fan and Gijbels (1996).
h_pluginBw(X, Y, p = 1, kernel = gaussK, omega)
h_pluginBw(X, Y, p = 1, kernel = gaussK, omega)
X |
The covariate data values. |
Y |
The response data values. |
p |
The order of the local polynomial estimator. In default setting,
|
kernel |
The kernel used to perform the estimation. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h_pluginBw
provides the quantile-based bandwidth
based on the plugin bandwidth selector for mean regression proposed by
Fan and Gijbels (1996) as discussed in Adam and Gijbels (2021a).
Fan, J. and Gijbels, I. (1996). Local Polynomial Modelling and Its Applications. Number 66 in Monographs on statistics and applied probability series. Chapman and Hall, London.
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_pluginBw(X=x,Y=y,p=1,kernel=gaussK,omega=0.1) #h=0.8602156
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_pluginBw(X=x,Y=y,p=1,kernel=gaussK,omega=0.1) #h=0.8602156
Quantile-based bandwidth selector for univariate expectile regression based on the Rule-of-Thumb for mean regression proposed by Fan and Gijbels (1996).
h_thumbBw(X, Y, p = 1, kernel = gaussK, omega)
h_thumbBw(X, Y, p = 1, kernel = gaussK, omega)
X |
The covariate data values. |
Y |
The response data values. |
p |
The order of the local polynomial estimator. In default setting,
|
kernel |
The kernel used to perform the estimation. In default setting,
|
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
h_thumbBw
provides the quantile-based bandwidth
based on the Rule-of-Thumb for mean regression proposed by Fan and Gijbels
(1996) as discussed in Adam and Gijbels (2021a).
Fan, J. and Gijbels, I. (1996). Local Polynomial Modelling and Its Applications. Number 66 in Monographs on statistics and applied probability series. Chapman and Hall, London.
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_thumbBw(X=x,Y=y,p=1,kernel=gaussK,omega=0.1) #h=1.824103
library(locpol) data(mcycle) y=mcycle$accel x=mcycle$times h=h_thumbBw(X=x,Y=y,p=1,kernel=gaussK,omega=0.1) #h=1.824103
A detailed description of these data is available in Schmidt et al. (1981) and in Silverman (1985). The dataset is available in the MASS package. This dataset is also used in Adam and Gijbels (2021a). A data frame giving a series of measurements of head acceleration in a simulated motorcycle accident, used to test crash helmets.
mcycle
mcycle
A data frame with 142 rows and 2 variables:
in milliseconds after impact.
in g.
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
Schmidt, G., Mattern, R., and Schuler, F. (1981). Biomechanical investigation to determine physical and traumatological differentiation criteria for the maximum load capacity of head and vertebral column with and without protective helmet under the effects of impact. EEC Research Program on Biomechanics of Impacts. Final report Phase III, Project G5, Institut fur Rechtsmedizin, Universitat Heidelberg.
Silverman, B. W. (1985). Some aspects of the spline smoothing approach to non-parametric curve fitting. Journal of the Royal Statistical Society Series B, 47, 1–52.
data(mcycle) y=mcycle$accel x=mcycle$times plot(x,y)
data(mcycle) y=mcycle$accel x=mcycle$times plot(x,y)
Formula interface for the partially linear expectile regression
using local linear expectile estimation for different heteroscedastic error structure and
a univariate variable in the nonparametric function . The model is of the form
,
or
.
See Table 1 in Adam and Gijbels (2021b) for more details.
ParLin_expectreg_hetero( X, Y, Z, omega = 0.3, kernel = gaussK, heteroscedastic = c("X", "Z", "Z and X") )
ParLin_expectreg_hetero( X, Y, Z, omega = 0.3, kernel = gaussK, heteroscedastic = c("X", "Z", "Z and X") )
X |
The covariates data values for the linear part
(of size |
Y |
The response data values. |
Z |
The covariate data values for the nonparametric part. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
kernel |
The kernel used to perform the estimation. In default setting,
|
heteroscedastic |
Heteroscedastic error depending on |
ParLin_expectreg_hetero
partially linear expectile estimators
for different heteroscedastic error structures and a univariare variable in the nonparametric part,
proposed and studied by Adam and Gijbels (2021b). ParLin_expectreg_hetero
returns a list whose components are:
If the heteroscedastic error depends on :
Linear
The delta estimators for the linear part
Nonlinear
The estimation of the nonparametric part
according to the observed values .
If the heteroscedastic error depends on :
Linear
The delta estimators for the linear part
Nonlinear_g
The estimation of the nonparametric part
according to the observed values .
Nonlinear_g_omega
The estimation of
the nonparametric part according to the observed values (if
is univariate)
or to the couple of observed values
.
If the heteroscedastic error depends on and
:
Linear
The delta estimators for the linear part
Nonlinear_g
The estimation of the nonparametric part
according to the couple of the observed values (if
is univariate)
or to the observed values
.
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
library(locpol) set.seed(123) Z<-runif(100,-3,3) eta_1<-rnorm(100,0,1) X1<-(0.9*Z)+(1.5*eta_1) set.seed(1234) eta_2<-rnorm(100,0,2) X2<-(0.9*Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(12345) epsilon<-rnorm(100,0,1) delta<-rbind(0.8,-0.8) Y<-as.numeric((t(delta)%*%X)+(10*sin(0.9*Z))+(0.6*X1^2)*epsilon) ParLin_expectreg_hetero(X=t(X),Y=Y,Z=Z,omega=0.3,kernel=gaussK,heteroscedastic="X")
library(locpol) set.seed(123) Z<-runif(100,-3,3) eta_1<-rnorm(100,0,1) X1<-(0.9*Z)+(1.5*eta_1) set.seed(1234) eta_2<-rnorm(100,0,2) X2<-(0.9*Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(12345) epsilon<-rnorm(100,0,1) delta<-rbind(0.8,-0.8) Y<-as.numeric((t(delta)%*%X)+(10*sin(0.9*Z))+(0.6*X1^2)*epsilon) ParLin_expectreg_hetero(X=t(X),Y=Y,Z=Z,omega=0.3,kernel=gaussK,heteroscedastic="X")
Formula interface for the partially linear expectile regression using local linear expectile estimation for a homoscedastic error and a bivariate variable in the nonparametric function. For the nonparametric part, the general Rule-of-Thumb bandwidth selector proposed in Adam and Gijbels (2021b) is used. See Adam and Gijbels (2021b) for more details.
ParLin_expectreg_homo_biv( X, Y, Z, omega = 0.3, kernel = gaussK, grid = cbind(seq(min(Z[, 1]), max(Z[, 1]), length.out = 10), seq(min(Z[, 2]), max(Z[, 2]), length.out = 10)) )
ParLin_expectreg_homo_biv( X, Y, Z, omega = 0.3, kernel = gaussK, grid = cbind(seq(min(Z[, 1]), max(Z[, 1]), length.out = 10), seq(min(Z[, 2]), max(Z[, 2]), length.out = 10)) )
X |
The covariates data values for the linear part (of size |
Y |
The response data values. |
Z |
The covariates data values for the nonparametric part (of size |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
kernel |
The kernel used to perform the estimation. In default setting,
|
grid |
Matrix of evaluation points used for the nonparametric part. In default setting, a grid of 10
equispaced grid-values in each direction on the domain of the variable |
ParLin_expectreg_homo_biv
partially linear expectile estimators
assuming a homoscedastic error and a bivariate covariate in the nonparametric part,
proposed and studied by Adam and Gijbels (2021b). ParLin_expectreg_homo_biv
returns a list whose components are:
Linear
The delta estimators for the linear part
Nonlinear
The estimation of the nonparametric part
according to the grid. The rows of the estimation matrix
are the grid on the first covariate data values (i.e. Z[,1]
)
and the columns the grid on the second covariate data values (i.e. Z[,2]
).
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) ParLin_expectreg_homo_biv(X=t(X),Y=Y,Z=t(Z),omega=0.1,kernel=gaussK ,grid=cbind(seq(min(Z[,1]),max(Z[,1]),length.out=10),seq(min(Z[,2]),max(Z[,2]),length.out=10)))
library(locpol) library(lestat) set.seed(6) dist <- muniformdistribution(rep(0, 2), rep(1, 2)) values<-simulate(dist,200) Z_1<-values[,1] Z_2<-values[,2] Z<-rbind(Z_1,Z_2) gamma=cbind(3,-0.4) set.seed(7) eta_1<-rnorm(100,0,1) X1=(gamma%*%Z)+(1.5*eta_1) set.seed(8) eta_2<-rnorm(100,0,2) X2=(gamma%*%Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(9) epsilon<-rt(100,3) delta_true<-rbind(0,-0.8) Y=as.numeric((t(delta_true)%*%X)+(0.2*exp(1.5*(gamma%*%Z)))+epsilon) ParLin_expectreg_homo_biv(X=t(X),Y=Y,Z=t(Z),omega=0.1,kernel=gaussK ,grid=cbind(seq(min(Z[,1]),max(Z[,1]),length.out=10),seq(min(Z[,2]),max(Z[,2]),length.out=10)))
Formula interface for the partially linear expectile regression using local linear expectile estimation assuming a homoscedastic error and a univariate variable in the nonparametric function. For the nonparametric part, the general Rule-of-Thumb bandwidth selector proposed in Adam and Gijbels (2021a) is used. See Adam and Gijbels (2021b) for more details.
ParLin_expectreg_homo_uni( X, Y, Z, omega = 0.3, kernel = gaussK, grid = seq(min(Z), max(Z), length.out = 100) )
ParLin_expectreg_homo_uni( X, Y, Z, omega = 0.3, kernel = gaussK, grid = seq(min(Z), max(Z), length.out = 100) )
X |
The covariates data values for the linear part (of size |
Y |
The response data values. |
Z |
The covariate data values for the nonparametric part. |
omega |
Numeric vector of level between 0 and 1 where 0.5 corresponds to the mean. |
kernel |
The kernel used to perform the estimation. In default setting,
|
grid |
Vector of evaluation points used for the nonparametric part. In default setting, a grid of 100
equispaced grid-values on the domain of the variable |
ParLin_expectreg_homo_uni
partially linear expectile estimators
for a homoscedastic error and a univariare variable in the nonparametric part
proposed and studied by Adam and Gijbels (2021b). ParLin_expectreg_homo_uni
returns a list whose components are:
Linear
The delta estimators for the linear part
Nonlinear
The estimation of the nonparametric part
according to the grid.
Adam, C. and Gijbels, I. (2021a). Local polynomial expectile regression. Annals of the Institute of Statistical Mathematics doi:10.1007/s10463-021-00799-y.
Adam, C. and Gijbels, I. (2021b). Partially linear expectile regression using local polynomial fitting. In Advances in Contemporary Statistics and Econometrics: Festschrift in Honor of Christine Thomas-Agnan, Chapter 8, pages 139–160. Springer, New York.
library(locpol) set.seed(123) Z<-runif(100,-3,3) eta_1<-rnorm(100,0,1) X1<-(0.9*Z)+(1.5*eta_1) set.seed(1234) eta_2<-rnorm(100,0,2) X2<-(0.9*Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(12345) epsilon<-rnorm(100,0,1) delta<-rbind(0.8,-0.8) Y<-as.numeric((t(delta)%*%X)+(10*sin(0.9*Z))+5*epsilon) ParLin_expectreg_homo_uni(X=t(X),Y=Y,Z=Z,omega=0.3 ,kernel=gaussK,grid=seq(min(Z),max(Z),length.out=10))
library(locpol) set.seed(123) Z<-runif(100,-3,3) eta_1<-rnorm(100,0,1) X1<-(0.9*Z)+(1.5*eta_1) set.seed(1234) eta_2<-rnorm(100,0,2) X2<-(0.9*Z)+(1.5*eta_2) X<-rbind(X1,X2) set.seed(12345) epsilon<-rnorm(100,0,1) delta<-rbind(0.8,-0.8) Y<-as.numeric((t(delta)%*%X)+(10*sin(0.9*Z))+5*epsilon) ParLin_expectreg_homo_uni(X=t(X),Y=Y,Z=Z,omega=0.3 ,kernel=gaussK,grid=seq(min(Z),max(Z),length.out=10))