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)))

