Skip to content

[R-sig-dyn-mod] metapopulation model with random effect in parameters

2 messages · 胡艺, Thomas Petzoldt

#
Thomas, thanks for your studying files and they are very useful. As for the
above problem, there are three subpopulations in my model and I want each
to have different birth rate. If I just use  b1(time) in the model, there
is only one birth rate for one subpopulation at each integration time,
right? I'm wondering whether there is a way to let approxfun() to return
three birth rates (a vector) at each integration time. Thanks.

Yi

On Wed, Sep 26, 2018 at 4:44 PM Thomas Petzoldt <
thomas.petzoldt at tu-dresden.de> wrote:

            

  
  
#
Hi,

this is a common task for the dynamic modeler, its solution depends on 
the model and the data. Package 'simecol' contains two convenience 
functions approxTime and approxTime1, but for small small models like 
yours its easiest to write just three approxfun'ctions. You can put them 
in a list, if you wish. approxfun is quite efficient, given that the 
interpolation tables are not too big.

For larger models, one may consider to write an own interpolation 
function. This works well and can be faster than approx, appproxfun or 
approxTime, if data are given in equidistant resolution, because you can 
then directly calculate the position of grid points without searching.

As an alternative, you can also supply a Fortran or C-model to deSolve. 
Then deSolve provides a built-in interpolator.

Hope it helps,

Thomas

Am 27.09.2018 um 03:20 schrieb ??: