maxPosterProb             package:glmmAK             R Documentation

_G-_s_p_l_i_n_e _u_t_i_l_i_t_y

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

     For given G-spline basis and given data, it determines for each
     data point the G-spline component for which the value of the basis
     density is maximal.

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

     maxPosterProb(data, intercept, std.dev, K, delta, sigma)

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

    data: numeric vector or matrix with data. If given as a matrix then
          rows correspond to observations and columns to margins. 

intercept: numeric vector of length 1 or 'ncol(data)' with intercepts
          for each margin.

          If given as a number, it is recycled. 

 std.dev: numeric vector of length 1 or 'ncol(data)' with standard
          deviations for each margin.

          If given as a number, it is recycled. 

       K: numeric vector of length 1 or 'ncol(data)' which specifies,
          for each marginal G-spline, then number of knots on each side
          of the zero knot. That is, the i-th marginal G-spline has
          2K[i]+1 knots.

          If given as a number, it is recycled.   

   delta: numeric vector of length 1 or 'ncol(data)' which specifies
          the distance between two consecutive knots for each marginal
          G-spline. That is, the i-th marginal G-spline has the
          following knots

               mu[i,j] = j*delta[i], j=-K[i],...,K[i].


          If given as a number, it is recycled. 

   sigma: numeric vector of length 1 or 'ncol(data)' with basis
          standard deviations for marginal G-splines.

          If given as a number, it is recycled. 

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

     Matrix which specifies determined components (indeces are on scale
     -K[i],...,K[i]).

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

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

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

     'cumlogitRE', 'logpoissonRE'.

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

       N <- 100
       intcpt <- c(0, 5, 15)
       std.dev <- c(1, 0.5, 3)
       data <- data.frame(b1=rnorm(N, intcpt[1], std.dev[1]),
                          b2=rnorm(N, intcpt[2], std.dev[2]),
                          b3=rnorm(N, intcpt[3], std.dev[3]))
       alloc <- maxPosterProb(data=data, intercept=intcpt, std.dev=std.dev,
                              K=15, delta=0.3, sigma=0.2)

       par(mfrow=c(1, 3), bty="n")
       for (i in 1:3) hist(alloc[,i], prob=TRUE, col="seagreen3",
                           xlab="Allocation", breaks=(-15):15,
                           main=paste("Margin ", i, sep=""))

