latentmi.ksg ============ .. py:module:: latentmi.ksg Functions --------- .. autoapisummary:: latentmi.ksg.add_noise latentmi.ksg.query_neighbors latentmi.ksg.count_neighbors latentmi.ksg.avgdigamma latentmi.ksg.build_tree latentmi.ksg.lnc_correction latentmi.ksg.entropy latentmi.ksg.mi latentmi.ksg.entropyd latentmi.ksg.centropyd latentmi.ksg.midd latentmi.ksg.out_of_sample_avgdigamma latentmi.ksg.out_of_sample_pmi Module Contents --------------- .. py:function:: add_noise(x, intens=1e-10) .. py:function:: query_neighbors(tree, x, k) .. py:function:: count_neighbors(tree, x, r) .. py:function:: avgdigamma(points, dvec) tweaked this to return list of psi(nx) for pointwise estimate .. py:function:: build_tree(points) .. py:function:: lnc_correction(tree, points, k, alpha) in my experience this doesn't work in practice for N_dims > 1 .. py:function:: entropy(x, k=3, base=2) The classic K-L k-nearest neighbor continuous entropy estimator x should be a list of vectors, e.g. x = [[1.3], [3.7], [5.1], [2.4]] if x is a one-dimensional scalar and we have four samples .. py:function:: mi(x, y, z=None, k=3, base=2, alpha=0) Mutual information of x and y (conditioned on z if z is not None) x, y should be a list of vectors, e.g. x = [[1.3], [3.7], [5.1], [2.4]] if x is a one-dimensional scalar and we have four samples .. py:function:: entropyd(sx, base=2) Discrete entropy estimator sx is a list of samples .. py:function:: centropyd(x, y, base=2) The classic K-L k-nearest neighbor continuous entropy estimator for the entropy of X conditioned on Y. .. py:function:: midd(x, y, base=2) Discrete mutual information estimator Given a list of samples which can be any hashable object .. py:function:: out_of_sample_avgdigamma(obs_points, est_points, dvec) here we compute psi(nx) for query points that are not necessarily part of observed samples :param obs_points: :param est_points: :param dvec: .. py:function:: out_of_sample_pmi(obs_x, obs_y, est_x, est_y, k=3, base=2)