Description Details Super class Public fields Methods
A linear mean.
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.
gpmss::MeanFunction
-> MeanLinear
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?
mean()
Compute function prior mean
MeanLinear$mean(X, hypers = NULL)
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.
parameter_derivative()
Compute partial derivatives of mean function with respect to its hyperparameters
MeanLinear$parameter_derivative(X, hypers = NULL, param = 1)
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
input_derivative()
Compute partial derivatives of mean function with respect to its inputs
MeanLinear$input_derivative(X, hypers = NULL, dimension = 1)
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
new()
Create a new MeanLinear object
MeanLinear$new(hypers = 0, intercept = TRUE)
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.
clone()
The objects of this class are cloneable with this method.
MeanLinear$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.