iid: IID random effects kernel

Description Usage Arguments Details Value See Also Examples

Description

Construct an iid normal ‘random effects’ kernel.

Usage

1
iid(column = NULL, sigma = 1)

Arguments

column

optionally, a single string giving the name of a factor feature on which the kernel acts. This will be used to access columns from a dataframe when the kernel is evaluated . If NULL then the iid effect acts on each datapoint, rather than on groups.

sigma

a positive scalar parameter giving (the square-root of) the overall variance of the kernel

Details

The iid kernel takes the form:

k_{iid}(\mathbf{x}, \mathbf{x}') = σ^2 ( \mathbf{x} \mathbf{x}' )

where \mathbf{x} are indicator variables with each column containing 1s for records in a given group and 0s otherwise and σ^2 is the overall variance. This is equivalent to a hierarchical or random-effects model: z_j \sim N(0, σ^2) with j indexing the groups of the specified factor.

In practice, the active column should actually be a single factor and the indicator variables will be built internally.

Value

A kernel object for which there are a range of associated functions, see kernel and access for details.

See Also

Other kernel.constructors: composition, expo, int, lin, mat32, mat52, per, rbf, rq

Examples

1
2
3
4
5
6
7
8
9
 
# add a discrete variable to the pressure dataset
pressure$group <- factor(sample(letters[1:3], 19, replace = TRUE))

# construct an iid kernel over this
k1 <- iid('group')

# evaluate and visualise it
image(k1(pressure))

goldingn/gpe documentation built on May 17, 2019, 7:41 a.m.