kerfon                  package:far                  R Documentation

_F_u_n_c_t_i_o_n_a_l _K_e_r_n_e_l _e_s_t_i_m_a_t_i_o_n

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

     Modelization of 'fdata' using functional kernel.

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

     kerfon(data, x, r, hmin, hmax, na.rm=TRUE)

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

    data: A 'fdata' object. 

       x: The name of the studied variable. 

       r: Number of observations used to cross validate the model. 

    hmin: Minimal value of the bandwidth. 

    hmax: Maximal value of the bandwidth. 

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

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

     This function constructs a functional kernel model and performs
     the estimation of it's bandwidth.

     One nonparametric way to deal with the conditional expectation
     r(x)=E[X(i)|X(i-1)=x], where X(i) is a $H$-valued process, is to
     consider a predictor inspired by the classical kernel regression,
     as in Nadaraja and Watson. This estimator is defined by :


 r*(x,hn)=sum of(X(i+1)*K(||X(i)-x||/hn)))/((n-1) * sum of(K(||X(i)-x||/hn))))


     Where K is a kernel, ||.|| is the norm in H, and hn is the
     bandwidth (in R+*).

     The function 'kerfon' use the cross validation to determinate a
     value for hn. This method have been chosen because of the lack of
     theoretical results about this model. The parameters 'hmin' and
     'hmax' are used, when provided, to control the permissible values
     of hn. By default, those parameters are respectively equals to
     sigma/8 and 4*sigma, where sigma is the estimated squared root of
     the variance operator of X. To choose the value of hn, you need to
     provide the same value for both 'hmin' and 'hmax'.

     During the cross-validation, considering that the fdata object 'x'
     contains n observations, the function use the first (n-r)
     observations as the past values, and compute the mean square norm
     of the errors on the last r observations.

     Of course, if the model created is then used to compute prediction
     through 'predict.kerfon', the whole set of observations (the n
     observations) are used as the past values.

     As 'fdata' object may contains several variables, a way is
     provided to select the studied variable (the function only works
     with one variable for the moment).

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

     A kerfon object. A method for the 'print' function is provided.

     For information, the object is a list with the following elements
     :

    call: the call of the function.

       h: the bandwidth (three values : optimal, minimum, maximum)

       x: the name of the chosen variable

   xdata: the past values for 'x'

   ydata: the associated values for 'x'

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

     J. Damon

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

     'predict.kerfon'

_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
       model1 <- kerfon(data=data1, x="X", r=10, na.rm=TRUE)
       print(model1)

