Field.sim          package:ProbForecastGOP          R Documentation

_S_i_m_u_l_a_t_i_o_n _o_f _w_e_a_t_h_e_r _r_a_n_d_o_m _f_i_e_l_d

_D_e_s_c_r_i_p_t_i_o_n:

     Simulates and displays realizations of forecast weather fields
     using a  geostatistical model.

_U_s_a_g_e:

     Field.sim(obs, forecast, coord1.grid, coord2.grid, forecast.grid,variog.model="exponential", param.est, n.sim=99, n.displ=4, 
     qt.displ=c(10,50,90)) 

_A_r_g_u_m_e_n_t_s:

     obs: numeric vector containing the observed weather quantity.

forecast: numeric vector containing the forecasted weather quantity.

coord1.grid: numeric vector containing the longitudes of the grid
          points for the forecast.

coord2.grid: numeric vector containing the latitudes of the grid points
          for the forecast.

forecast.grid: numeric vector containing the forecast grid.

variog.model: character string with the name of the variogram model to
          be used for the simulations. Implemented models are
          'exponential', 'spherical', 'gauss', 'matern', and
          'gencauchy'.

param.est: numeric vector containing values for the parameters to use
          in the parametric variogram model. 

          If the variog.model specified is 'exponential', 'spherical'
          or  'gauss', then the parameters required are, in order, the
          nugget effect  (a non-negative number), the variance and the
          range (both positive  numbers). 

          If the variog.model specified is 'gencauchy', the parameters
          required  are, in order, the nugget effect (a 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 variog.model specified is 'matern' the parameters
          required are,  in order, the nugget effect (a non-negative
          number), the variance, the  range, and the smoothness
          parameter _a_ (all positive numbers).

          For more details on the equation of the variogram models
          listed above, look below at the section "Details".

   n.sim: number of realizations to be simulated.

 n.displ: number of realizations to be displayed on screen.

qt.displ: numeric vector containing the quantiles to be displayed.

_D_e_t_a_i_l_s:

     The function initially estimates the additive and multiplicative
     bias by regressing the forecasts on the observed weather quantity.
     Then it simulates and displays realizations of the weather random
     field using the specified geostatistical model. Percentiles of the
     weather random field are calculated using the specified variogram
     model.

     - *Parametric variogram models implemented* - 

     Below are the equations of the parametric variogram models that
     can be implemented.

     - 'exponential' 


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


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

     - 'spherical'


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


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

     - 'gauss'


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


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

     - 'gencauchy'


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


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

     - '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 d is the distance, rho is the nugget effect,  sigma^{2} is
     the variance, r is the range, and a is the  smoothness parameter.

     - Defaults-

     By default, 99 weather random fields are simulated, and 4 of them
     are displayed. 

     If no vector of percentiles is provided, the 10th, 50th and  90th
     percentiles are determined and displayed.

_V_a_l_u_e:

     The function returns both a graphical and a numerical output. The 
     numerical output is a list with the following components: 

   model: Character string with the name of the variogram model used.

  nugget: Value of the nugget effect.

variance: Value of the variance.

   range: Value of the rang.

additional.par: Value(s) of the additional parameters required and 
          used in the variogram model. This is returned only if the
          variogram model  used is 'matern' or 'gencauchy'

sim.fields: 3-dimensional array where each layer contains the values of
          the simulated weather field at the gridded locations.

pct.fields: 3-dimensional array where each layer contains the specified
          percentile.


     The graphical output consists in plots of the simulated weather
     fields displayed on multiple pages.  Before displaying each page,
     the user will be asked for input.

_N_o_t_e:

     This function depends on the following packages: 'RandomFields' 
     and 'fields'.

_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.

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

     Schlather, M. (2001). Simulation and Analysis of Random Fields. 
     _R News_ *1(2)*, 18-20.

     Nychka, D. (2004). _The fields package._ Available at: 
     http:lib.stat.cmu.edu/R/CRAN/doc/package/fields.pdf.

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

_S_e_e _A_l_s_o:

     'plotfields', a plotting utility for weather random  fields,
     'GaussRF' in the 'RandomFields'  package, for simulation of
     Gaussian random fields.

_E_x_a_m_p_l_e_s:

     ## Loading data
     library(fields)
     library(RandomFields)
     data(slp)
     data(gridlong)
     data(gridlat)
     data(forecast.grid)
     day <- slp$date.obs
     id <- slp$id.stat
     coord1 <- slp$lon.stat
     coord2 <- slp$lat.stat
     obs <- slp$obs
     forecast <- slp$forecast
     coord1.grid <- gridlong$gridded.lon
     coord2.grid <- gridlat$gridded.lat
     forecast.grid <- forecast.grid$gridded.forecast

     ## Computing the 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 parameters
     param.est <- Variog.fit(emp.variog=variogram,variog.model="exponential",
     max.dist.fit=NULL,init.val=NULL,fix.nugget=FALSE)

     ## Simulating realizations of the weather random field
     simul <- 
     Field.sim(obs=obs,forecast=forecast,coord1.grid=coord1.grid,
     coord2.grid=coord2.grid,forecast.grid=forecast.grid,variog.model="exponential",
     param.est=c(param.est$nugget,param.est$variance,param.est$range),n.sim=4,
     n.displ=4,qt.displ=c(10,50,90))

