stepLVc(smfsb)
stepLVc()所属R语言包:smfsb
A function for advancing the state of a Lotka-Volterra model by using the Gillespie algorithm
Gillespie算法使用的功能,为推进国家的Lotka-Volterra模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function for advancing the state of a Lotka-Volterra model by calling some C code implementing the Gillespie algorithm. The function can be used in conjunction with other functions (such as simTs) for simulating realisations of Lotka-Volterra models. Should be functionally identical to the function obtained by data(spnModels), stepLV=StepGillespie(LV), but much faster.
的功能,为推进国家的Lotka-Volterra模型,通过调用一些C代码实现Gillespie算法。该功能可以结合其他功能(如simTs)的Lotka-Volterra模型来模拟实现。应该是功能上等同于的功能得到data(spnModels),stepLV=StepGillespie(LV),但是速度更快。
用法----------Usage----------
stepLVc(x0,t0,deltat,th=c(1,0.005,0.6))
参数----------Arguments----------
参数:x0
A vector representing the state of the system at the initial time, t0.
一个向量,表示系统状态的初始时刻,t0。
参数:t0
The time corresponding to the initial state, x0.
到初始状态,x0相对应的时间。
参数:deltat
The time in advance of the initial time at which the new state is required.
的时间,以在需要新的状态的初始时间的提前。
参数:th
A vector of length 3 representing the rate constants associated with the 3 LV reactions. Defaults to c(1,0.005,0.6).
一个向量长度为3的代表与3个LV的反应速率常数。默认为c(1,0.005,0.6)的。
值----------Value----------
A 2-vector representing the new state of the LV system.
A 2向量的LV系统的新状态。
参见----------See Also----------
StepGillespie, spnModels, simTs, simSample
StepGillespie,spnModels,simTs,simSample
实例----------Examples----------
# load the LV model[加载LV模型]
data(spnModels)
# create a stepping function[创建一个步进功能]
stepLV = StepGillespie(LV)
# step the function[加强功能]
print(stepLV(c(x1=50,x2=100),0,1))
# simulate a realisation of the process and plot it[模拟实现过程,并绘制]
out = simTs(c(x1=50,x2=100),0,100,0.1,stepLV)
plot(out)
# now use "stepLVc" instead...[现在使用“stepLVc”,而不是...]
out = simTs(c(x1=50,x2=100),0,100,0.1,stepLVc)
plot(out)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|