Package: ngme2 0.9.8

Xiaotian Jin

ngme2: Linear Latent Non-Gaussian Models with Flexible Distributions

Fits and analyzes linear latent non-Gaussian models for temporal, spatial, and space-time data. The package provides model components for autoregressive and Ornstein-Uhlenbeck processes, random walks, Matern fields based on stochastic partial differential equations, separable and non-separable space-time models, graph-based Matern models, bivariate type-G fields, and user-defined sparse operators. Latent fields and observation models can use Gaussian and non-Gaussian noise distributions, including normal inverse Gaussian, generalized asymmetric Laplace, and skew-t distributions. Functions are included for simulation, likelihood-based estimation, prediction, cross-validation, convergence diagnostics, stochastic gradient optimization, batch-means confidence intervals, and posterior-like sampling. The modeling framework is described in Bolin, Jin, Simas and Wallin (2026) "A Unified and Computationally Efficient Non-Gaussian Statistical Modeling Framework" <doi:10.48550/arXiv.2602.23987>.

Authors:David Bolin [aut, cph], Xiaotian Jin [aut, cre], Alexandre Simas [aut], Jonas Wallin [aut], Andrea V. Rocha [ctb], Timothy A. Davis [ctb, cph], Patrick R. Amestoy [ctb, cph], Iain S. Duff [ctb, cph], John K. Reid [ctb, cph], Yanqing Chen [ctb, cph], Sivasankaran Rajamanickam [ctb, cph], Stefan Larimore [ctb, cph], William W. Hager [ctb, cph], University of Florida [cph], Regents of the University of Minnesota [cph], Free Software Foundation, Inc. [cph], Makoto Matsumoto [ctb, cph], Takuji Nishimura [ctb, cph], Alexander Chemeris [ctb, cph]

ngme2_0.9.8.tar.gz
ngme2_0.9.8.zip(r-4.7)ngme2_0.9.8.zip(r-4.6)ngme2_0.9.8.zip(r-4.5)
ngme2_0.9.8.tgz(r-4.6-x86_64)ngme2_0.9.8.tgz(r-4.6-arm64)ngme2_0.9.8.tgz(r-4.5-x86_64)ngme2_0.9.8.tgz(r-4.5-arm64)
ngme2_0.9.8.tar.gz(r-4.7-arm64)ngme2_0.9.8.tar.gz(r-4.7-x86_64)ngme2_0.9.8.tar.gz(r-4.6-arm64)ngme2_0.9.8.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
ngme2/json (API)
NEWS

