Commit d76bb321 authored by Chris Jewell's avatar Chris Jewell
Browse files

Merge branch 'fix-rt-discretisation-error' into 'master'

Change to Rt calculation to fix discretisation error

See merge request !38
parents 62f9ec37 35f04b91
......@@ -250,15 +250,17 @@ def next_generation_matrix_fn(covar_data, param):
beta = tf.math.exp(xi)
ngm = beta * (
tf.eye(Cstar.shape[0], dtype=state.dtype)
+ param["beta2"] * commute_volume * Cstar / N[tf.newaxis, :]
)
ngm = (
ngm
* state[..., 0][..., tf.newaxis]
/ (N[:, tf.newaxis] * tf.math.exp(param["gamma0"]))
beta
* (
tf.eye(Cstar.shape[0], dtype=state.dtype)
+ param["beta2"] * commute_volume * Cstar / N[tf.newaxis, :]
)
/ N[:, tf.newaxis]
)
ngm = (1.0 - tf.math.exp(-ngm)) * state[..., 0][..., tf.newaxis]
ngm = ngm / (1 - tf.math.exp(-tf.math.exp(param["gamma0"])))
return ngm
return fn
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment