Skip to contents

Two processes: one for the mean, one for the LOG noise variance, so the noise level is itself a smooth function of the input and cannot go negative. The alternation is the deterministic analogue of the paper's sampler: fit the mean GP under the current noise, form the log squared residuals, smooth them with the second GP, exponentiate, refit. Zero iterations leaves the plain homoscedastic GP exactly.

Usage

Gphtr(
  X,
  y,
  X_test = NULL,
  lengthscale = 1,
  variance = 1,
  noise0 = 0.1,
  noise_lengthscale = 1,
  iters = 3,
  floor = 1e-06
)

Arguments

X

Training inputs.

y

Training responses.

X_test

Test inputs; the training inputs by default.

lengthscale, variance

Mean-process hyperparameters.

noise0

Starting noise variance.

noise_lengthscale

Lengthscale of the log-variance process.

iters

Alternations; zero gives the homoscedastic GP.

floor

Lower bound on a squared residual before its logarithm.

Value

List with estimate, mean, variance, noise, noise_test, loglik, n, method.

Details

Formula: y(x) = f(x) + eps(x), f ~ GP, log var(eps(x)) ~ GP.

References

Goldberg, Williams and Bishop (1998), Regression with input-dependent noise: a Gaussian process treatment, NIPS 10.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Gphtr(V, V)
#> $estimate
#> [1] 0.9999997
#> 
#> $mean
#> [1] 0.9999997 1.9999987 2.9999988 3.9999863 4.9999615 5.9996741 7.0000221
#> [8] 7.7881334
#> 
#> $variance
#> [1] 1.711233e-06 1.171769e-06 1.678085e-06 5.860203e-06 4.807558e-05
#> [6] 7.562480e-05 1.247672e-04 2.743539e-02
#> 
#> $noise
#> [1] 1.711239e-06 1.171774e-06 1.678098e-06 5.860374e-06 4.808708e-05
#> [6] 7.565129e-05 1.248248e-04 2.901199e-02
#> 
#> $noise_test
#> [1] 2.505620e-06 1.551685e-06 2.210735e-06 7.558225e-06 3.970447e-05
#> [6] 5.676765e-05 2.438285e-04 5.352347e-03
#> 
#> $loglik
#> [1] -55.65461
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "alternating mean GP and log-variance GP, Goldberg, Williams & Bishop (1998)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"