Skip to contents

Mean specifications separate the deterministic part of the model from the covariance kernel. zero_mean() is zero everywhere and constant_mean() is a constant, fixed or with an estimated or marginalized value. For regression trends see linear_mean(), polynomial_mean(), and basis_mean().

Usage

zero_mean()

constant_mean(value = 0)

Arguments

value

A finite number that fixes the constant, or estimate_coefficients() or coefficient_prior() for a constant that is estimated from the data or has a prior (ordinary kriging).

Value

An object of class gaussianprocesses_mean.

Stability

Stable: from version 1.0.0 this interface changes incompatibly only in a major release, after a deprecation period. Results and options that concern an experimental model class, kernel, or argument follow that interface's tier. See gaussianprocesses-package for the policy.

Examples

zero_mean()
#> ZeroMean()
constant_mean(2.5)
#> ConstantMean(value=2.5)

evaluate_mean(constant_mean(2.5), 1:3)
#> [1] 2.5 2.5 2.5

# Estimate the constant instead.
x <- seq(0, 3, length.out = 15)
model <- fit_gp(x, 4 + sin(2 * x), rbf_kernel(), noise_variance = 0.01,
  mean = constant_mean(estimate_coefficients()))
coef(model)
#> intercept 
#>  3.942362