-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error_prop module with construct_pdf() function [iss #5]
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |