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

Question CREM-A #49

Closed
devetak-m opened this issue Dec 6, 2023 · 1 comment
Closed

Question CREM-A #49

devetak-m opened this issue Dec 6, 2023 · 1 comment

Comments

@devetak-m
Copy link

devetak-m commented Dec 6, 2023

Hello,

I am trying to implement CReM-A and I was checking your code. I think I am not understanding a small part in the sampling procedure. You implemented the sampling as:

q_ensemble = 1/(beta_i + beta_j) w_link = np.random.exponential(q_ensemble)

therefore you sample from a process with rate q_ensemble and mean 1/q_ensemble = beta_i + beta_j as far as I understand the documentation of numpy.random.exponential (https://numpy.org/doc/stable/reference/random/generated/numpy.random.exponential.html)

But in the paper, Equation III.14 you have that the weights are distributed according to an exponential distribution with rate beta_i + beta_j and mean 1/(beta_i + beta_j). Which makes sense since then the expected value of the row and column sumn match the observed value, equation III.18.

Is this correct?

And if so one could speed up the code by solving for 1/(beta_i + beta_j) directly by transforming it in a linear problem? I mean by solving a linear equation in terms of rates and not means.

@devetak-m
Copy link
Author

I just realized that I was looking at the equation and not at the actual implementation. I apologise.

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