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

Allow for specified correlated parameters in _configdistro.py #103

Open
benmsanderson opened this issue Dec 13, 2022 · 0 comments
Open

Allow for specified correlated parameters in _configdistro.py #103

benmsanderson opened this issue Dec 13, 2022 · 0 comments

Comments

@benmsanderson
Copy link
Collaborator

benmsanderson commented Dec 13, 2022

Allow multiple parameters to be perfectly correlated in latin hypercube sampling.

possible approach - allow 'r' dimensions out of a total 'np' to be jointly sampled

in get_samples_from_distro_latin(self, numvalues), allow

np=len(self.ordering)
sampler = qmc.LatinHypercube(d=np-r)
samples_subspace = sampler.random(n=numvalues)

so samples_subspace is now a unit hypercube samping np-r dimensions

Now define parameter correlation matrix relating the hypercube to the dimensionality of the model:

e.g. if there are 5 parameters, parameters 1 and 2 are correlated, and parameters 4 and 5 are correlated:
cp=np.array([[1,1,0,0,0],[0,0,1,0,0],[0,0,0,1,1]])

constructing the full unit matrix as the dot product.
samples_unit=np.dot(samples_subspace,cp)

Need to think a bit more about how to generalise this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant