宠辱不惊淡看庭前花开花谢, 去留 ...分享 http://blog.sciencenet.cn/u/zhangshibin 专业: 概率论与数理统计 研究方向: 时空数据统计分析,包括随机过程统计、时间序列分析、空间统计、统计计算、贝叶斯统计等

博文

Generating a trajectory of a CP - gamma process

已有 2893 次阅读 2013-3-21 09:36 |系统分类:科研笔记|关键词:学者| process

A compound poisson process is a stochastic process{Xt, t>=0} that can be represented as the random sum X(t)=sum Yi  (ps i=1 to N(t)) t>=0, where {Nt,t>=0} is a poisson process and Y1,Y2...are iid independent of {Nt,t>=0}.
 
Algorithm:
step 1, set your parameters, e.g., i) lambda, ii) parameters of gamma distributions: shape-nu, scale-alpha.
step 2, set the sampling interval [0,T].
step 3, set the initial time t=0 and the initial value of x x=0.
step 4, generate Delta~Exponential(lambda).
step 5, obtain the jump time of Poisson process t=t+Delta
step 6, generate y~gamma(nu,alpha)
step 7, obtain the value of x at time t, x<-x+y
step 8, repeat steps 4-7, till t>=T.
 

R code for a detailed example.

lambda<-0.1
nu<-2
alpha<-3
T<-100
time<-0
x<-0
while(time[length(time)]<T){
Delta<-rexp(1,rate=lambda)
time<-c(time,time[length(time)]+Delta)
x<-c(x,x[length(x)]+rgamma(1,nu,rate=alpha))
}
plot(time, x, type="s", main="", xlab="t", ylab="")


 

 



https://m.sciencenet.cn/blog-116301-672448.html

上一篇:<数学建模中的思想和方法>综合考查题(二)数据
下一篇:New work: A LSE for Lévy-Driven MAs

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-20 22:28

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部