Package: genscore 1.0.2

genscore: Generalized Score Matching Estimators

Implementation of the Generalized Score Matching estimator in Yu et al. (2019) <http://jmlr.org/papers/v20/18-278.html> for non-negative graphical models (truncated Gaussian, exponential square-root, gamma, a-b models) and univariate truncated Gaussian distributions. Also includes the original estimator for untruncated Gaussian graphical models from Lin et al. (2016) <doi:10.1214/16-EJS1126>, with the addition of a diagonal multiplier.

Authors:Shiqing Yu, Lina Lin, Wally Gilks

genscore_1.0.2.tar.gz
genscore_1.0.2.zip(r-4.5)genscore_1.0.2.zip(r-4.4)genscore_1.0.2.zip(r-4.3)
genscore_1.0.2.tgz(r-4.4-x86_64)genscore_1.0.2.tgz(r-4.4-arm64)genscore_1.0.2.tgz(r-4.3-x86_64)genscore_1.0.2.tgz(r-4.3-arm64)
genscore_1.0.2.tar.gz(r-4.5-noble)genscore_1.0.2.tar.gz(r-4.4-noble)
genscore_1.0.2.tgz(r-4.4-emscripten)genscore_1.0.2.tgz(r-4.3-emscripten)
genscore.pdf |genscore.html
genscore/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/sqyu/genscore/issues

On CRAN:

density-estimationgraphical-modelsinteraction-modelsscore-matchingundirected-graphs

69 exports 1 stars 1.02 score 17 dependencies 1 dependents 3 scripts 237 downloads

Last updated 4 years agofrom:0388c38465. Checks:OK: 4 WARNING: 5. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 07 2024
R-4.5-win-x86_64WARNINGSep 07 2024
R-4.5-linux-x86_64WARNINGSep 07 2024
R-4.4-win-x86_64WARNINGSep 07 2024
R-4.4-mac-x86_64WARNINGSep 07 2024
R-4.4-mac-aarch64WARNINGSep 07 2024
R-4.3-win-x86_64OKSep 07 2024
R-4.3-mac-x86_64OKSep 07 2024
R-4.3-mac-aarch64OKSep 07 2024

Exports:AUCavgrocsbeautify_rulebinarySearch_bincalc_critcheck_endpointscompare_two_resultscompare_two_sub_resultscov_conscrbound_mucrbound_sigmadomain_for_CeBICestimatefind_max_indfrac_powgcdgenget_crit_nopenaltyget_distget_eltsget_elts_abget_elts_expget_elts_gammaget_elts_gaussget_elts_loglogget_elts_loglog_simplexget_elts_trun_gaussget_g0get_g0_adaget_h_hpget_h_hp_adaptiveget_h_hp_vectorget_postfix_ruleget_resultsget_safe_log_h_hpget_trunh_of_distin_boundinterval_intersectioninterval_unionlambda_maxmake_domainmake_foldsmakecoprimemu_sigmasqhatnaiveSearch_binparse_abparse_ineqran_matrandom_init_polynomialrandom_init_simplexrandom_init_uniformread_exponentread_exponentialread_one_termread_uniform_termrefitrexp_truncatedrlaplace_truncatedrlaplace_truncated_centereds_ats_outputsearch_bintest_lambda_boundstest_lambda_bounds2tp_fpupdate_finite_infinity_for_uniformvarhat

Dependencies:cligluegmmlatticelifecyclemagrittrMatrixmvtnormrbibutilsRdpackrlangsandwichstringistringrtmvtnormvctrszoo

Generalized Score Matching on Generalized Domain Types

Rendered fromgen_vignette.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-04-24
Started: 2019-08-05

Readme and manuals

Help Manual

