SCSnp                 package:BSagri                 R Documentation

_S_i_m_u_l_t_a_n_e_o_u_s _c_o_n_f_i_d_e_n_c_e _s_e_t_s _f_r_o_m _e_m_p_i_r_i_c_a_l _j_o_i_n_t _d_i_s_t_r_i_b_u_t_i_o_n.

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

     Calcualte simultaneous confidence sets according to Besag et al.
     (1995) from a empirical joint distribution of a parameter vector.
     Joint empirical distributions might be obtained from WinBUGS or
     OpenBUGS calls.

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

     SCSnp(x,...)

     ## Default S3 method:
     SCSnp(x, conf.level = 0.95,
      alternative = "two.sided", ...)

     ## S3 method for class 'bugs':
     SCSnp(x, conf.level = 0.95,
      alternative = "two.sided", whichp = NULL, ...)

     ## S3 method for class 'CCRatio':
     SCSnp(x, ...)

     ## S3 method for class 'CCDiff':
     SCSnp(x, ...)

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

       x: a matrix N-times-P matrix or an object of class 'CCRatio' or
          'CCDiff' 

conf.level: a single numeric value between 0.5 and 1, the simultaneous
          confidence level

alternative: a single character string, one of '"two.sided"', '"less"',
          '"greater"', for two-sided, upper and lower limits  

  whichp: a single character string, naming an element of the
          'sims.list' if 'x' is a 'bugs' object, ignored otherwise 

     ...: further arguments, currently not used 

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

     Let P be the number of parameters in the parameter vector and N be
     the total number of values obtained for the empirical joint
     distribution of the parameter vector, e.g. as can be obtaine e.g.,
     from Gibbs sampling.

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

     An object of class "SCSnp", a list with elements

conf.int : a P-times-2 matrix containing the lower and upper confidence
          limits

estimate : a numeric vector of length P, containing the medians of the
          P marginal empirical distributions

      x : the input object

      k : the number of values outside the SCS, i.e. conf.level*N

      N : the number of values used to construct the confidence set

conf.level : a single numeric value, the nominal confidence level, as
          input

alternative : a single character string, as input

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

     Frank Schaarschmidt

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

     Besag J, Green P, Higdon D, Mengersen K (1995): Bayesian
     Computation and Stochastic Systems. Statistical Science 10 (1),
     3-66.

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

     'CInp' for a wrapper to 'quantile' to compute elementwise
     intervals

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

     # Assume a 1000 times 4 matrix of 4 mutually independent
     # normal variables:

     X<-cbind(rnorm(1000), rnorm(1000), rnorm(1000), rnorm(1000))

     SCSts<-SCSnp(x=X, conf.level=0.9, alternative="two.sided")
     SCSts

     SCS<-SCSts$conf.int

     in1<-X[,1]>=SCS[1,1] & X[,1]<=SCS[1,2] 

     in2<-X[,2]>=SCS[2,1] & X[,2]<=SCS[2,2] 

     in3<-X[,3]>=SCS[3,1] & X[,3]<=SCS[3,2] 

     in4<-X[,4]>=SCS[4,1] & X[,4]<=SCS[4,2] 

     sum(in1*in2*in3*in4)

