Library
Contents
Types
CoupledFields.InputSpace
— TypeInputSpace(X, Y, d, lat)
A type to hold the X
and Y
fields of the Input space. The fields are whitened if d=[d1, d2]
is supplied. Area weighting is applied if lat
is supplied.
CoupledFields.ModelObj
— TypeModelObj(W, R, A, T, evals, pars, method)
A type to hold statistical model results, such as the matrices W, R, A, T
, where R=XW
and T=YA
.
CoupledFields.KernelParameters
— TypeKernelParameters
An abstract type.
All KernelParameters types contain certain parameters which are later passed to internal functions Kf
and ∇Kf
.
A KernelParameters type is set using e.g. PolynomialKP(X::Matrix{Float64})
or GaussianKP(X::Matrix{Float64})
.
CoupledFields.GaussianKP
— TypeGaussianKP(X)
For the gaussian kernel.
CoupledFields.PolynomialKP
— TypePolynomialKP(X)
For the polynomial kernel.
Functions
CoupledFields.CVfn
— MethodCVfn(parm::Matrix, X::Matrix, Y::Matrix, modelfn::Function, kerneltype::DataType; verbose=true, dcv=2)
Cross-validation function
CoupledFields.Rsq_adj
— MethodRsq_adj(Tx::Array, Ty::Array, df::Int)
Cross-validation metric
CoupledFields.bf
— Methodbf(x::Vector, df::Int)
Compute a piecewise linear basis matrix for the vector x.
CoupledFields.cca
— Methodcca(v::Array, X::Matrix, Y::Matrix)
Regularized Canonical Correlation Analysis using SVD.
CoupledFields.gKCCA
— MethodgKCCA(par::Array, X::Matrix, Y::Matrix, kpars::KernelParameters)
Compute the projection matrices and components for gKCCA.
CoupledFields.gradient
— Functiongradient(Z::Array; axs::Tuple=axes(Z), smoothness=1.0)
Compute the gradient of field Z
. Use axs
to supply a tuple of point ranges for each dimension.
The method is based on the gradient function of a Gaussian kernel: smoothness
scales an auto-estimate of Gaussian σ, a large value will make the gradient function linear.
Z
can be any dimensions, but the method may be slow if length(Z)>10³
.
gradient(X::Matrix, Y::Matrix; smoothness=1.0)
Compute $∇g$ for $Y = g(X)$ where X
is the position values (rows = points), and Y
is the field values (e.g. a 1-column matrix). The points can have irregular positions. The method may be slow if size(X, 1)>10³
.
See Example 3
CoupledFields.gradvecfield
— Methodgradvecfield(par::Array, X::Matrix, Y::Matrix, kpars::KernelParameters)
Compute the gradient vector or gradient matrix at each instance of the X
and Y
fields, by making use of a kernel feature space.
CoupledFields.whiten
— Methodwhiten(X::Matrix, d::Float64; lat=nothing)
Whiten X
.
d
(0-1) Percentage variance of components to retain.
lat
Latitudinal area-weighting.