np.gof(data = data, m0 = NULL, h.seq = NULL, w = NULL,
estimator = "NW", kernel = "quadratic", time.series = FALSE,
Tau.eps = 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]
contains the values of the explanatory variable, $t$.NULL
(the default), the zero function is considered.h.seq
. If NULL
(the default), 10 equidistant values between zero and a quarter of the range of ${t_i}$ are considered.NULL
(the default), $(q_{0.1}, q_{0.9})$ is considered, where $q_p$ denotes the quantile of order $p$ of ${t_i}$.Tau.eps=NULL
, h0
contains the pilot bandwidth used for obtaining the residuals to construct the default for Tau.eps
. If NULL
(the default), a quarter of the range of ${t_i}$ is considered.Tau.eps=NULL
, lag.max
contains the maximum delay used to construct the default for Tau.eps
. The default is 50.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<=
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<=
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).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.Tau.eps=NULL
, alpha
contains the significance level which the ARMA model is checked. The default is 0.05.h.seq
).h.seq
).data
is a time series and Tau.eps
is not especified: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 Muller and Stadmuller (1988) and Herrmann et al. (1992) can be followed.
The implemented statistic test particularizes that one in Gonzalez Manteiga and Vilar Fernandez (1995) to the case where the considered class in the null hypothesis has only one element.np.est
, par.gof
and plrm.gof
.# EXAMPLE 1: REAL DATA
data <- matrix(10,120,2)
data(barnacles1)
barnacles1 <- as.matrix(barnacles1)
data[,1] <- barnacles1[,1]
data <- diff(data, 12)
data[,2] <- 1:nrow(data)
np.gof(data)
# EXAMPLE 2: SIMULATED DATA
## Example 2a: dependent data
set.seed(1234)
# We generate the data
n <- 100
t <- ((1:n)-0.5)/n
m <- function(t) {0.25*t*(1-t)}
f <- m(t)
f.function <- function(u) {0.25*u*(1-u)}
epsilon <- arima.sim(list(order = c(1,0,0), ar=0.7), sd = 0.01, n = n)
y <- f + epsilon
data <- cbind(y,t)
## Example 2a.1: true null hypothesis
np.gof(data, m0=f.function, time.series=TRUE)
## Example 2a.2: false null hypothesis
np.gof(data, time.series=TRUE)
Run the code above in your browser using DataLab