plrm.gof(data = data, beta0 = NULL, m0 = NULL, b.seq = NULL,
h.seq = NULL, w = NULL, estimator = "NW", kernel = "quadratic",
time.series = FALSE, Var.Cov.eps = NULL, Tau.eps = NULL,
b0 = NULL, h0 = NULL, lag.max = 50, p.max = 3, q.max = 3,
ic = "BIC", num.lb = 10, alpha = 0.05)
data[,1]
contains the values of the response variable, $Y$;
data[, 2:(p+1)]
contains the values of the "linear" explanatory variables
$X_1, ... X_p$;
data[, p+2]
contains the values of the "nonparametric" exNULL
(the default), the zero vector is considered.NULL
(the default), the zero function is considered.b.seq
. If NULL
(the default) but h.seq
is not NULL
, it takes b.seq=h.seq
. If both b.seq
b.seq[j], h.seq[j]
). If NULL
(the default) but b.seq
is not NULL
, it takes h.seq=b.seq
. If both b.seq
NULL
(the default), $(q_{0.1}, q_{0.9})$ is considered, where $q_p$ denotes the quantile of order $p$ of ${t_i}$.n x n
matrix of variances-covariances associated to the random errors of the regression model. If NULL (the default), the function tries to estimate it: it fits an ARMA model (selected according to an information criterium) to the residuals fVar.Cov.eps=NULL
and/or Tau.eps=NULL
, b0
contains the pilot bandwidth for the estimator of $\beta$ used for obtaining the residuals to construct the default for Var.Cov.eps
and/or Tau.eps
Var.Cov.eps=NULL
and/or Tau.eps=NULL
, (b0, h0
) contains the pair of pilot bandwidths for the estimator of $m$ used for obtaining the residuals to construct the default for Var.Cov.eps
and/or Ta
Tau.eps=NULL
, lag.max
contains the maximum delay used to construct the default for Tau.eps
. The default is 50.Var.Cov.eps=NULL
and/or Tau.eps=NULL
, the ARMA model is selected between the models ARMA(p,q) with 0<=p<=p.max and 0<=q<=q.max. The default is 3.=q<==p<=
Var.Cov.eps=NULL
and/or Tau.eps=NULL
, the ARMA model is selected between the models ARMA(p,q) with 0<=p<=p.max and 0<=q<=q.max. The default is 3.=q<==p<=
Var.Cov.eps=NULL
and/or Tau.eps=NULL
, ic
contains the information criterion used to suggest the ARMA model. It allows us to choose between: "AIC", "AICC" or "BIC" (the default).Var.Cov.eps=NULL
and/or Tau.eps=NULL
, it checks the suitability of the selected ARMA model according to the Ljung-Box test and the t-test. It uses up to num.lb
delays in the Ljung-Box test. The default is 10.Var.Cov.eps=NULL
and/or Tau.eps=NULL
, alpha
contains the significance level which the ARMA model is checked. The default is 0.05.data
is a time series and Tau.eps
or Var.Cov.eps
are not especified:Var.Cov.eps=NULL
and the routine is not able to suggest an approximation for Var.Cov.eps
, it warns the user with a message saying that the model could be not appropriate and then it shows the results. In order to construct Var.Cov.eps
, the procedure suggested in Aneiros-Perez and Vieu (2013) can be followed.
If Tau.eps=NULL
and the routine is not able to suggest an approximation for Tau.eps
, it warns the user with a message saying that the model could be not appropriate and then it shows the results. In order to construct Tau.eps
, the procedures suggested in Aneiros-Perez (2008) can be followed.
The implemented procedures generalize those ones in expressions (9) and (10) in Gonzalez-Manteiga and Aneiros-Perez (2003) by allowing some dependence condition in ${(X_{i1}, ..., X_{ip}): i=1,...,n}$ and including a weight function (see above), respectively.plrm.est
, par.gof
and np.gof
.# EXAMPLE 1: REAL DATA
data(barnacles1)
data <- as.matrix(barnacles1)
data <- diff(data, 12)
data <- cbind(data,1:nrow(data))
plrm.gof(data)
plrm.gof(data, beta0=c(-0.1, 0.35))
# EXAMPLE 2: SIMULATED DATA
## Example 2a: dependent data
set.seed(1234)
# We generate the data
n <- 100
t <- ((1:n)-0.5)/n
beta <- c(0.05, 0.01)
m <- function(t) {0.25*t*(1-t)}
f <- m(t)
f.function <- function(u) {0.25*u*(1-u)}
x <- matrix(rnorm(200,0,1), nrow=n)
sum <- x%*%beta
epsilon <- arima.sim(list(order = c(1,0,0), ar=0.7), sd = 0.01, n = n)
y <- sum + f + epsilon
data <- cbind(y,x,t)
## Example 2a.1: true null hypotheses
plrm.gof(data, beta0=c(0.05, 0.01), m0=f.function, time.series=TRUE)
## Example 2a.2: false null hypotheses
plrm.gof(data, time.series=TRUE)
Run the code above in your browser using DataLab