Skip to contents

ngme2 pacakge description

ngme2-package ngme2
Inference and prediction for mixed effects models with flexible non-Gaussian and Gaussian distributions.

Fit the linear mixed effects model

ngme()
Fit an additive linear mixed effect model over replicates
summary(<ngme>)
Summary of ngme fit result
ngme_result()
Access the result of a ngme fitted model
ngme_cov_matrix()
variance of the data or the latent field
ngme_post_samples()
posterior samples of different latent models

Latent models

ngme_model_types()
Show ngme model types
f()
Specifying a latent process model (wrapper function for each model)
ar()
ngme AR(p) model specification
ar1()
ngme AR(1) model specification
arma()
ngme ARMA(p, q) model specification
arma11()
Convenience wrapper for ARMA(1,1)
matern()
ngme Matern SPDE model specification
rw1()
Random Walk Model of Order 1 (RW1)
rw2()
Random Walk Model of Order 2 (RW2)
ou()
Ornstein-Uhlenbeck Process Model
iid()
ngme iid model specification
tp()
ngme tensor-product model specification
bv()
Ngme bivariate model specification
bv_matern()
Ngme bivariate model with Matern sub_models
compute_score_given_pred()
Compute the scores given the prediction
re()
ngme random effect model
spacetime()
Ngme space-time non-separable model specification
generic()
Generic precision matrix operator
generic_ns()
Non-stationary precision matrix operator with custom matrix combinations

ngme2 noises

ngme_noise() noise_normal() noise_nig() noise_gal() noise_skew_t() noise_t() noise_normal_nig()
ngme noise specification
ngme_noise_types()
Show ngme noise types
compare_noise_kld()
Compare noise objects using Kullback-Leibler divergence
print(<noise_kld_comparison>)
Print method for noise_kld_comparison

ngme2 optimization methods

sgd()
Vanilla SGD optimization
precond_sgd()
Preconditioner SGD optimization
momentum()
Momentum SGD optimization
adagrad()
AdaGrad SGD optimization
rmsprop()
Root Mean Square Propagation (RMSProp) SGD optimization
adam()
Adam SGD optimization
adamW()
AdamW SGD optimization
bfgs()
BFGS optimization
adaptive_gd()
Adaptive gradient descent From the paper: https://arxiv.org/pdf/1910.09529 The update rule for adaptive gradient descent is: $$\lambda_k = \min(\sqrt{1 + \theta_{k-1}} \lambda_{k-1}, \frac{||x_k - x_{k-1}||}{2 ||\nabla f(x_k) - \nabla f(x_{k-1})||} )$$ $$x_{k+1} = x_k - \lambda_k \nabla f(x_k)$$ $$\theta_k = \lambda_k / \lambda_{k-1}$$

Prediction and Cross validation

predict(<ngme>)
Predict function of ngme2 predict using ngme after estimation
cross_validation()
Compute the cross-validation for the ngme model Perform cross-validation for ngme model first into sub_groups (a list of target, and train data)

Data visualization

plot(<ngme_noise>)
Plot the density of one or more stationary noise objects
traceplot()
Trace plot of ngme fitting

Simulation functions

simulate(<ngme>)
Simulate from a ngme object (possibly with replicates)
simulate(<ngme_model>)
Simulate latent process with noise
simulate(<ngme_noise>)
Simulate ngme noise object

Auxiliary functions

ngme_update()
Update ngme2 to the latest stable version
ngme_optimizers()
List supported optimizers
get_data_from_formula()
Extracts design matrix from a formula and data.
compute_log_like()
Compute Gaussian log-likelihood
make_time_series_cv_index()
Create Time Series Cross-Validation Indices
precision_matrix_multivariate()
Compute the precision matrix for multivariate model
precision_matrix_multivariate_spde()
Compute the precision matrix for multivariate spde Matern model
compute_index_corr_from_map()
Helper function to compute the index_corr vector
mean_list()
taking mean over a list of nested lists
ngme_as_sparse()
Convert sparse matrix into sparse dgCMatrix
control_opt()
Generate control specifications for ngme() function.
control_ngme()
Generate control specifications for the ngme model
ngme_parse_formula()
Parse the formula for ngme function
ngme_ts_make_A()
Make observation matrix for time series
print(<ngme>)
Print an ngme model
print(<ngme_model>)
Print ngme model
print(<ngme_operator>)
Print ngme operator
print(<ngme_replicate>)
Print ngme object
print(<ngme_noise>)
Print ngme noise
print(<ngme_trajectories>)
Print method for ngme_trajectories
print(<parameter_distance>)
Print method for parameter_distance
get_parameter_distance()
Calculate parameter distance from true values
get_trace_trajectories()
Get trace trajectories from ngme fitting
plot(<parameter_distance>)
Plot method for parameter_distance
ngme_prior()
ngme prior specification
ngme_prior_types()
Show ngme priors
test_ngme()
Test ngme function
ngme_make_mesh_repls()
ngme make mesh for different replicates
merge_noise()
Merge 2 noise into 1 noise
merge_replicates()
Merge model of replicates into model of 1 replicate given train_idx and test_idx, the merged model contains all the information of train_idx from different replicates.
get_trajectories()
get the trajectories of parameters of the model
name2fun()
Convert transformation name to function
create_paired_cv_splits()
Create paired indices for bivariate cross-validation Ensures that paired observations (e.g., u_wind and v_wind at same location) are kept together in the same fold
openmp_test()
Test OpenMP availability and report the number of threads.

Distributions

dig() rig() pig() qig()
The Inverse-Gaussian (IG) Distribution
dnig() rnig() pnig() qnig()
The Normal Inverse-Gaussian (NIG) Distribution
digam() rigam() pigam() qigam()
The Inverse-Gamma (IGam) Distribution
dgig() rgig() pgig() qgig()
The Generalised Inverse-Gaussian (GIG) Distribution
dgal() rgal() pgal() qgal()
The Generalized Asymmetric Laplace (GAL) Distribution

Datasets

argo_float
Argo float dataset
cienaga
The swamp of Cienaga Grande in Santa Marta, Colombia
cienaga.border
The x y location of the border of the swamp of Cienaga Grande in Santa Marta, Colombia