surf.gls               package:spatial               R Documentation

_F_i_t_s _a _T_r_e_n_d _S_u_r_f_a_c_e _b_y _G_e_n_e_r_a_l_i_z_e_d _L_e_a_s_t-_s_q_u_a_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Fits a trend surface by generalized least-squares.

_U_s_a_g_e:

     surf.gls(np, covmod, x, y, z, nx = 1000, ...)

_A_r_g_u_m_e_n_t_s:

      np: degree of polynomial surface 

  covmod: function to evaluate covariance or correlation function 

       x: x coordinates or a data frame with columns 'x', 'y', 'z' 

       y: y coordinates 

       z: z coordinates. Will supersede 'x$z' 

      nx: Number of bins for table of the covariance. Increasing adds
          accuracy, and increases size of the object. 

     ...: parameters for 'covmod' 

_V_a_l_u_e:

     list with components

    beta: the coefficients 

       x: 

       y: 

       z: and others for internal use only. 

_R_e_f_e_r_e_n_c_e_s:

     Ripley, B. D. (1981) _Spatial Statistics._ Wiley.

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_S_e_e _A_l_s_o:

     'trmat', 'surf.ls', 'prmat', 'semat', 'expcov', 'gaucov',
     'sphercov'

_E_x_a_m_p_l_e_s:

     library(MASS)  # for eqscplot
     data(topo, package="MASS")
     topo.kr <- surf.gls(2, expcov, topo, d=0.7)
     trsurf <- trmat(topo.kr, 0, 6.5, 0, 6.5, 50)
     eqscplot(trsurf, type = "n")
     contour(trsurf, add = TRUE)

     prsurf <- prmat(topo.kr, 0, 6.5, 0, 6.5, 50)
     contour(prsurf, levels=seq(700, 925, 25))
     sesurf <- semat(topo.kr, 0, 6.5, 0, 6.5, 30)
     eqscplot(sesurf, type = "n")
     contour(sesurf, levels = c(22, 25), add = TRUE)

