Description Usage Arguments Value Notes See Also
gp_sim
returns one or more data vectors drawn from a Gaussian Process.
1 2 |
theta |
(vector) parameters for covariance function the first element is the mean value mu |
acv.model |
(name) name of the function to compute ACV(tau | theta) |
dat |
(matrix) an N * 3 matrix of data: 3 columns |
t.star |
(vector) times at which to compute the simulation(s). |
N.sim |
(integer) number of random vectors to draw. |
plot |
(logical) add lines to an existing plot showing the results. |
An n * N.sim
matrix, each column is a simulation, a pseudo-random
n
-length vector drawn from the Gaussian Process.
Simulate random realisations of a Gaussian Process (GP) with
covariance defined by parameters theta
, at times t.star
.
This is essentially eqn 2.22 of Rasmussen & Williams (2006):
y.sim ~ N(mean = y.star, cov = C)
Uses the function rmvnorm
from the mvtnorm
package to
generate n
-dimensional Gaussian vectors.
If dat
is supplied (a data frame/list containing t
and
y
) then the conditional mean values at times t.star
,
y[t.star]
and covariance matrix C
for lags tau[i,j] =
|t.star[j] - t.star[i]|
are generated by the gp_conditional
function. See gp_logLikelihood
for more about the input data form.
If dat
is not supplied we sample from the 'prior' GP, i.e. assume
mean = theta[1]
and covariance matrix given by acv.model
and
theta
parameters.
This function essentially just computes a covariance matrix given an
autocovariance function (and its parameters), which may be conditional
on some data, and uses this to draw a random Gaussian vector with
rmvnorm
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.