Skip to content

Commit

Permalink
version 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fchenhku authored and cran-robot committed Dec 5, 2016
1 parent 8e8a533 commit ea9ae46
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
@@ -1,15 +1,15 @@
Package: IHSEP
Type: Package
Title: Inhomogeneous Self-Exciting Process
Version: 0.0
Date: 2016-08-17
Version: 0.1
Date: 2016-12-2
Author: Feng Chen <feng.chen@unsw.edu.au>
Maintainer: Feng Chen <feng.chen@unsw.edu.au>
Description: Simulate an inhomogeneous self-exciting process (IHSEP), or Hawkes process, with a given (time-varying) baseline intensity and an excitation function. Calculate the likelihood of an IHSEP with given baseline intensity and excitation functions for an (increasing) sequence of event times. Calculate the point process residuals (integral transforms of the original event times). Calculate the mean intensity process.
Description: Simulate an inhomogeneous self-exciting process (IHSEP), or Hawkes process, with a given (possibly time-varying) baseline intensity and an excitation function. Calculate the likelihood of an IHSEP with given baseline intensity and excitation functions for an (increasing) sequence of event times. Calculate the point process residuals (integral transforms of the original event times). Calculate the mean intensity process.
License: GPL (>= 2)
LinkingTo: Rcpp
Imports: lpint,Rcpp
NeedsCompilation: yes
Packaged: 2016-08-17 22:38:32 UTC; z3243864
Packaged: 2016-12-03 06:16:20 UTC; z3243864
Repository: CRAN
Date/Publication: 2016-08-18 10:02:17
Date/Publication: 2016-12-05 14:49:21
16 changes: 8 additions & 8 deletions MD5
@@ -1,10 +1,10 @@
f821c78b012977fd4f134dd3b22652d2 *DESCRIPTION
baca2e4eb47dea880e42e75be7cb5d7c *DESCRIPTION
6bf26f611f08a337023e1d8db0935bfb *NAMESPACE
371fc3b4d19a2dbc360ff757ad3781bc *R/RcppExports.R
648703ec3008b771c0df574a0b46e358 *R/mint.R
55f31ccc1dc1bc4708d8608ebb540b81 *R/mloglik0.R
16325af7e7573dc2c691917733f443bc *R/mloglik1a.R
20e35af08a6df59f9464ac4029d6a9f0 *R/mloglik1b.R
1a4202aabd7faeb23f8defc8d3e93b8e *R/mloglik1a.R
9df21f79628bbec7fffff8c00631d5cb *R/mloglik1b.R
434004d101dacab9b259a02415217a5b *R/sepp.resid.R
090b5ab6aa65fabaa26c7d7bfa87c2c3 *R/simHawkes0.R
ca8417c319f98525de5b133b0a9f5a79 *R/simHawkes1.R
Expand All @@ -18,8 +18,8 @@ f110681a43f8cbe09946df7f63417f1e *man/asep.Rd
e6361f57f9b66708605af2afe495d8d2 *man/h.fn.Rd
556d13cc7bb4a6d1b4cc003967d6c991 *man/h.fn.exp.Rd
eb0facf0f210f4d61c9454599b183875 *man/mloglik0.Rd
3fb3068c4827bcf964b32ecb9196632c *man/mloglik1a.Rd
6e32840bf1e70dcddfef69edca7bd755 *man/mloglik1b.Rd
0cd659e74cdccc23043cf63debcb5ae8 *man/mloglik1a.Rd
75fc515ec183e852e2d80adda902896f *man/mloglik1b.Rd
945aded970cdc326ca4e7276311cd3f5 *man/mloglik1c.Rd
eedbc85ae342d841bc809bb76deb2c17 *man/mloglik1d.Rd
cf7d4c627d8ef9b7115131d0429390e5 *man/mloglik1e.Rd
Expand All @@ -30,6 +30,6 @@ d07ba61d08a2bf39c3b005f365c443f3 *man/simPois.Rd
6b5981487b1a197d48a740a53a693552 *man/simPois0.Rd
accb1618667195c6d8f4f9af65268681 *src/RcppExports.cpp
6f8bb023e0c9772aa6c0d86bb491783d *src/mloglik.c
3e84165dc67557be7337631739b6b621 *src/mloglik1c.cpp
5ac4d9382ef649af602d80f4ee4938c3 *src/mloglik1d.cpp
e9da16b903ca22bbd769a59f775599d5 *src/mloglik1e.cpp
7387862b929c91e0e08a46c4ee852dd1 *src/mloglik1c.cpp
5dc7c98f4e3f3aca74e3f4b38ecf00b5 *src/mloglik1d.cpp
c8d025b7284f0efbbef994200dde1443 *src/mloglik1e.cpp
2 changes: 1 addition & 1 deletion R/mloglik1a.R
@@ -1,6 +1,6 @@
mloglik1a <-
function(jtms,TT=max(jtms),nu,g,Ig=function(x)sapply(x,function(y)integrate(g,0,y)$value),
tol.abs=1e-8,tol.rel=1e-8,limit=1000){
tol.abs=1e-12,tol.rel=1e-12,limit=1000){
.External("mloglik1a",jtms,length(jtms),TT,nu,g,Ig,new.env(),
tol.abs,tol.rel,limit,PACKAGE="IHSEP")
}
2 changes: 1 addition & 1 deletion R/mloglik1b.R
@@ -1,5 +1,5 @@
mloglik1b <-
function(jtms,TT=max(jtms),nu,g,Ig=function(x)sapply(x,function(y)integrate(g,0,y)$value),
function(jtms,TT=max(jtms),nu,g,Ig=function(x)sapply(x,function(y)integrate(g,0,y,rel.tol=1e-12,abs.tol=1e-12,subdivisions=1000)$value),
Inu=function(x)sapply(x,function(y)integrate(nu,0,y)$value)){
.External("mloglik1b",jtms,length(jtms),TT,nu,g,Ig,Inu,new.env(),PACKAGE="IHSEP")
}
2 changes: 1 addition & 1 deletion man/mloglik1a.Rd
Expand Up @@ -12,7 +12,7 @@ for event times \code{jtms} on interval \eqn{[0,TT]}.
\usage{
mloglik1a(jtms, TT = max(jtms), nu, g,
Ig = function(x) sapply(x, function(y) integrate(g, 0, y)$value),
tol.abs = 1e-08, tol.rel = 1e-08, limit = 1000
tol.abs = 1e-12, tol.rel = 1e-12, limit = 1000
)

}
Expand Down
3 changes: 2 additions & 1 deletion man/mloglik1b.Rd
Expand Up @@ -11,7 +11,8 @@ for event times \code{jtms} on interval \eqn{[0,TT]}.
}
\usage{
mloglik1b(jtms, TT = max(jtms), nu, g,
Ig=function(x)sapply(x,function(y)integrate(g,0,y)$value),
Ig=function(x)sapply(x,function(y)integrate(g,0,y,
rel.tol=1e-12,abs.tol=1e-12,subdivisions=1000)$value),
Inu=function(x)sapply(x,function(y)integrate(nu,0,y)$value))
}
\arguments{
Expand Down
2 changes: 1 addition & 1 deletion src/mloglik1c.cpp
Expand Up @@ -19,7 +19,7 @@ double mloglik1c(NumericVector jtms, double TT, Function nu,
// Rcpp::Rcout<<res<<std::endl;
res += as<double>(Inu(TT));
// Rcpp::Rcout<<res<<std::endl;
for(int j=0;j<nj;j++)s += 1-exp(-gcoef[1]*(1-jtms[j]));
for(int j=0;j<nj;j++)s += 1-exp(-gcoef[1]*(TT-jtms[j]));
s *= gcoef[0]/gcoef[1];
// Rcpp::Rcout<<"s="<<s<<std::endl;
res += s;
Expand Down
2 changes: 1 addition & 1 deletion src/mloglik1d.cpp
Expand Up @@ -28,7 +28,7 @@ double mloglik1d(NumericVector jtms, double TT, Function nu,
for(k=0;k<d;k++){
s=0.0;
for(j=0;j<nj;j++){
s += (1-exp(-gcoef[k+d]*(1-jtms[j])))*gcoef[k]/gcoef[k+d];
s += (1-exp(-gcoef[k+d]*(TT-jtms[j])))*gcoef[k]/gcoef[k+d];
}
// s*=gcoef[k]/gcoef[k+d];
// Rcpp::Rcout<<"s="<<s<<std::endl;
Expand Down
2 changes: 1 addition & 1 deletion src/mloglik1e.cpp
Expand Up @@ -28,7 +28,7 @@ double mloglik1e(NumericVector jtms, double TT, NumericVector nuvs,
for(k=0;k<d;k++){
s=0.0;
for(j=0;j<nj;j++){
s += (1-exp(-gcoef[k+d]*(1-jtms[j])))*gcoef[k]/gcoef[k+d];
s += (1-exp(-gcoef[k+d]*(TT-jtms[j])))*gcoef[k]/gcoef[k+d];
}
// s*=gcoef[k]/gcoef[k+d];
// Rcpp::Rcout<<"s="<<s<<std::endl;
Expand Down

0 comments on commit ea9ae46

Please sign in to comment.