Skip to content

Commit

Permalink
Add error_prop module with construct_pdf() function [iss #5]
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochun committed Jan 19, 2020
1 parent 31a7257 commit cf5acf7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Metallicity_Stack_Commons/error_prop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from chun_codes import random_pdf, compute_onesig_pdf

def construct_pdf(values, RMS, seed_i=1, n_iter=1000):
'''
Constructs probability distribution function (PDF) based on input
values and their associated uncertainty
:param values: list or numpy array of values/parameters
:param RMS: 1-sigma errors associated with values (same dimension)
:param seed_i: integer value for initial seed for np.random. Default: 1
:param n_iter: Number of iterations. Default: 1000
:return pdf_arr: numpy array of size (size of values, n_iter)
'''

pdf_arr = random_pdf(values, RMS, seed_i=seed_i, n_iter=n_iter, silent=False)

return pdf_arr

0 comments on commit cf5acf7

Please sign in to comment.