# doc-cache created by Octave 6.4.0
# name: cache
# type: cell
# rows: 3
# columns: 5
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
stk_cholcov


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 747
 STK_CHOLCOV  [STK internal]

 CALL: C = stk_cholcov (A, ...)

    returns the result of chol (A, ...) when this succeeds. If chol fails,
    then a small amount of "regularization noise" is added to the diagonal
    of A, in order to make chol succeed (see the code for details).

 NOTE: why this function ?

    This is a first (rough) attempt at solving numerical problems that
    arise when chol is used with a covariance matrix that is semi-positive
    definite, or positive definite with some very small eigenvalues. See
    tickets #3, #4 and #13 on Sourceforge:

       https://sourceforge.net/p/kriging/tickets/3/
       https://sourceforge.net/p/kriging/tickets/4/
       https://sourceforge.net/p/kriging/tickets/13/

 See also: chol



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
 STK_CHOLCOV  [STK internal]



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
stk_make_matcov


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 934
 STK_MAKE_MATCOV computes a covariance matrix (and a design matrix)

 CALL: [K, P] = stk_make_matcov (MODEL, X0)

    computes the covariance matrix K and the design matrix P for the model
    MODEL at the set of points X0, which is expected to be an N x DIM
    array. As a result, a matrix K of size N x N and a matrix P of size
    N x L are obtained, where L is the number of regression functions in
    the linear part of the model.

 CALL: K = stk_make_matcov (MODEL, X0, X1)

    computes the covariance matrix K for the model MODEL between the sets
    of points X0 and X1. The resulting K matrix is of size N0 x N1, where
    N0 is the number of rows of XO and N1 the number of rows of X1.

 BE CAREFUL:

    stk_make_matcov (MODEL, X0) and stk_makematcov (MODEL, X0, X0) are NOT
    equivalent if model.lognoisevariance > - inf  (in the first case, the
    noise variance is added on the diagonal of the covariance matrix).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
 STK_MAKE_MATCOV computes a covariance matrix (and a design matrix)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
stk_model_update


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
 STK_MODEL_UPDATE updates a model with new data

 CALL: M_POSTERIOR = stk_model_update (M_PRIOR, X, Y)

    updates model M_PRIOR with additional data (X, Y).  The result is an
    stk_model_gpposterior object.

 See also: stk_model_gpposterior



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
 STK_MODEL_UPDATE updates a model with new data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
stk_predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1705
 STK_PREDICT performs a kriging prediction from data

 CALL: ZP = stk_predict (MODEL, XI, ZI, XP)

    performs a kriging prediction at the points XP, given the observations
    (XI, ZI) and the prior MODEL. The input arguments XI, ZI, and XP can be
    either numerical matrices or dataframes. More precisely, on a factor space
    of dimension DIM,

     * XI must have size NI x DIM,
     * ZI must have size NI x 1,
     * XP must have size NP x DIM,

    where NI is the number of observations and NP the number of prediction
    points. The output ZP is a dataframe of size NP x 2, with:

     * the kriging predictor in the first column (ZP.mean), and
     * the kriging variance in the second column (ZP.var).

    From a Bayesian point of view, ZP.mean and ZP.var are respectively the
    posterior mean and variance of the Gaussian process prior MODEL given the
    data (XI, ZI).  Note that, in the case of noisy data, ZP.var is the
    (posterior) variance of the latent Gaussian process, not the variance of a
    future noisy observation at location XP.

 CALL: [ZP, LAMBDA, MU] = stk_predict (MODEL, XI, ZI, XP)

    also returns the matrix of kriging weights LAMBDA and the matrix of
    Lagrange multipliers MU.

 CALL: [ZP, LAMBDA, MU, K] = stk_predict (MODEL, XI, ZI, XP)

    also returns the posterior covariance matrix K at the locations XP (this is
    an NP x NP covariance matrix). From a frequentist point of view, K can be
    seen as the covariance matrix of the prediction errors.

 SPECIAL CASE

    If ZI is empty, everything but ZP.mean is computed. Indeed, neither the
    kriging variance ZP.var nor the matrices LAMBDA and MU actually depend on
    the observed values.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
 STK_PREDICT performs a kriging prediction from data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
stk_predict_leaveoneout


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1367
 STK_PREDICT_LEAVEONEOUT computes LOO predictions and residuals

 CALL: LOO_PRED = stk_predict_leaveoneout (M_PRIOR, XI, ZI)

    computes LOO predictions for (XI, ZI) using the prior model M_PRIOR.  The
    result is a dataframe with n rows and two columns, where n is the common
    number of rows of XI and ZI.  The first column is named 'mean' and contains
    LOO prediction means.  The second column is named 'var' and contains LOO
    prediction variances.

 CALL: [LOO_PRED, LOO_RES] = stk_predict_leaveoneout (M_PRIOR, XI, ZI)

    also returns LOO residuals.  The result LOO_RES is a dataframe with n rows
    and two columns.  The first column is named 'residuals' and contains raw
    (i.e., unnormalized) residuals.  The second column is named 'norm_res' and
    contains normalized residuals.

 CALL: [LOO_PRED, LOO_RES] = stk_predict_leaveoneout (M_POST)

    does the same as above using a posterior model object M_POST directly.

 CALL: stk_predict_leaveoneout (...)

    automatically produces LOO cross-validations plots in the current figure,
    using stk_plot_predvsobs (left panel) and stk_plot_histnormres (right
    panel).

 REMARK

    This function actually computes pseudo-LOO prediction and residuals,
    where the same parameter vector is used for all data points.

 See also stk_example_kb10, stk_plot_predvsobs, stk_plot_histnormres



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
 STK_PREDICT_LEAVEONEOUT computes LOO predictions and residuals





