akimaInterp            package:fUtilities            R Documentation

_B_i_v_a_r_i_a_t_e _S_p_l_i_n_e _I_n_t_e_r_p_o_l_a_t_i_o_n

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

     Interpolates bivariate data sets using Akima  spline
     interpolation.

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

           
     akimaInterp(x, y = NULL, z = NULL, gridPoints = 21,
         xo = seq(min(x), max(x), length = gridPoints),
         yo = seq(min(y), max(y), length = gridPoints), extrap = FALSE)
         
     akimaInterpp(x, y = NULL, z = NULL, xo, yo, extrap = FALSE)

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

 x, y, z: for 'akimaInterp' the arguments 'x' and 'y' are  two numeric
          vectors of grid pounts, and 'z' is a numeric  matrix or any
          other rectangular object which can be transformed  by the
          function 'as.matrix' into a matrix object.   For
          'akimaInterpp' we  consider either three numeric vectors  of
          equal length or if  'y' and 'z' are NULL, a list with 
          entries 'x', 'y', 'z', or named data frame with  'x' in the
          first, 'y' in the second, and 'z' in  the third column.  

gridPoints: an integer value specifying the number of grid points in
          'x'  and 'y' direction. 

  xo, yo: for 'akimaInterp' two numeric vectors of data points spanning
          the grid, and for 'akimaInterpp' two numeric vectors of data
          points building pairs for pointwise interpolation. 

  extrap: a logical, if 'TRUE' then the data points are extrapolated. 

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

     Two options are available gridded and pointwise interpolation. 

     'akimaInterp' is a function wrapper to the 'interp'  function
     provided by the contributed R package 'akima'. The Fortran code of
     the Akima spline interpolation routine was written by H. Akima.

     Linear surface fitting and krige surface fitting are provided by
     the functions 'linearInterp' and 'krigeInterp'.

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

     'akimaInterp' 

     returns a list with at least three entries, 'x', 'y'  and 'z'.
     Note, that the returned values, can be directly  used by the 
     'persp' and 'contour' 3D plotting methods. 

     'akimaInterpp' 

     returns a data.frame with columns '"x"', '"y"',  and '"z"'.

_N_o_t_e:

     IMPORTANT: The contributed package 'akima' is not in the 
     dependence list of the DESCRIPTION file due to license conditions.
     The Rmetrics user has to load this package from the CRAN server on
      his own responsibility, please check the license conditions.

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

     Akima H., 1978, _A Method of Bivariate Interpolation and Smooth
     Surface Fitting for  Irregularly Distributed Data Points_, ACM
     Transactions on Mathematical Software 4, 149-164.

     Akima H., 1996, _Algorithm 761: Scattered-Data Surface Fitting
     that has the Accuracy  of a Cubic Polynomial_, ACM Transactions on
     Mathematical Software 22, 362-371.

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

     'linearInterp',  'krigeInterp'.

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

      
     ## akimaInterp -
        # Akima Interpolation:    
        if (require(akima)) {
          set.seed(1953)
          x = runif(999) - 0.5
          y = runif(999) - 0.5
          z = cos(2*pi*(x^2+y^2))
          ans = akimaInterp(x, y, z, gridPoints = 41, extrap = FALSE)
          persp(ans, theta = -40, phi = 30, col = "steelblue",
             xlab = "x", ylab = "y", zlab = "z")
          contour(ans)
        }