Help pageTopics
Calculates the AUC of an ROC curve.AUC
Takes the vertical average of ROC curves.avgrocs
Replaces consecutive "&"s and "|"s in a string to a single & and |.beautify_rule
Finds the index of the bin a number belongs to using binary search.binarySearch_bin
Calculates penalized or unpenalized loss in K and eta given arbitrary datacalc_crit
Checks if two equally sized numeric vectors satisfy the requirements for being left and right endpoints of a domain defined as a union of intervals.check_endpoints
Compares two lists returned from estimate().compare_two_results
Compares two lists returned from get_results().compare_two_sub_results
Random generator of inverse covariance matrices.cov_cons
The Cram\'er-Rao lower bound (times 'n') for estimating the mean parameter from a univariate truncated normal sample with known variance parameter.crbound_mu
The Cram\'er-Rao lower bound (times 'n') for estimating the variance parameter from a univariate truncated normal sample with known mean parameter.crbound_sigma
Computes the sum of absolute differences between two lists.diff_lists
Computes the sum of absolute differences in the finite non-NA/NULL elements between two vectors.diff_vecs
Returns a list to be passed to C that represents the domain.domain_for_C
eBIC score with or without refitting.eBIC
The main function for the generalized score-matching estimator for graphical models.estimate
Finds the max index in a vector that does not exceed a target number.find_max_ind
Evaluate x^(a/b) and |x|^(a/b) with integer a and b with extension to conventional operations.frac_pow
Finds the greatest (positive) common divisor of two integers.gcd
Random data generator from general 'a'-'b' distributions with general domain types, assuming a and b are rational numbers.gen
Minimized loss for unpenalized restricted asymmetric models.get_crit_nopenalty
Finds the distance of each element in a matrix x to the its boundary of the domain while fixing the others in the same row.get_dist
The function wrapper to get the elements necessary for calculations for all settings.get_elts
The R implementation to get the elements necessary for calculations for general a and b.get_elts_ab
The R implementation to get the elements necessary for calculations for the exponential square-root setting (a=0.5, b=0.5).get_elts_exp
The R implementation to get the elements necessary for calculations for the gamma setting (a=0.5, b=0).get_elts_gamma
The R implementation to get the elements necessary for calculations for the gaussian setting on R^p.get_elts_gauss
The R implementation to get the elements necessary for calculations for the log-log setting (a=0, b=0).get_elts_loglog
The R implementation to get the elements necessary for calculations for the log-log setting (a=0, b=0) on the p-simplex.get_elts_loglog_simplex
The R implementation to get the elements necessary for calculations for the gaussian setting (a=1, b=1) on domains other than R^p.get_elts_trun_gauss
Calculates the l2 distance to the boundary of the domain and its gradient for some domains.get_g0
Adaptively truncates the l2 distance to the boundary of the domain and its gradient for some domains.get_g0_ada
Generator of h and hp (derivative of h) functions.get_h_hp
Generator of adaptive h and hp (derivative of h) functions.get_h_hp_adaptive
Generator of h and hp (derivative of h) functions.get_h_hp_vector
Changes a logical expression in infix notation to postfix notation using the shunting-yard algorithm.get_postfix_rule
Estimate K and eta using elts from 'get_elts()' given one lambda_K (and lambda_eta if non-profiled non-centered) and applying warm-start with strong screening rules.get_results
Asymptotic log of 'h' and 'hp' functions for large 'x' for modes with an unbounded 'h'.get_safe_log_h_hp
The truncation point for 'h' for 'h' that is truncated (bounded but not naturally bounded).get_trun
Finds the distance of each element in a matrix x to the its boundary of the domain while fixing the others in the same row (dist(x, domain)), and calculates element-wise h(dist(x, domain)) and h\'(dist(x, domain)) (w.r.t. each element in x).h_of_dist
Returns whether a vector or each row of a matrix falls inside a domain.in_bound
Finds the intersection between two unions of intervals.interval_intersection
Finds the union between two unions of intervals.interval_union
Analytic solution for the minimum lambda_K that gives the empty graph.lambda_max
Creates a list of elements that defines the domain for a multivariate distribution.make_domain
Helper function for making fold IDs for cross validation.make_folds
Makes two integers coprime.makecoprime
Estimates the mu and sigma squared parameters from a univariate truncated normal sample.mu_sigmasqhat
Finds the index of the bin a number belongs to using naive search.naiveSearch_bin
Parses an ab setting into rational numbers a and b.parse_ab
Parses an ineq expression into a list of elements that represents the ineq.parse_ineq
Random generator of matrices with given eigenvalues.ran_mat
Randomly generate an initial point in the domain defined by a single polynomial with no negative coefficient.random_init_polynomial
Generates a random point in the (p-1)-simplex.random_init_simplex
Generates random numbers from a finite union of intervals.random_init_uniform
Parses the exponent part into power_numer and power_denom.read_exponent
Parses the integer coefficient in an exponential term.read_exponential
Parses the first term of a non-uniform expression.read_one_term
Attempts to parse a single term in x into power_numer and power_denom.read_uniform_term
Loss for a refitted (restricted) unpenalized modelrefit
Generates translated and truncated exponential variables.rexp_truncated
Generates laplace variables truncated to a finite union of intervals.rlaplace_truncated
Generates centered laplace variables with scale 1.rlaplace_truncated_centered
Returns the character at a position of a string.s_at
Helper function for outputting if verbose.s_output
Finds the index of the bin a number belongs to.search_bin
Searches for a tight bound for lambda_K that gives the empty or complete graph starting from a given lambda with a given step sizetest_lambda_bounds
Searches for a tight bound for lambda_K that gives the empty or complete graph starting from a given lambdatest_lambda_bounds2
Calculates the true and false positive rates given the estimated and true edges.tp_fp
Maximum between finite_infinity and 10 times the max abs value of finite elements in 'lefts' and 'rights'.update_finite_infinity_for_uniform
Asymptotic variance (times 'n') of the estimator for 'mu' or 'sigmasq' for the univariate normal on a general domain assuming the other parameter is known.varhat