r - skeleton in pomp is giving error (unused argument) -
i have written following code in r using pomp. works fine except skeleton function.error there, unused argument in skel.skel function returns void. adding data example. solicited , in advance. error this: c:/users/admin/appdata/local/temp/rtmpmez0jw/1892/pomp_dfb36bbab4b5ee3a8b4cbc45a0b63e0c.c: in function '__pomp_skelfn': c:/users/admin/appdata/local/temp/rtmpmez0jw/1892/pomp_dfb36bbab4b5ee3a8b4cbc45a0b63e0c.c:96:39: warning: 'return' value, in function returning void return(i);
t y1 y2 1 -0.058886245 0.018451378 2 -0.045854389 -0.012812011 3 0 -0.025850852 4 -0.06009386 0.021278254 5 0.053712929 -0.008261274 6 0 0.025270473 7 0.047628037 -0.008357995 8 0.061425641 -0.0146046 9 0 -0.03778035 10 0 -0.004632415 library(magrittr) library(pomp) library(ggplot2) data <- read.csv("c:/users/admin/documents/phd/book2.csv", stringsasfactors = false) data <- as.data.frame(data) pomp( data,times="t", t0=0, rmeasure=csnippet(" y1 = rnorm(x1+x2,sigma1); y2 = rnorm(x2-x1,sigma2); "), dmeasure=csnippet(" lik = dnorm(y1,x1+x2,sigma1,1)+dnorm(y2,x2-x1,sigma2,1); lik = (give_log) ? lik : exp(lik); "), rprocess=discrete.time.sim( step.fun=csnippet(" double tx1, tx2; tx1 = rnorm(a11*x1 + a12*x2,nu1); tx2 = rnorm(a21*x1 + a22*x2,nu2); x1 = tx1; x2 = tx2; "), delta.t=1), initializer=csnippet(" x1 = 0; x2 = 0; "), skeleton = vectorfield( skel = csnippet("double i; = a11 + a12*x1 + a22 + a21*x2; return(i); ") ), toestimationscale = logtrans <- csnippet(" tr1 = log(a11); tk1 = log(a21); tsigma1 = log(sigma1); "), fromestimationscale=exptransexptrans <- csnippet(" tr1 = exp(a11); tk1 = exp(21); tsigma1 = exp(sigma1); "), statenames=c("x1","x2"), paramnames=c("a11","a12","a21","a22","sigma1","sigma2","nu1","nu2"), params=c(a11=0.5,a12=-0.1,a21=0.2,a22=-1,nu1=0.3,nu2=0.1,sigma1=0.1,sigma2=0.3) ) -> parus
Comments
Post a Comment