posterior              package:evdbayes              R Documentation

_M_C_M_C _S_a_m_p_l_i_n_g _o_f _P_o_s_t_e_r_i_o_r _D_i_s_t_r_i_b_u_t_i_o_n_s

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

     Constructing MCMC samples of prior and posterior distibutions for
     the location (with optional trend), scale and shape parameters
     under the gev, order statistics or point process models.

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

     posterior(n, init, prior, lh = c("none", "gev", "pp","os"), ..., psd,
         burn = 0, thin = 1)

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

       n: The run-length; the number of sampled vectors (excluding
          'init').

    init: Numeric vector of length three/four, giving the initial
          values for the chain, taken to be iteration zero.

   prior: An object of class '"evprior"', constructed using
          'prior.prob', 'prior.quant' or 'prior.norm'.

      lh: A character string specifying the likelihood; either '"gev"'
          for gev, '"os"' for order statistics, '"pp"' for Poisson
          process or '"none"' for none (the default). The latter can be
          used to sample from the prior distribution.

     ...: Arguments to the likelihood. Should include 'data' unless
          'lh' is '"none"'. Should also include 'thresh' and 'noy' if
          'lh' is '"pp"'. Should include the vector 'trend' if a linear
          trend on the location is implemented. See 'pplik' for
          details.

     psd: A vector of length three/four containing standard deviations
          for proposal distributions.

    burn: The burn-in period (an integer); the first 'burn' iterations
          (including 'init') are excluded from the chain.

    thin: The thinning interval (an integer); iteration k is stored
          only if k mod 'thin' is zero (and if k greater than or equal
          to 'burn').

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

     See the user's guide.

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

     A matrix with '1+floor(n/thin)-burn' rows. Row labels give the
     iteration numbers. Column labels give parameter names.

     An attribute 'ar' is also returned. This is a matrix containing
     acceptence rates in the first row (the number of proposals
     accepted divided by the number of iterations) and ``external
     rates'' in the second (the number of proposals that resulted in a
     zero likelihood, divided by the number of iterations).

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

     'pplik', 'prior.prob'

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

     mat <- diag(c(10000, 10000, 100))
     pn <- prior.norm(mean = c(0,0,0), cov = mat)
     ## Not run: data(portpirie)
     ## Not run: 
     posterior(1000, init = c(5,1,0.1), prior = pn, lh = "gev",
         data = portpirie, psd = c(.02,.1,.1))
     ## End(Not run)

