-
Notifications
You must be signed in to change notification settings - Fork 87
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
Handling double dependencies in problem #357
Comments
Hi! Sorry for the delayed response. In chaospy handling of dependencies relies on the ability to create Rosenblatt transformation. In essense this means the dependencies has to be decomposable into In your case, having P(V | X,Y) and P(W | X,Y) is not feasable to decompose on its own. Your best bet, if you intend to go this way can be achieved in your case is to go through raw statistical moments. You need to create a function that outputs raw statistical moments for you variables. I.e. every i and j: Then make a custom (hack) distribution that produces these moments: class MyDist(cp.Distribution):
def __init__(self):
dependencies, parameters, rotation = cp.declare_dependencies(self, {}, length=2)
super().__init__(
dependencies=dependencies,
parameters=parameters,
rotation=rotation,
)
def get_mom_parameters(self):
return {}
def _mom(self, loc):
i, j = loc
# calculate mu_ij
return mu_ij This can then be used to create orthogonal polynomials using Cholesky:
For the sampling, you can always do:
Hope this helps. |
You might want to check out Isserlis' theorem on how to calculate the moments you need. |
Hi Jonathan, |
Hi Jonathan! |
Good for you. :) I think getting to specific with the dependent distribution doesn't make too much sense to merge. Fork sounds like a good way to go. I'll likely take a look if you go that route. |
Hi Jonathan! First off, thank you for creating this package, it has been very interesting to work with so far.
My question is with framing a dependency problem. The idea is that in experiment, we might analyse two variables, but these two variables might be dependent on two other variables.
Eg, analysing V and W such that:
V(x,y) and W(x,y)
x and y are independent in this case, and so, I can easily analyse their impact on some objective function. But I am interested in the behaviours of V and W.
I have tried to implement this as below. I think the issue I am having is that the implementation I have used works fine for the case when one variable is dependent on the other. That is: when the joint is assembled with x and V(x,y) - or some other like combination.
When I assemble the joint as below: cp.J( v, w ), I get the dependency error: "dangling dependencies".
I have tried to include three, cp.J( x, v, w ), in order to capture at least one of the initial dependencies (though I am sure this is not a good way to frame it), and it fails with errors for under-defined dependencies.
Implementation
Additional
I know that framing dependencies is not necessarily straightforward. I am simultaneously reading and learning in this area as I play around with your code - I am aware there could be understanding that I am lacking, and am still trying to build that understanding.
I am hoping you might be able to provide direction in how I would do so with your code.
Please let me know if I can provide any additional information, and thank you for your time. (:
The text was updated successfully, but these errors were encountered: