priors: Initialize prior for hyperparameter

priorsR Documentation

Initialize prior for hyperparameter

Description

Functions for initializing hyperparameter priors which can then be passed to gp_init. See section Details for the prior explanations.

Usage

prior_fixed()

prior_logunif()

prior_lognormal(loc = 0, scale = 1)

prior_half_t(df = 1, scale = 1)

Arguments

loc

Location parameter of the distribution

scale

Scale parameter of the distribution

df

Degrees of freedom

Details

The supported priors are:

prior_fixed

The hyperparameter is fixed to its initial value, and is not optimized by gp_optim.

prior_logunif

Improper uniform prior on the log of the parameter.

prior_lognormal

Log-normal prior (Gaussian prior on the logarithm of the parameter).

prior_half_t

Half Student-t prior for a positive parameter.

Value

The hyperprior object.

References

Rasmussen, C. E. and Williams, C. K. I. (2006). Gaussian processes for machine learning. MIT Press.

Examples


# Quasi-periodic covariance function, with fixed period
cf1 <- cf_periodic(
  period = 5,
  prior_period = prior_fixed(),
  cf_base = cf_sexp(lscale = 2)
)
cf2 <- cf_sexp(lscale = 40)
cf <- cf1 * cf2
gp <- gp_init(cf)

# draw from the prior
set.seed(104930)
xt <- seq(-10, 10, len = 500)
plot(xt, gp_draw(gp, xt), type = "l")



gplite documentation built on Aug. 24, 2022, 9:07 a.m.