MeanLinear: Linear Mean Function

Description Details Super class Public fields Methods

Description

A linear mean.

Details

This function gives a linear mean; denoting its hyper vector by (α, β), where α is an (optional) intercept, and β is a vector of coefficients whose length is the same as the number of columns in X, then for an input matrix X, the prior mean is α + X β.

Note: Usually in regression models we would instead use the notation X β, where the first element of β is a coefficient for the intercept and X has a column of ones prepended to it. The reason we do not do this in GP regression and classification is because adding a one column to the design matrix is generally not desirable in terms of the inputs to the kernel, and is not generally helpful for other mean functions as well. So, we simply address the intercept issue by adding a hyperparameter to a linear mean function that is not involved with any multiplication with predictors.

Super class

gpmss::MeanFunction -> MeanLinear

Public fields

name

A character vector of length one giving the mean function's name; "linear"

hypers

A numeric vector giving the mean function's hyperparameters

intercept

A logical vector of length one; does the linear mean include an intercept?

Methods

Public methods

Inherited methods

Method mean()

Compute function prior mean

Usage
MeanLinear$mean(X, hypers = NULL)
Arguments
X

The input values (should be a numeric matrix)

hypers

A numeric vector giving hyperparameters for the mean function. If NULL (the default), the hypers data member is used.


Method parameter_derivative()

Compute partial derivatives of mean function with respect to its hyperparameters

Usage
MeanLinear$parameter_derivative(X, hypers = NULL, param = 1)
Arguments
X

The input values (should be a numeric matrix)

hypers

A numeric vector giving hyperparameters for the mean function. If NULL (the default), the hypers data member is used.

param

An integer vector of length one; which element of hypers should the derivative be taken with respect to? The default is 1


Method input_derivative()

Compute partial derivatives of mean function with respect to its inputs

Usage
MeanLinear$input_derivative(X, hypers = NULL, dimension = 1)
Arguments
X

The input values (should be a numeric matrix)

hypers

A numeric vector giving hyperparameters for the mean function. If NULL (the default), the hypers data member is used.

dimension

an integer vector of length one giving the dimension of X with respect to which the derivative is being taken; the default is 1


Method new()

Create a new MeanLinear object

Usage
MeanLinear$new(hypers = 0, intercept = TRUE)
Arguments
hypers

A numeric vector giving hyperparameters for the mean function. If the provided hypers are of length one, it will be recycled as necessary to match the number of columns of X when used.

intercept

A logical vector of length one; should the linear mean include an intercept? The default is TRUE.


Method clone()

The objects of this class are cloneable with this method.

Usage
MeanLinear$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


duckmayr/gpmss documentation built on Nov. 8, 2021, 5:48 a.m.