nugget_estimate: Nugget Estimate

Description Usage Arguments Details Value Examples

View source: R/nugget_estimate.R

Description

Estimates the nugget variance τ^2 under the simplified assumption that Q = α I. If not desired, user can initially pass tau_sq.

Usage

1
nugget_estimate(Phi_Phi, Phi_S_Phi, trS, n)

Arguments

Phi_Phi

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.

Phi_S_Phi

Inner product of the basis matrices and data, Φ'SΦ. This is where the data directly enters the algorithm. Note: do not compute sample covariance S explicitly. With dat as the n by m matrix with columns corresponding to realizations of the mean zero spatial field, we have S=XX'/m. So we can compute as Φ'SΦ as tcrossprod(crossprod(Phi, dat))/m.

trS

Trace of empirical covariance matrix.

n

Number of locations.

Details

Performs a joint optimization over α,τ^2 in the -2*negative log likelihood with respect to Q = α I and τ^2. Calls L-BFBS-B using optim.

Value

Estimate of the nugget variance.

Examples

1
2
3
4
5
6
basis.setup <- BGLBasisSetup(y=tmin$data,locs=tmin$lon.lat.proj,basis="LatticeKrig",
     crossvalidation=FALSE, NC=30,nlevel=1)
Phi_Phi <- basis.setup$Phi_Phi
Phi_S_Phi <- basis.setup$Phi_S_Phi
trS <- basis.setup$trS
tau_sq <- nugget_estimate(Phi_Phi,Phi_S_Phi,trS,n=dim(tmin$lon.lat)[1])

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