maxPosterProb {glmmAK} | R Documentation

## G-spline utility

### Description

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.

### Usage

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

### Arguments

`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.

### Value

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

### Author(s)

Arnošt Komárek arnost.komarek[AT]mff.cuni.cz

### See Also

`cumlogitRE`, `logpoissonRE`.

### Examples

      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=""))

[Package glmmAK version 1.3-1 Index]