far                   package:far                   R Documentation

_F_A_R_X(_1) _m_o_d_e_l _e_s_t_i_m_a_t_i_o_n

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

     Estimates the parameters of FAR(1) and FARX(1) processes  (mean
     and autocorrelation operator)

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

     far(data, y, x, kn, center=TRUE, na.rm=TRUE, joined=FALSE)

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

    data: A 'fdata' object. 

       y: A vector giving the name(s) of the endogenous variable(s) of
          the model. 

       x: A vector giving the name(s) of the exogenous variable(s) of
          the model. 

      kn: A vector giving the values of the various 'kn' (dimension of
          plug-in in the algorithm). If it not supplied, the default
          value is one. 

  center: Logical. Does the observation need to be centered. 

   na.rm: Logical. Does the 'n.a.' need to be removed. 

  joined: Logical. If 'TRUE', the joined (whole) far model is computed,
          otherwise the model work with the separated variables. 

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

     *The models*

     A Functional AutoRegressive of order 1 (*FAR(1)*) process is, in a
     general way,  defined by the following equation:


                        Tn=r(Tn-1)+En, n in Z


     where Tn and En take their values in a functional space (for
     instance an Hilbertian one), and r is a linear operator. En is a
     strong white noise.

     Now, let us consider a vector of observations, for instance:


                       (T1,n,...,Ti,n,...,Tm,n)


     where each  Ti,n lives in a one dimension functional space (not
     necessary the same). In the following, we will cut this list into
     two parts: the endogeneous variables Yn (the ones we are
     interested in), and the exogeneous variables Xn (which influence
     the endogeneous ones).

     Then an order 1 Functional AutoRegressive process with eXogeneous
     variables (*FARX(1)*) is defined by the equation:


                    Yn=r(Yn-1)+a(Xn-1)+En, n in Z


     where r and a are linear operators in the adequate spaces.

     *Estimation*

     This function estimates the parameters of FAR and FARX models.

     First, if the mean of the 'data' is not zero (which is required by
     the model), you can substance this mean using the 'center' option.
     Moreover, if the 'data' contains 'NA' values, you can work with it
     using the 'na.rm' option.

     *FAR Estimation*

     The estimation is mainly about estimating the r operator. This
     estimation is done in a appropriate subspace (computed from the
     variance of the observations). What is important to know is that
     the best dimension 'kn' for this subspace is not determined by
     this function. So the user have to supply this dimension using the
     'kn' option. A way to chose this dimension is to first use the
     'far.cv' function on the history.

     *FARX Estimation*

     The FARX estimation can be realized by two methods: joined or not.

     The *joined* estimation is done by ``joining'' the variables into
     one and estimating a FAR model on the resulting variable. For
     instance, with the previous notations, the transformation is:


                             Tn=(Yn,Xn+1)


     and Tn is then a peculiar FAR(1) process. In such a case, you have
     to use the 'joined=TRUE' oto the interpretation of this
     operatorption and specify *one* value for 'kn' (corresponding to
     the Tn variable).

     Alternatively, you can choose not to estimate the FARX model by
     the joined procedure, then 'kn' need to be a vector with a length
     equal to the number of variables involved in the FARX model
     (endogeneous and exogeneous).

     In both procedures, the endogeneous and exogeneous variables are
     provided through the 'y' and 'x' options respectively.

     *Results*

     The function returns a 'far' object. Use the 'print', 'coef' and
     'predict' functions to get more informations about the model.

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

     A 'far' object, see details for more informations.

_N_o_t_e:

     This function could be used to estimate FAR and FARX with order
     higher than 1 as a change of variables can transform the process
     to an order 1 FAR or FARX. For instance, if Tn is a FAR(2) process
     then Yn=(Tn,Tn-1) is a FAR(1) process.

     However, this is not a basic use of this function and may require
     a hard work of the user to get the result.

_A_u_t_h_o_r(_s):

     J. Damon

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

     Besse, P. and Cardot, H. (1996). Approximation spline de la 
     prvision d'un processus fonctionnel autorgressif d'ordre 1. 
     _Revue Canadienne de Statistique/Canadian Journal of Statistics_, 
     *24*, 467-487.

     Bosq, D. (2000) _Linear Processes in Function Spaces: Theory and
     Applications_, (Lecture Notes in Statistics, Vol. 149). New York:
     Springer-Verlag.

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

     'predict.far', 'far.cv'

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

       # Simulation of a FARX process
       data1 <- simul.farx(m=10,n=400,base=base.simul.far(20,5),
                     base.exo=base.simul.far(20,5),
                     d.a=matrix(c(0.5,0),nrow=1,ncol=2),
                     alpha.conj=matrix(c(0.2,0),nrow=1,ncol=2),
                     d.rho=diag(c(0.45,0.90,0.34,0.45)),
                     alpha=diag(c(0.5,0.23,0.018)),
                     d.rho.exo=diag(c(0.45,0.90,0.34,0.45)),
                     cst1=0.0)

       # Cross validation (joined and separate)
       model1.cv <- far.cv(data=data1, y="X", x="Z", kn=8, ncv=10, cvcrit="X",
                     center=FALSE, na.rm=FALSE, joined=TRUE)
       model2.cv <- far.cv(data=data1, y="X", x="Z", kn=c(4,4), ncv=10, cvcrit="X",
                     center=FALSE, na.rm=FALSE, joined=FALSE)
       print(model1.cv)
       print(model2.cv)
       k1 <- model1.cv$minL2[1]
       k2 <- model2.cv$minL2[1:2]

       # Modelization of the FARX process (joined and separate)
       model1 <- far(data=data1, y="X", x="Z", kn=k1,
                     center=FALSE, na.rm=FALSE, joined=TRUE)
       model2 <- far(data=data1, y="X", x="Z", kn=k2,
                     center=FALSE, na.rm=FALSE, joined=FALSE)
       print(model1)
       print(model2)

