Description Usage Arguments Details Value Examples
Estimates the precision matrix from basis graphical lasso model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
kfolds |
Number of cross validation folds. |
y |
Real-valued data matrix of dimension (number of spatial locations) x (number of realizations). |
locs |
Matrix of real-valued spatial locations of data of dimension (number of spatial locations) x 2. |
lambdalist |
Penalty parameter. Can be either a nonnegative real, or a matrix of nonnegative reals whose dimension is the same as the number of graph nodes. |
zero.diagonal.penalty |
Boolean, if TRUE with a scalar penalty |
basis |
Character string for type of basis desired, currently only supports LatticeKrig-type basis. |
Phi |
Basis matrix, if not specified in |
guess |
An initial guess at the precision matrix. Default of |
outer_tol |
Tolerance. Default: see |
MAX_ITER |
Maximum number of iterations. Default: see |
MAX_RUNTIME_SECONDS |
Maximum runtime in seconds. Default: see |
tau_sq |
Nugget variance, estimated by |
verbose |
Print algorithm details after each iteration. Default: TRUE. |
distance.penalty |
If using LatticeKrig Wendland basis functions and a constant lambda, then multiply the distance matrix of the basis centers times lambda for the penalty matrix, Default: FALSE. |
final.guess |
Return the final estimate with the best penalty parameter, Default: TRUE. |
... |
Other options relevant for basis specification such as NC and nlevel for LatticeKrig-type bases. |
This is the algorithm suggested in the paper. It uses the QUIC
algorithm to solve the penalized likelihood problem for each fold, training the model based on "training data" and evaluating fit based on the likelihood with the "testing data". Note that in the paper, the value λ=7 is reported, which should be consistent with R < version 3.6. With the most recent R version 4.0, the seed is different and λ=8 is selected.
Precision matrix of the random coefficients in the weighted sum of basis functions.
1 2 3 | #the full search space considered, commented for runtime, will take very long
#CVguess <- BGL_CV(kfolds=2, y=tmin$data, locs=tmin$lon.lat.proj, lambdalist=1:30, basis="LatticeKrig",
#outer_tol=0.05, MAX_ITER=50, MAX_RUNTIME_SECONDS=86400, NC=30, nlevel=1,distance.penalty=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.