Automating the derivation of sensitivity indices

조회 수: 2 (최근 30일)
Bas123
Bas123 2022년 12월 22일
댓글: Torsten 2022년 12월 30일
I am currently reviewing some papers on mathematical epidemiology and trying to replicate certain results on those papers. I want to calculate the sensitivity indices of model parameters (of the paper https://pubmed.ncbi.nlm.nih.gov/32834653/) with respect to the basic reproduction number using the formula where p is a parameter and is the sensitivity index of p. I have already calculated the indices manually, but I would like to know how to automate this process using MATLAB. The formula for and the parameter values are given below. The sensitivity index values given in the paper are . Thank you in advance!
beta_s = 0.274;
alpha_a = 0.4775;
alpha_u = 0.695;
mu = 0.062;
q_i = 0.078;
gamma_a = 0.29;
eta_i = 0.009;
eta_u = 0.05;
R0 = (beta_s*alpha_a)/(gamma_a+mu) + (beta_s*alpha_u*gamma_a*(1-q_i))/((gamma_a+mu)*(eta_u+mu))
  댓글 수: 1
Bas123
Bas123 2022년 12월 29일
Does anyone have any ideas on this question? Thanks!

댓글을 달려면 로그인하십시오.

답변 (1개)

Torsten
Torsten 2022년 12월 29일
편집: Torsten 2022년 12월 29일
You could use
syms beta_s alpha_a alpha_u mu q_i gamma_a eta_i eta_u
beta_s_num = 0.274;
alpha_a_num = 0.4775;
alpha_u_num = 0.695;
mu_num = 0.062;
q_i_num = 0.078;
gamma_a_num = 0.29;
eta_i_num = 0.009;
eta_u_num = 0.05;
R0 = (beta_s*alpha_a)/(gamma_a+mu) + (beta_s*alpha_u*gamma_a*(1-q_i))/((gamma_a+mu)*(eta_u+mu));
%S_beta_s as an example
dR0dbeta_s = diff(R0,beta_s)
dR0dbeta_s = 
S_beta_s = beta_s_num/subs(R0,[beta_s alpha_a alpha_u mu q_i gamma_a eta_i eta_u],[beta_s_num alpha_a_num alpha_u_num mu_num q_i_num gamma_a_num eta_i_num eta_u_num])*subs(dR0dbeta_s,[beta_s alpha_a alpha_u mu q_i gamma_a eta_i eta_u],[beta_s_num alpha_a_num alpha_u_num mu_num q_i_num gamma_a_num eta_i_num eta_u_num])
S_beta_s = 
1
  댓글 수: 6
Bas123
Bas123 2022년 12월 30일
Hey, thank you! Here is the Mathematica code that I used.
f[betas_, alphaa_, alphau_, mu_, qi_, gammaa_, etau_] := (betas*alphaa)/(gammaa+mu) + (betas*alphau*gammaa*(1-qi))/((gammaa+mu)*(etau+mu))
R0 = f[0.274, 0.4775, 0.695, 0.062, 0.078, 0.29, 0.05]
Sbetas = (betas/R0)*D[f[betas, alphaa, alphau, mu, qi, gammaa, etau], betas]
SbetasValue = Sbetas/.{betas->0.274, alphaa->0.4775, alphau->0.695, mu->0.062, qi->0.078, gammaa->0.29, etau->0.05}
Torsten
Torsten 2022년 12월 30일
I don't see a difference between MATLAB and MATHEMATICA code.
If the results are different, I'd compare intermediate results, e.g. R0 and dR0dbeta_s, in both programs.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Earth and Planetary Science에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by