roi                  package:nsRFA                  R Documentation

_R_e_g_i_o_n _o_f _i_n_f_l_u_e_n_c_e

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

     Formation of clusters for Regional Frequency Analysis: region of
     influence (Burn, 1990).

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

      roi (p.ungauged, p.gauged, cod.p, x=NULL, cod=NULL)
      roi.hom (p.ungauged, p.gauged, cod.p, x, cod,
        test="HW", limit=2, Nsim=500, index=2)
      roi.st.year (p.ungauged, p.gauged, cod.p, x, cod,
        test="HW", station.year=500, Nsim=500, index=2)

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

       x: vector representing data from many samples defined with 'cod'

     cod: array that defines the data subdivision among sites

   index: if 'index'=1 samples are divided by their average value; if
          'index'=2 (default) samples are divided by their median value

p.ungauged: parameters of the ungauged site (1 row)

p.gauged: parameters of gauged sites

   cod.p: code of gauged sites

    test: homogeneity test to apply: '"HW"' (default) or '"AD"' (in
          'roi.st.year' you can choose '"HW and AD"' too

   limit: limit over which regions must be considered heterogeneous:
          for example 2 for '"HW"' or .95 for '"AD"'

    Nsim: number of simulations in '"HW"' or '"AD"' tests

station.year: number of station years to form the region

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

     The Euclidean distance is used. Given p different classification
     variables, the distance between two elements i and j is:

          d_ij = sqrt{1/p sum[h from 1 to p](x_hi - x_hj)^2}

     where x_hi is the value of the h-th variable of the i-th element.

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

     'roi' returns the region of influence for the site defined with
     'p.ungauged'. It the gauged sites ordered according to the
     euclidean distance against the site of interest (the distance is
     evaluated in the space defined by parameters 'p.ungauged' and
     'p.gauged'). If 'x=NULL' and 'cod=NULL' (default), a data.frame
     with the ordered sites and the distances against the site of
     interest is returned. If 'x' and 'cod' are provided, the
     data.frame will contain also statistics of samples (number of data
     'n' and L-moments).

     'roi.hom' returns the region of influence for the site defined
     with 'p.ungauged'. It returns codes of gauged sites that form an
     homogeneous region according to the Hosking and Wallis '"HW"' or
     Anderson-Darling '"AD"' tests. The region is formed using
     distances in the space defined by parameters 'p.ungauged' and
     'p.gauged'.

     'roi.st.year' returns the region of influence for the site
     defined with 'p.ungauged'. It returns codes of gauged sites that
     form a region and the risult of homogeneity tests, according to
     the station-year criterion. It also return the similarity ranking
     factor S_i, the weights w_i and the regional L-moments as
     evaluated in the Flood Estimation Handbook (Robson and Reed,
     1999). The region is formed using distances in the space defined
     by parameters 'p.ungauged' and 'p.gauged'.

_N_o_t_e:

     For information on the package and the Author, and for all the
     references, see 'nsRFA'.

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

     'traceWminim', 'AD.dist', 'HOMTESTS' for the definition of the
     Hosking and Wallis '"HW"' or Anderson-Darling '"AD"' tests.

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

     data(hydroSIMN)
     parameters
     summary(parameters)

     annualflows
     summary(annualflows)
     x <- annualflows["dato"][,]
     cod <- annualflows["cod"][,]

     roi(parameters[5,3:5],parameters[-5,3:5],parameters[-5,1])
     roi(parameters[5,3:5],parameters[-5,3:5],parameters[-5,1],x,cod)

     # roi.hom
     #roi.hom(parameters[5,3:5],parameters[-5,3:5],parameters[-5,1],x,cod)
                                 # it takes some time
     #roi.hom(parameters[5,3:5],parameters[-5,3:5],parameters[-5,1],x,cod,
     #        test="AD",limit=.95)      # it takes some time

     #roi.hom(parameters[8,3:5],parameters[-8,3:5],
     #         parameters[-8,1],x,cod)    # it takes some time

     # roi.st.year
     roi.st.year(parameters[5,3:5],parameters[-5,3:5],
                 parameters[-5,1],x,cod)
     roi.st.year(parameters[5,3:5],parameters[-5,3:5],parameters[-5,1],
                 x,cod,test="AD",station.year=100)

