BGLBasisSetup: Basis Graphical Lasso Basis Setup

Description Usage Arguments Details Value Examples

View source: R/BGLBasisSetup.R

Description

Sets up basis quadratic forms used in the basis graphical lasso QUIC algorithm.

Usage

1
2
3
4
5
6
7
8
9
BGLBasisSetup(
  y,
  locs,
  basis = "LatticeKrig",
  Phi = NULL,
  crossvalidation = FALSE,
  distance.penalty = FALSE,
  ...
)

Arguments

y

Real-valued data matrix of dimension (number of spatial locations) x (number of realizations); must have at least two realizations.

locs

Matrix of real-valued spatial locations of data of dimension (number of spatial locations) x 2.

basis

Character string for type of basis desired, currently only supports LatticeKrig-type basis.

Phi

Basis matrix with rows indexing spatial locations and columns indexing basis functions. If not provided, then Phi is generated from the basis argument. If provided, this calculates the corresponding matrix products.

crossvalidation

T/F depending upon whether cross validation is intended; slightly changes what is output.

distance.penalty

T/F will return the locations of the basis centers of the LatticeKrig basis. Then, an example penalty matrix is rdist(basiscenters).

...

Other options relevant for basis specification such as NC and nlevel for LatticeKrig-type bases.

Details

Sets up basis inner product matrices that are used in the basis graphical lasso QUIC algorithm. The first is the inner product of basis matrices, Φ'Φ. Computed as crossprod(Phi), where Phi has n rows corresponding to locations and l columns corresponding to the basis functions evaluated at those locations. Second is inner product of the basis matrices and data, Φ'SΦ or Φ'Y where Y is the data matrix with rows indexing spatial locations. This is where the data directly enters the algorithm. If cross validation is desired, only Φ'Y is computed and subsequently appropriate columns are used in the cross validation scheme. If distance.penalty=TRUE then we return the basis centers of the LatticeKrig model for use in the penalty matrix.

Value

A list of two matrices Φ'Φ and Φ'SΦ. Also returns the trace of the sample covariance (for nugget estimation). If cross validation is intended, Φ' Y is returned instead of Φ' S Φ. If

Examples

1
2
basis.setup <- BGLBasisSetup(y=tmin$data, locs=tmin$lon.lat.proj, nlevel=1, NC=20)
names(basis.setup)

mlkrock/BasisGraphicalLasso documentation built on Dec. 21, 2021, 7:59 p.m.