Message Boards Message Boards

0
|
2394 Views
|
8 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Calculating sensitivity indices of R0

Posted 1 year ago

I am currently working on a class project where I am supposed to analyze some results in few select papers. I want to calculate the sensitivity indices of the parameters with respect to the basic reproduction number (R0) using the formula *S(p)=(p/R0)(∂R0/∂p)** where p is a parameter and S(p) is the sensitivity index of p. I have already calculated the indices manually, but I am interested in learning how to automate the process using Wolfram. The formula for R0 and the parameter values are given below.

betas = 0.274,
alphaa = 0.4775,
alphau = 0.695,
mu = 0.062,
qi = 0.078,
gammaa = 0.29,
1/etai = 0.009,
1/etau = 0.05

R0 = (betas*alphaa)/(gammaa+mu) + (betas*alphau*gammaa*(1-qi))/((gammaa+mu)*(etau+mu))

The answers given in the paper are (βs, μ, γa, αa, ηu, αu, qi) = (1.000, − 0.6060, −0.18464, 0.22348, −0.34666, 0.77652, −0.06474). In fact, I am beginner to Wolfram. So, a comprehensive answer would be highly appreciated. Thanks a lot in advance!

Source: https://pubmed.ncbi.nlm.nih.gov/32834653/

POSTED BY: Mad Hew
8 Replies
Posted 1 year ago

I have also been struggling with replicating this graph from the same paper. Any support would be highly appreciated. The authors plot R0 against gammaa and betas.

betas = 0.274,
alphaa = 0.4775,
alphau = 0.695,
mu = 0.062,
qi = 0.078,
gammaa = 0.29,
etai = 0.009,
etau = 0.05

R0 = (betas*alphaa)/(gammaa+mu) + (betas*alphau*gammaa*(1-qi))/((gammaa+mu)*(etau+mu))

enter image description here

Source: https://pubmed.ncbi.nlm.nih.gov/32834653/

POSTED BY: Mad Hew

Quite a few more syntax errors in your code: separate operations are separated by semi-colons, not commas. And you can't do something like 1/etau = 0.05: you need etau = 1/0.05.

Here is a better way to do what you posted:

Clear["Global`*"]

parameters = {betas -> 0.274, mu -> 0.062, gammaa -> 0.29, 
   alphaa -> 0.4775, etau -> 1/0.05, alphau -> 0.695, qi -> 0.078, 
   etai -> 1/0.009};

baseR0 = (betas*alphaa)/(gammaa + mu) + (betas*alphau*
      gammaa*(1 - qi))/((gammaa + mu)*(etau + mu)) /. parameters

Now, assuming everything is correct, this does what you describe:

In[119]:= Table[
 oldParameter = parameters[[parameter, 2]];
 newParameter = oldParameter*1.001;
 deltaParameter = newParameter - oldParameter;
 newR0 = (betas*alphaa)/(gammaa + mu) + (betas*alphau*
       gammaa*(1 - qi))/((gammaa + mu)*(etau + mu)) /. 
   ReplacePart[parameters, {parameter, 2} -> newParameter];
 deltaR0 = newR0 - baseR0;
 {parameters[[parameter, 
    1]], (oldParameter/baseR0)*(deltaR0/deltaParameter)}, {parameter, 
  1, Length[parameters] - 1}]

Out[119]= {{betas, 1.}, {mu, -0.176164}, {gammaa, -0.804172}, {alphaa,
   0.980971}, {etau, -0.0189516}, {alphau, 
  0.0190293}, {qi, -0.00160985}}

As you see though, it doesn't give the same values you posted. So it's possible there is something wrong with either your formula for R0 value, or for the sensitivity.

POSTED BY: Gareth Russell
Posted 1 year ago

Hi Gareth, thanks a lot for taking the time to answer my question. It was so helpful and I really appreciate your support. Could you please help me understand the line "newParameter = oldParameter*1.001" in your code?

POSTED BY: Mad Hew

It's just a way to create a small (0.001) change in each parameter value.

POSTED BY: Gareth Russell

Hey, on a hunch I changed the parameters to etai = 0.009 and etau = 0.05 (instead of 1/those values), and then I get the same sensitivity values that you posted. So if that is right, the definitions of the parameters in the original post are incorrect. (Because if 1/etau = 0.05, then etau = 1/0.05).

POSTED BY: Gareth Russell
Posted 1 year ago

Hey, thanks a lot for the clarification. I see what you mean. I do sincerely appreciate your kind gesture.

POSTED BY: Mad Hew

Hi Mad,

The underscore character _ represents Blank, so it cannot be used in a symbol name. Try using valid symbol names.

POSTED BY: Rohit Namjoshi
Posted 1 year ago

Hi Rohit, I just removed the underscores. Thanks for that!

POSTED BY: Mad Hew
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract