Aggregate Gaussians observed with the same mean and precision, into an equivalent triplet, for use with family="agaussian"

inla.agaussian(y, s = NULL)

Arguments

y

Repeated observations. If y is a matrix, then each row represents repeated observations. if y is a list, then each element of the list is a vector of repeated observations. If y is a vector, then the whole vector represents repeated observations. The optional scaling s, must have the same format as y, ie matrix or vector. NA's in y (and s) are removed and not used or counted. If s is given, then the NA-pattern in y and s must be the same.

s

Optional fixed scaling of the precisions. Must be in the same format as y, and have the same NA-pattern. See the documentation for details.

Value

The output is a inla.mdata-object ready for use with family="agaussian". See the example in the documentation.

Author

Havard Rue hrue@r-inla.org

Examples

 A = matrix(1:25,5,5)
 inla.agaussian(A)
#> inla.cols =  1 5 
#>   Y1 Y2 Y3 Y4 Y5
#> 1 50  0  5  5 11
#> 2 50  0  5  5 12
#> 3 50  0  5  5 13
#> 4 50  0  5  5 14
#> 5 50  0  5  5 15

 A[1,-1] = NA
 A[2,-(2:3)] = NA
 inla.agaussian(A)
#> inla.cols =  1 5 
#>      Y1 Y2 Y3 Y4   Y5
#> 1  0.00  0  1  1  1.0
#> 2  6.25  0  2  2  9.5
#> 3 50.00  0  5  5 13.0
#> 4 50.00  0  5  5 14.0
#> 5 50.00  0  5  5 15.0