Skip to main content
. 2021 Jan 18;18(2):774. doi: 10.3390/ijerph18020774
Algorithm A1 Adam based method for parameter optimization. Good default settings for the analyzed COVID-19 dataset are learning rate η=0.05, exponential decay rates b1=0.1 and b2=0.1, and γ=1×108. Algorithm tolerance tol=1×104. All operations are element-wise.
Initialization: maxit = 200 (maximum iteration steps), flag = 0 (convergence indicator), e1=0 (first moment vector), e2=0 (second moment vector), ϵ=0 (iteration-step indicator), (π0,v0), a0=0, τ0=0.
Iteration process:
   while ϵ<= maxit and flag = 0 do
      ϵ=ϵ+1
      gϵ=(π,v)l(πϵ1,vϵ1)    (gradients of l(π,v) shown in (A6) in Appendix A.2)
      eϵ(1)=b1eϵ1(1)(1b1)gϵ1b1ϵ    (bias-corrected first moment estimate)
      eϵ(2)=b2eϵ1(2)+(1b2)gϵ21b2ϵ    (bias-corrected second raw moment estimate)
      τϵ=(πϵ1,vϵ1)ηeϵ(1)eϵ(2)+γ    (temporarily updated parameters)
      (πϵ,vϵ)=b2aϵ1+(1b2)τϵ    (updated parameters)
      aϵ=(11ϵ)aϵ1+1ϵτϵ    (averaged parameters for further iteration)
      if |(πϵ,vϵ)(πϵ1,vϵ1)|5R+9<tol    (convergence determination)
         flag = 1
   end while
   return    (πϵ,vϵ)    (optimal estimates)