-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use perlre for template trigger matching;
Csnippet interface to ordinary B spline bases
- Loading branch information
Showing
22 changed files
with
151 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Package: pomp | ||
Type: Package | ||
Title: Statistical Inference for Partially Observed Markov Processes | ||
Version: 5.4.3.0 | ||
Date: 2023-11-26 | ||
Version: 5.4.3.1 | ||
Date: 2023-11-30 | ||
Authors@R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="[email protected]",comment=c(ORCID="0000-0001-6159-3207")), | ||
person(given=c("Edward","L."),family="Ionides",role="aut",comment=c(ORCID="0000-0002-4190-0174")) , | ||
person(given="Carles",family="Bretó",role="aut",comment=c(ORCID="0000-0003-4695-4902")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
options(digits=3) | ||
png(filename="bsplines2-%02d.png",res=100) | ||
library(pomp) | ||
|
||
trajectory( | ||
t0=0, times=seq(0,2,by=0.02), | ||
skeleton=vectorfield(Csnippet(r"{ | ||
const double *a = &a1; | ||
double knots[] = {-3, -2, -1, 0, 1, 2, 3, 4, 5}; | ||
double s[5], p[5]; | ||
bspline_basis_eval(t,knots,3,5,s); | ||
periodic_bspline_basis_eval(t,1,3,5,p); | ||
Dx = dot_product(5,a,s); | ||
Dy = dot_product(5,a,&trend_1); | ||
Dz = dot_product(5,a,p); | ||
Dw = dot_product(5,a,&seas_1); | ||
}")), | ||
params = c( | ||
a1=-1,a2=1,a3=0,a4=-3,a5=18, | ||
x_0=0,y_0=0,z_0=0,w_0=0 | ||
), | ||
paramnames=c("a1","a2","a3"), | ||
statenames=c("x","y","w","z"), | ||
covar=covariate_table( | ||
times=seq(0,2.1,by=0.001), | ||
trend=bspline_basis(x=times,nbasis=5,degree=3,rg=c(0,2)), | ||
seas=periodic_bspline_basis(x=times,period=1,nbasis=5,degree=3) | ||
) | ||
) |> | ||
plot() | ||
|
||
dev.off() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
R version 4.3.2 (2023-10-31) -- "Eye Holes" | ||
Copyright (C) 2023 The R Foundation for Statistical Computing | ||
Platform: x86_64-pc-linux-gnu (64-bit) | ||
|
||
R is free software and comes with ABSOLUTELY NO WARRANTY. | ||
You are welcome to redistribute it under certain conditions. | ||
Type 'license()' or 'licence()' for distribution details. | ||
|
||
R is a collaborative project with many contributors. | ||
Type 'contributors()' for more information and | ||
'citation()' on how to cite R or R packages in publications. | ||
|
||
Type 'demo()' for some demos, 'help()' for on-line help, or | ||
'help.start()' for an HTML browser interface to help. | ||
Type 'q()' to quit R. | ||
|
||
> options(digits=3) | ||
> png(filename="bsplines2-%02d.png",res=100) | ||
> library(pomp) | ||
|
||
Welcome to pomp! | ||
|
||
As of version 4.6, no user-visible pomp function has a name that | ||
includes a dot ('.'). Function names have been changed to replace the | ||
dot with an underscore ('_'). For more information, see the pomp blog: | ||
https://kingaa.github.io/pomp/blog.html. | ||
|
||
> | ||
> trajectory( | ||
+ t0=0, times=seq(0,2,by=0.02), | ||
+ skeleton=vectorfield(Csnippet(r"{ | ||
+ const double *a = &a1; | ||
+ double knots[] = {-3, -2, -1, 0, 1, 2, 3, 4, 5}; | ||
+ double s[5], p[5]; | ||
+ bspline_basis_eval(t,knots,3,5,s); | ||
+ periodic_bspline_basis_eval(t,1,3,5,p); | ||
+ Dx = dot_product(5,a,s); | ||
+ Dy = dot_product(5,a,&trend_1); | ||
+ Dz = dot_product(5,a,p); | ||
+ Dw = dot_product(5,a,&seas_1); | ||
+ }")), | ||
+ params = c( | ||
+ a1=-1,a2=1,a3=0,a4=-3,a5=18, | ||
+ x_0=0,y_0=0,z_0=0,w_0=0 | ||
+ ), | ||
+ paramnames=c("a1","a2","a3"), | ||
+ statenames=c("x","y","w","z"), | ||
+ covar=covariate_table( | ||
+ times=seq(0,2.1,by=0.001), | ||
+ trend=bspline_basis(x=times,nbasis=5,degree=3,rg=c(0,2)), | ||
+ seas=periodic_bspline_basis(x=times,period=1,nbasis=5,degree=3) | ||
+ ) | ||
+ ) |> | ||
+ plot() | ||
> | ||
> dev.off() | ||
null device | ||
1 | ||
> |