# Install 'ngme2' in R:
install.packages('ngme2', repos = c('https://davidbolin.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/davidbolin/ngme2/issues

Pkgdown/docs site:https://davidbolin.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
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

On CRAN:

Conda:

openblascppopenmp

6.47 score 7 stars 76 scripts 365 downloads 112 exports 44 dependencies

Last updated from:004649a204. Checks:8 WARNING, 4 ERROR, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING804
linux-devel-x86_64WARNING550
source / vignettesERROR1815
linux-release-arm64WARNING675
linux-release-x86_64WARNING532
macos-release-arm64WARNING359
macos-release-x86_64WARNING965
macos-oldrel-arm64WARNING384
macos-oldrel-x86_64WARNING860
windows-develERROR671
windows-releaseERROR678
windows-oldrelERROR673
wasm-releaseFAIL351

Exports:adagradadamadamWadaptive_gdarar1armaarma11batch_decaybatch_means_cibatch_means_estimatorbfgsbvbv_materncalibrate_inv_exp_lambdacalibrate_inv_exp_lambda_driven_nigcompare_noise_kldcompute_index_corr_from_mapcompute_log_likecompute_ngme_cicompute_ngme_CIcompute_ngme_sgld_samplescontrol_ngmecontrol_optcontrol_opt_batch_cicreate_paired_cv_splitscross_validationdgaldgigdigdigamdnigfgenericgeneric_nsget_data_from_formulaget_parameter_distanceget_trace_trajectoriesget_trajectoriesiidmake_time_series_cv_indexmaternmean_listmerge_noisemomentumname2funngmengme_as_sparsengme_batch_cingme_cov_matrixngme_make_mesh_replsngme_model_typesngme_noise_typesngme_optimizersngme_post_samplesngme_prior_typesngme_resultngme_sgld_cingme_sgld_samplesngme_ts_make_Angme_updatenoise_galnoise_gal_momentsnoise_momentsnoise_nignoise_nig_momentsnoise_normalnoise_normal_nignoise_skew_tnoise_topenmp_testoupgalpgigpigpigampnigpoly_decayposterior_plotprecision_matrix_multivariateprecision_matrix_multivariate_spdeprecond_sgdprior_half_cauchyprior_inv_expprior_inv_exponentialprior_noneprior_normalprior_pc_sdpriorsqgalqgigqigqigamqnigrergalrgigrigrigamrmsproprnigrw1rw2sgdsgldspacetimestepsize_controlstepsize_decaystepsize_scheduletptraceplotvar1

Dependencies:classclassIntclicpp11DBIdplyre1071farverfmeshergenericsggplot2gluegridExtragtableisobandKernSmoothlabelinglatticelifecyclemagrittrMASSMatrixpillarpkgconfigproxyR6RColorBrewerRcppRcppEigenrlangs2S7scalessfspsplancstibbletidyselectunitsutf8vctrsviridisLitewithrwk

Readme and manuals

Help Manual

Help pageTopics
AdaGrad SGD optimizationadagrad
Adam SGD optimizationadam
AdamW SGD optimizationadamW
Adaptive gradient descentadaptive_gd
ngme AR(p) model specificationar
ngme AR(1) model specificationar1
Argo float datasetargo_float
ngme ARMA(p, q) model specificationarma
Convenience wrapper for ARMA(1,1)arma11
Batch/checkpoint decay helperbatch_decay
Pooled Batch-Means Confidence Intervals from Multiple Chainsbatch_means_ci
Batch-Means Covariance Estimator for SGD Trajectoriesbatch_means_estimator
BFGS optimizationbfgs
Ngme bivariate model specificationbv
Ngme bivariate model with Matern sub_modelsbv_matern
Calibrate Inverse-Exponential Prior for NIG Driven Noisecalibrate_inv_exp_lambda calibrate_inv_exp_lambda_driven_nig
The swamp of Cienaga Grande in Santa Marta, Colombiacienaga
The x y location of the border of the swamp of Cienaga Grande in Santa Marta, Colombiacienaga.border
Compare noise objects using Kullback-Leibler divergencecompare_noise_kld
Helper function to compute the index_corr vectorcompute_index_corr_from_map
Compute Gaussian log-likelihoodcompute_log_like
Refit an Existing ngme Object with SGD and Compute Batch-Means CIcompute_ngme_CI compute_ngme_ci
Refit an Existing ngme Object with SGLD and Extract Samplescompute_ngme_sgld_samples
Compute the scores given the predictioncompute_score_given_pred
Generate control specifications for the ngme modelcontrol_ngme
Generate control specifications for 'ngme()' function.control_opt
Generate CI-focused control settings for batch-means inferencecontrol_opt_batch_ci
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 foldcreate_paired_cv_splits
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)cross_validation
Specifying a latent process model (wrapper function for each model)f
The Generalized Asymmetric Laplace (GAL) Distributiondgal gal pgal qgal rgal
Generic precision matrix operatorgeneric
Non-stationary precision matrix operator with custom matrix combinationsgeneric_ns
Extracts design matrix from a formula and data.get_data_from_formula
Calculate parameter distance from true valuesget_parameter_distance
Get trace trajectories from ngme fittingget_trace_trajectories
get the trajectories of parameters of the modelget_trajectories
The Generalised Inverse-Gaussian (GIG) Distributiondgig gig pgig qgig rgig
The Inverse-Gaussian (IG) Distributiondig ig pig qig rig
The Inverse-Gamma (IGam) Distributiondigam igam pigam qigam rigam
ngme iid model specificationiid
Create Time Series Cross-Validation Indicesmake_time_series_cv_index
ngme Matern SPDE model specificationmatern
taking mean over a list of nested listsmean_list
Merge 2 noise into 1 noisemerge_noise
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.merge_replicates
Momentum SGD optimizationmomentum
Convert transformation name to functionname2fun
Fit an additive linear mixed effect model over replicatesngme
Convert sparse matrix into sparse dgCMatrixngme_as_sparse
Batch-Means Confidence Intervals from an ngme Fitngme_batch_ci
variance of the data or the latent fieldngme_cov_matrix
ngme make mesh for different replicatesngme_make_mesh_repls
Show ngme model typesngme_model_types
ngme noise specificationngme_noise noise_gal noise_nig noise_normal noise_normal_nig noise_skew_t noise_t
Show ngme noise typesngme_noise_types
List supported optimizersngme_optimizers
Parse the formula for ngme functionngme_parse_formula
posterior samples of different latent modelsngme_post_samples
Show ngme priorsngme_prior_types
Access the result of a ngme fitted modelngme_result
Quantile Confidence Intervals from SGLD Samplesngme_sgld_ci
Extract Posterior-like Samples from Stored SGLD Trajectoriesngme_sgld_samples
Make observation matrix for time seriesngme_ts_make_A
Update ngme2 to the latest stable versionngme_update
The Normal Inverse-Gaussian (NIG) Distributiondnig nig pnig qnig rnig
Moments of stationary NIG and GAL noisenoise_gal_moments noise_moments noise_moments.ngme_noise noise_nig_moments
Test OpenMP availability and report the number of threads.openmp_test
Ornstein-Uhlenbeck Process Modelou
Plot the density of one or more stationary noise objectsplot.ngme_noise
Plot method for parameter_distanceplot.parameter_distance
Polynomial schedule helperpoly_decay
Plot Posterior Distributions from SGLD Samplesplot.ngme_sgld_ci posterior_plot
Compute the precision matrix for multivariate modelprecision_matrix_multivariate
Compute the precision matrix for multivariate spde Matern modelprecision_matrix_multivariate_spde
Preconditioner SGD optimizationprecond_sgd
Predict function of ngme2 predict using ngme after estimationpredict.ngme
Print an ngme modelprint.ngme
Print ngme modelprint.ngme_model
Print ngme noiseprint.ngme_noise
Print ngme operatorprint.ngme_operator
Print ngme objectprint.ngme_replicate
Print method for ngme_trajectoriesprint.ngme_trajectories
Print method for noise_kld_comparisonprint.noise_kld_comparison
Print method for parameter_distanceprint.parameter_distance
Prior Half-Cauchyprior_half_cauchy
Prior Inverse-Exponentialprior_inv_exp prior_inv_exponential
Prior Noneprior_none
Prior Normalprior_normal
Prior PC-SDprior_pc_sd
Prior Containerpriors
ngme random effect modelre
Root Mean Square Propagation (RMSProp) SGD optimizationrmsprop
Random Walk Model of Order 1 (RW1)rw1
Random Walk Model of Order 2 (RW2)rw2
Vanilla SGD optimizationsgd
Stochastic Gradient Langevin Dynamics (SGLD) optimizationsgld
Simulate from a ngme object (possibly with replicates)simulate.ngme
Simulate latent process with noisesimulate.ngme_model
Simulate ngme noise objectsimulate.ngme_noise
Ngme space-time non-separable model specificationspacetime
Unified stepsize controlstepsize_control
Stepsize decay schedulestepsize_decay
Stepsize schedulestepsize_schedule
Summary of ngme fit resultsummary.ngme
Summary for Batch-Means CI Resultssummary.ngme_batch_ci
ngme tensor-product model specificationtp
Trace plot of ngme fittingtraceplot
ngme VAR(1) bivariate model specification (Cayley re-parameterization)var1