Skip to content

Commit

Permalink
add compute_ecdf
Browse files Browse the repository at this point in the history
  • Loading branch information
phydev committed Jun 3, 2022
1 parent 1300050 commit ddc9174
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/mice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import numpy as np
import matplotlib.pyplot as plt

def compute_ecdf(x):
"""
computes the empirical cumulative density function for x
:param x: column of observations
:return A: matrix with the empirical cumulative density function
"""
xc = np.sort(x)
yc = np.arange(1, len(xc)+1)/len(xc)

A = np.array([xc, yc]).T

return A

def gibbs_sampler(x, n_samples, plot=False):
"""
compute the empirical cumulative density function for the distribution x
Expand Down

0 comments on commit ddc9174

Please sign in to comment.