efpFunctional          package:strucchange          R Documentation

_F_u_n_c_t_i_o_n_a_l_s _f_o_r _F_l_u_c_t_u_a_t_i_o_n _P_r_o_c_e_s_s_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes an object for aggregating, plotting and testing empirical
     fluctuation processes.

_U_s_a_g_e:

     efpFunctional(functional = list(comp = function(x) max(abs(x)), time = max),
       boundary = function(x) rep(1, length(x)),
       computePval = NULL, computeCritval = NULL,
       plotProcess = NULL, lim.process = "Brownian bridge",
       nobs = 10000, nrep = 50000, nproc = 1:20, h = 0.5,
       probs = c(0:84/100, 850:1000/1000))

_A_r_g_u_m_e_n_t_s:

functional: either a function for aggregating fluctuation processes or
          a list with two functions names '"comp"' and '"time"'.

boundary: a boundary function.

computePval: a function for computing p values. If neither
          'computePval' nor 'computeCritval' are specified critical
          values are simulated with settings as specified below.

computeCritval: a function for computing critical values. If neither
          'computePval' nor 'computeCritval' are specified critical
          values are simulated with settings as specified below.

plotProcess: a function for plotting the empirical process, if set to
          'NULL' a suitable function is set up.

lim.process: a string specifying the limiting process.

    nobs: integer specifying the number of observations of each
          Brownian motion simulated.

    nrep: integer specifying the number of replications.

   nproc: integer specifying for which number of processes Brownian
          motions should be simulated. If set to 'NULL' only 'nproc =
          1' is used and all other values are derived from a Bonferroni
          correction.

       h: bandwidth parameter for increment processes.

   probs: numeric vector specifying for which probabilities  critical
          values should be tabulated.

_D_e_t_a_i_l_s:

     'efpFunctional' computes an object of class '"efpFunctional"'
     which should know how to do inference based on empirical
     fluctuation processes (currently only for 'gefp' objects and not
     yet for 'efp' objects) and how to visualize the corresponding
     processes. In particular, it has slots for the functions
     'computeStatistic', 'computePval' and 'plotProcess'. These should
     have the following interfaces: {\itemize

_c_o_m_p_u_t_e_S_t_a_t_i_s_t_i_c should take a single argument which is the process
     itself, i.e., essentially a n x k matrix where n is the number of
     observations and k the number of processes (regressors).

_c_o_m_p_u_t_e_P_v_a_l should take two arguments: a scalar test statistic and the
     number of processes k

_p_l_o_t_P_r_o_c_e_s_s should take two arguments: an object of class '"gefp"' and
     'alpha' the level of significance for any boundaries or critical
     values to be visualized.}

     'efpFunctional's for many frequently used test statistics are
     provided: 'maxBB' for the double maximum function, 'meanL2BB' for
     the Cramer-von Mises statistic, or 'rangeBB' for the range
     statistic. Furthermore, 'supLM' generates an object of class
     '"efpFunctional"' for a certain trimming parameter, see the
     examples. More details can be found in Zeileis (2004).

_V_a_l_u_e:

     'efpFunctional' returns a list of class '"efpFunctional"' with
     components inlcuding 

plotProcess: a function for plotting empirical fluctuation processes,

computeStatistic: a function for computing a test statistic from an
          empirical fluctuation process,

computePval: a function for computing the corresponding p value,

computeCritval: a function for computing critical values.

_R_e_f_e_r_e_n_c_e_s:

     Zeileis A., Hornik K. (2003), Generalized M-Fluctuation Tests for
     Parameter Instability, Report 80, SFB "Adaptive Information
     Systems and Modelling in Economics and Management Science", Vienna
     University of Economics, <URL:
     http://www.wu-wien.ac.at/am/reports.htm#80>.

     Zeileis A. (2005), A Unified Approach to Structural Change Tests
     Based on ML Scores, F Statistics, and OLS Residuals. _Econometric
     Reviews_, *24*, 445-466.

     Zeileis A. (2006), Implementing a Class of Structural Change
     Tests: An Econometric Computing Approach. _Computational
     Statistics & Data Analysis_,  *50*, 2987-3008.

_S_e_e _A_l_s_o:

     'efp', 'efpFunctional'

_E_x_a_m_p_l_e_s:

     data("BostonHomicide")
     gcus <- gefp(homicides ~ 1, family = poisson, vcov = kernHAC,
                  data = BostonHomicide)
     plot(gcus, functional = meanL2BB)        
     gcus
     sctest(gcus, functional = meanL2BB)

     y <- rnorm(1000)
     x1 <- runif(1000)
     x2 <- runif(1000)

     ## supWald statistic computed by Fstats()
     fs <- Fstats(y ~ x1 + x2, from = 0.1)
     plot(fs)
     sctest(fs)

     ## compare with supLM statistic
     scus <- gefp(y ~ x1 + x2, fit = lm)
     plot(scus, functional = supLM(0.1))
     sctest(scus, functional = supLM(0.1))

     ## seatbelt data
     data("UKDriverDeaths")
     seatbelt <- log10(UKDriverDeaths)
     seatbelt <- cbind(seatbelt, lag(seatbelt, k = -1), lag(seatbelt, k = -12))
     colnames(seatbelt) <- c("y", "ylag1", "ylag12")
     seatbelt <- window(seatbelt, start = c(1970, 1), end = c(1984,12))

     scus.seat <- gefp(y ~ ylag1 + ylag12, data = seatbelt)

     ## double maximum test
     plot(scus.seat)
     ## range test
     plot(scus.seat, functional = rangeBB)
     ## Cramer-von Mises statistic (Nyblom-Hansen test)
     plot(scus.seat, functional = meanL2BB)
     ## supLM test
     plot(scus.seat, functional = supLM(0.1))

