summaryGspline2            package:glmmAK            R Documentation

_S_u_m_m_a_r_y _f_o_r _a _b_i_v_a_r_i_a_t_e _G-_s_p_l_i_n_e (_p_e_n_a_l_i_z_e_d _G_a_u_s_s_i_a_n _m_i_x_t_u_r_e)

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

     This function is primarily designed to work out the MCMC output
     from functions 'cumlogitRE' and 'logpoissonRE' in which a
     distribution of the bivariate random effect was specified as a
     G-spline. It computes posterior pointwise mean and quantiles for a
     G-spline density based on the MCMC output.

     Besides the summary for the joint bivariate G-spline density it
     also directly computes summaries for both marginal G-splines.

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

     summaryGspline2(x1, x2, mu1, mu2, sigma1, sigma2,
        standard=TRUE, intcpt, scale,
        probs, values=FALSE,
        dir=getwd(), wfile="weight.sim", indfile="knotInd.sim",
        header=TRUE, logw=FALSE, is.indfile=TRUE, 
        skip=0, nwrite)

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

      x1: grid of values for the first margin at which we evaluate the
          G-spline density

      x2: grid of values for the second margin at which we evaluate the
          G-spline density

     mu1: a vector with G-spline knots (means of basis G-splines) for
          the first margin

     mu2: a vector with G-spline knots (means of basis G-splines) for
          the second margin

  sigma1: basis standard deviation(s) for the first margin. If a single
          number is supplied then it is assumed that all basis
          G-splines in the first margin have the same standard
          deviation. Alternatively a vector of the same length as 'mu1'
          can be given in which case the basis G-splines in the first
          margin do not necessarily have the same standard deviations

  sigma2: basis standard deviation(s) for the second margin. If a
          single number is supplied then it is assumed that all basis
          G-splines in the second margin have the same standard
          deviation. Alternatively a vector of the same length as 'mu2'
          can be given in which case the basis G-splines in the second
          margin do not necessarily have the same standard deviations

standard: if 'TRUE' then the standardized (zero-mean, unit-variance)
          G-splines are computed and summarized

  intcpt: a two-column matrix with sampled intercept values. If not
          supplied it is assumed that all intercepts are equal to zero.

          It does not have to be supplied if 'standard=TRUE'. 

   scale: a two-column matrix with sampled intercept values of the
          G-spline scale (in most of my papers denoted by tau) If not
          supplied it is assumed that all scale values are equal to
          one.

          It does not have to be supplied if 'standard=TRUE'. 

   probs: probabilities for which the (pointwise) sample quantiles of
          the G-spline should be computed.

          If not given only average (and values) of the G-spline are
          computed

  values: if 'TRUE' also values of the G-spline at each (MCMC)
          iteration are returned.

          If 'FALSE' only sample mean (and quantiles) of the G-spline
          are returned

     dir: character giving the directory where the file with (sampled)
          G-spline (log-)weights is stored

   wfile: character giving the name of the file with (sampled) G-spline
          (log-)weights

 indfile: character giving the name of the file where it is indicated
          which G-spline components correspond to non-zero weights.

          It does not have to be supplied if 'is.indfile=FALSE'. 

  header: logical indicating whether the files 'wfile', 'indfile'
          contain a header

    logw: logical indicating whether the file 'wfile' contains
          logarithms of the weights

is.indfile: logical.

          If 'TRUE' then 'wfile' contains only the non-zero weights and
          the G-spline is reconstructed using 'indfile'.

          If 'FALSE' then 'wfile' must contain on each row weights of
          all components and 'indfile' is ignored.

    skip: number of data rows that should be skipped at the beginning
          of the files 'wfile', 'indfile'

  nwrite: frequency with which is the user informed about the progress
          of computation (every 'nwrite'th iteration count of
          iterations change)

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

     A list with the following components (component 'values',
     'values1', 'values2' are present only when the argument 'values'
     was 'TRUE'). The description below applies to the situation when
     'probs=0.5'. 

 summary: a list with the components

            'x1'    grid of values for the first margin at which we evaluate the G-spline density
            'x2'    grid of values for the second margin at which we evaluate the G-spline density
            'Mean'  a matrix with 'length(x1)' rows and 'length(x2)' columns giving
                    the pointwise posterior mean of the joint G-spline density
            '50%'   a matrix with 'length(x1)' rows and 'length(x2)' columns
                    giving the pointwise posterior 50% quantile of the joint G-spline density.
                    There is a matrix of this type for each 'probs' value.

summary1: a 'data.frame' with the following columns

            'x'     a grid of values at which the first marginal G-spline density is evaluated
            'Mean'  pointwise posterior mean of the first marginal G-spline density
            '50%'   pointwise posterior 50% quantile of the first marginal G-spline density.
                    There is one column of this type for each 'probs' value

summary2: a 'data.frame' for the second marginal G-spline having the
          same structure as 'summary1'.

  values: a matrix with one column for each ('x1', 'x2') value and
          number of rows equal to the length of the MCMC. In each row,
          there is a joint G-spline density evaluated at one MCMC
          iteration.

 values1: a matrix with one column for each 'x1' value and number of
          rows equal to the length of the MCMC. In each row, there is
          the first marginal G-spline density evaluated at one MCMC
          iteration.

 values1: a matrix with one column for each 'x1' value and number of
          rows equal to the length of the MCMC. In each row, there is
          the second marginal G-spline density evaluated at one MCMC
          iteration.

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

     Arno&#353t Kom&#225rek arnost.komarek[AT]mff.cuni.cz

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

     ### See ex-Toenail.pdf, ex-Toenail.R
     ### and ex-Epileptic.pdf, ex-Epileptic.R
     ### available in the documentation
     ### to the package

