The model for a point \(z=(z_1,...,z_d)\) is fitted using n sample points \(x_1, ..., x_n\)
$$ s(z) = \lambda_1*\Phi(||z-x_1||)+... +\lambda_n*\Phi(||z-x_n||) + c_0 + c_1*z_1 + ... + c_d*z_d $$
where \(\Phi(r)=\exp(-r^2/(2*\sigma^2))\) denotes the Gaussian radial basis function with width
\(\sigma\). The coefficients \(\lambda_1, ..., \lambda_n, c_0, c_1, ..., c_d\) are determined
by this training procedure.
This is for the default case squares==FALSE
. In case squares==TRUE
there are d additional pure square terms and the model is
$$ s_{sq}(z) = s(z) + c_{d+1}*z_1^2 + ... + c_{d+d}*z_d^2 $$
In case ptail==FALSE
the polynomial tail (all coefficients \(c_i\)) is omitted completely.
The linear equation system is solved via SVD inversion. Near-zero elements in the diagonal matrix \(D\) are set to zero in \(D^{-1}\). This makes rank-deficient systems numerically stable.
trainGaussRBF(
xp,
U,
ptail = TRUE,
squares = FALSE,
width,
RULE = "One",
widthFactor = 1,
rho = 0,
DEBUG2 = F
)
n points \(x_i\) of dimension d are arranged in (n x d) matrix xp
vector of length n, containing samples \(u(x_i)\) of the scalar function \(u\) to be fitted - or - (n x m) matrix, where each column 1,...,m contains one vector of samples \(u_j(x_i)\) for the m'th model, j=1,...,m
[TRUE] flag, see description
[FALSE] flag, see 'Description'
[-1] either a positive real value which is the constant width \(\sigma\) for all
Gaussians in all iterations, or -1. If -1, the appropriate width \(\sigma\) is
calculated anew in each iteration with one of the rules RULE
,
based on the distribution of data points xp
.
["One"] one out of ["One" | "Two" | "Three"], different rules for automatic
estimation of width \(\sigma\). Only relevant if width = -1
,
[1.0] additional constant factor applied to each width \(\sigma\)
[0.0] experimental: 0.0: interpolating, >0.0, approximating (spline-like) Gaussian RBFs
[FALSE] if TRUE, save M
and rhs
on return value
rbf.model
, an object of class RBFinter
, which is basically a list
with elements:
(n+d+1 x m) matrix holding in column m the coefficients for the m'th
model: \(\lambda_1, ..., \lambda_n, c_0, c_1, ..., c_d\).
In case squares==TRUE
it is an (n+2d+1 x m) matrix holding
additionally the coefficients \(c_{d+1}, ..., c_{d+d}\).
matrix xp
size of the polynomial tail. If length(d)==0
it means no polynomial tail will be used for the model. In case of ptail==T && squares==F d will be dimension+1 and in case of ptail==T && squares==T d will be 2*dimension+1
number n of points \(x_i\)
TRUE or FALSE (see description)
TRUE or FALSE (see description)
the calculated width \(\sigma\)
"GAUSS"