koplsKernel              package:kopls              R Documentation

_K_e_r_n_e_l _c_o_n_s_t_r_u_c_t_i_o_n _m_e_t_h_o_d

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

     Constructs a kernel matrix K = <phi('X1'), phi('X2')>. The kernel
     function k() determines how the data is transformed and is passed
     as the separate parameter 'Ktype' to the function. Currently
     'Ktype' can be either 'g' (Gaussian) or 'p' (polynomial); see the
     supplied reference for definitions of these kernel functions.

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

     koplsKernel(X1, X2, Ktype, param)

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

      X1: 'Left side' matrix in expression K = <phi('X1'), phi('X2')>.

      X2: 'Right side' matrix in expression K = <phi('X1'), phi('X2')>.

   Ktype: Type of kernel function: either 'g' (Gaussian) or 'p'
          (polynomial).

   param: A vector with parameters to the kernel function.

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

     If the second parameter 'X2' is set to NULL, the kernel matrix is
     considered to be symmetric and hence the kernel function can be
     applied at a considerable speed reduction. This applies generally
     to pure training kernel or test kernels (where 'X1' = 'X2'), but
     not to a hybrid test/training kernel (where 'X1' != 'X2').

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

     The kernel matrix K, transformed by the kernel function specified
     by 'Ktype'.

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

     Max Bylesjo and Mattias Rantalainen

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

     Rantalainen M, Bylesjo M, Cloarec O, Nicholson JK, Holmes E and
     Trygg J. *Kernel-based orthogonal projections to latent structures
     (K-OPLS)*, _J Chemometrics_ 2007; 21:376-385.
     doi:10.1002/cem.1071.

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

     data(koplsExample)

     ## Define kernel function parameter
     sigma<-25

     ## Construct kernels
     Ktr<-koplsKernel(Xtr,NULL,'g',sigma)
     KteTr<-koplsKernel(Xte,Xtr,'g',sigma)
     KteTe<-koplsKernel(Xte,NULL,'g',sigma)

