Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_distribution to SCAnalysisResults #337

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions easyvvuq/analysis/sc_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@
__license__ = "LGPL"


class SCDistribution():
def __init__(self):
pass

def pdf(self, x_data):
pass

def cdf(self, x_data):
pass

def fwd(self, x_data):
pass

def inv(self, q_data):
pass

def sample(self):
pass

def mom(self):
pass

def ttr(self, kloc):
pass


class SCAnalysisResults(AnalysisResults):
def _get_sobols_first(self, qoi, input_):
raw_dict = AnalysisResults._keys_to_tuples(self.raw_data['sobols_first'])
Expand All @@ -58,6 +84,22 @@ def _describe(self, qoi, statistic):
else:
raise NotImplementedError

def get_distribution(self, qoi):
"""Returns a distribution for the given qoi.

Parameters
----------
qoi: str
QoI name

Returns
-------
A ChaosPy PDF
"""
if qoi not in self.qois:
raise RuntimeError('no such quantity of interest - {}'.format(qoi))
return SCDistribution(self.raw_data)


class SCAnalysis(BaseAnalysisElement):

Expand Down