linesmodel          package:ProbForecastGOP          R Documentation

_C_o_m_p_u_t_a_t_i_o_n _o_f _p_a_r_a_m_e_t_r_i_c _v_a_r_i_o_g_r_a_m _m_o_d_e_l

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

     Computes the value of the parametric variogram model at given
     distances.

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

     linesmodel(distance, variog.model="exponential", param)

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

distance: numeric vector of distances.

variog.model: character string giving the name of the parametric
          variogram model. Implemented models are: 'exponential',
          'spherical', 'gauss', 'gencauchy' and 'matern'.

   param: numeric vector containing the values of the variogram
          parameters. 

          If the parametric model specified is 'exponential',
          'spherical' or  'gauss', 'param' is a vector of length 3
          containing, in order:  the nugget effect (non negative
          number), the variance and the range (both  positive numbers).

          If the parametric model specified is 'gencauchy', 'param' is
          a  vector of length 5 whose entries are, in order: the nugget
          effect (non  negative number), the variance, the range (both
          positive numbers), the  smoothness parameter 'a' (a number in
          (0,2]), and the long-range  parameter 'b' (a positive
          number).

          If the parametric model specified is 'matern', 'param' is a 
          vector of length 4 whose entries are, in order: the nugget
          effect (a  non-negative number), the variance, the range, and
          the smoothness  parameter 'a' (all three, positive numbers).

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

     The function calculates the value of the parametric variogram at
     given distances using the following equations:

     - If the parametric model is 'exponential'


         gamma(d) = rho+sigma^{2} cdot (1-exp(- frac{d}{r}))


     where rho is the nugget effect, sigma^2 is the variance, r is the
     range, and d is the distance.

     - If the parametric model is 'spherical'


 gamma(d) = rho+sigma^{2} cdot  (frac{3}{2}cdotfrac{d}{r}-frac{1}{2}cdot frac{d^3}{r^3})


     where rho is the nugget effect, sigma^2 is the variance, r is the
     range, and d is the distance.

     - If the parametric model is 'gauss'


       gamma(d) = rho+sigma^{2} cdot (1-exp(- frac{d^2}{r^2} ))


     where rho is the nugget effect, sigma^2 is the variance, r is the
     range, and d is the distance.

     - If the parametric model is 'gencauchy'


 gamma(d) = rho+sigma^{2} cdot  (1-(1+frac{d^a}{r^a})^{- frac{b}{a}})


     where rho is the nugget effect, sigma^2 is the variance,  r is the
     range, d is the distance, a is the smoothness  parameter, and b is
     the long-range parameter.

     - If the parametric model is 'matern'


 gamma(d) = rho+sigma^{2} cdot (1-(frac{2^{1-a}}{Gamma(a)}cdot  frac{d^a}{r^a} cdot K_{a}(frac{d}{r}))


     where rho is the nugget effect, sigma^2 is the variance,  r is the
     range, d is the distance, and a is the  smoothness parameter.

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

     The function returns a numeric vector with the values of the
     parametric variogram model at the bin midpoints.

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

     Gel, Y., Raftery, A. E., Gneiting, T., Berrocal, V. J.
     veronica@stat.washington.edu.

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

     Gel, Y., Raftery, A. E., Gneiting, T. (2004). Calibrated 
     probabilistic mesoscale weather field forecasting: The
     Geostatistical  Output Perturbation (GOP) method (with
     discussion). _Journal of the  American Statistical Association_,
     *Vol. 99 (467)*, 575-583.

     Cressie, N. A. C. (1993). _Statistics for Spatial Data_ (revised
     ed.). Wiley: New York.

     Gneiting, T., Schlather, M. (2004). Stochastic models that
     separate  fractal dimension and the Hurst effect. _SIAM Review_
     *46*,  269-282.

     Stein, M. L. (1999). _Interpolation of Spatial Data - Some Theory
     for Kriging_. Springer-Verlag: New York.

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

     ## Loading data
     data(slp)
     day <- slp$date.obs
     id <- slp$id.stat
     coord1 <- slp$lon.stat
     coord2 <- slp$lat.stat
     obs <- slp$obs
     forecast <- slp$forecast

     ## Computing empirical variogram
     variogram <- Emp.variog(day=day,obs=obs,forecast=forecast,id=id,coord1=coord1,
     coord2=coord2,cut.points=NULL,max.dist=NULL,nbins=NULL)

     ## Estimating variogram parameters
     ## Without specifying initial values for the parameters
     param.variog <- 
     Variog.fit(emp.variog=variogram,variog.model="exponential",max.dist.fit=NULL,
     init.val=NULL,fix.nugget=FALSE)

     ## Plotting the empirical variogram with the estimated parametric variogram superimposed
     plot(variogram$bin.midpoints,variogram$empir.variog,xlab="Distance",ylab="Semi-variance")
     lines(variogram$bin.midpoints,linesmodel(distance=variogram$bin.midpoints,variog.model="exponential",param=c(param.variog$nugget,
     param.variog$variance,param.variog$range)))

