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

For more than 3 variants, rate update is incorrect #123

Open
sangeetabhatia03 opened this issue Jun 15, 2021 · 1 comment
Open

For more than 3 variants, rate update is incorrect #123

sangeetabhatia03 opened this issue Jun 15, 2021 · 1 comment

Comments

@sangeetabhatia03
Copy link
Collaborator

From Pierre,
rate <- lambda[t, , 1] +
apply(epsilon * lambda[t, , -1, drop = FALSE], c(1, 2), sum) + # something fishy here with the sum given epsilon can be >1Dim
1 / priors$R$scale

[11:32] Nouvellet, Pierre

I think this bit is problematic: apply(epsilon * lambda[t, , -1, drop = FALSE], c(1, 2), sum) as, say for 2 variants, we want to multiply each epsilon to lambda[t,,2] and then lambda[t,,3]

Pierre suggests that a quick fix would be to replace the line mentioned above by:
temp <- lambda[t, , 1]
for(i in 2:dim(incid)[3]){
temp <- temp + epsilon[i-1]*lambda[t, , i]
}
rate <- temp + 1 / priors$R$scale

@sangeetabhatia03
Copy link
Collaborator Author

sangeetabhatia03 commented Jun 15, 2021

I have implemented Pierre's suggestion and all tests pass OK. But I am not sure I fully understand. I think the previous implementation was achieving the right updates (epsilon_v * lambda^t_v for each t).
Branch fix_122, commit 72d26f6

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