From noreply at r-forge.r-project.org Tue Apr 2 12:50:23 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 2 Apr 2013 12:50:23 +0200 (CEST) Subject: [Pomp-commits] r842 - pkg/pomp Message-ID: <20130402105023.6EEF618490D@r-forge.r-project.org> Author: kingaa Date: 2013-04-02 12:50:23 +0200 (Tue, 02 Apr 2013) New Revision: 842 Modified: pkg/pomp/DESCRIPTION Log: Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2013-03-26 11:51:33 UTC (rev 841) +++ pkg/pomp/DESCRIPTION 2013-04-02 10:50:23 UTC (rev 842) @@ -7,8 +7,8 @@ Contributor: Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood Maintainer: Aaron A. King Author at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), - person(given=c("Edward","L."),family="Ionides",role=c("ctb")), - person(given=c("Carles"),family="Breto",role=c("ctb")), + person(given=c("Edward","L."),family="Ionides",role=c("aut")), + person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), From noreply at r-forge.r-project.org Tue Apr 16 15:51:47 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 15:51:47 +0200 (CEST) Subject: [Pomp-commits] r843 - branches Message-ID: <20130416135147.BBE84185164@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 15:51:47 +0200 (Tue, 16 Apr 2013) New Revision: 843 Added: branches/premif2/ Log: - branch for updates needed but prior to release of mif2 From noreply at r-forge.r-project.org Tue Apr 16 16:21:36 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 16:21:36 +0200 (CEST) Subject: [Pomp-commits] r844 - in pkg/pomp: src tests Message-ID: <20130416142136.C6487185155@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 16:21:36 +0200 (Tue, 16 Apr 2013) New Revision: 844 Modified: pkg/pomp/src/SSA.f pkg/pomp/tests/ou2-mif.Rout.save Log: - modify fortran code to eliminate (false positive) bounds violation error when -fbounds-check flag is given to gfortran. Modified: pkg/pomp/src/SSA.f =================================================================== --- pkg/pomp/src/SSA.f 2013-04-16 13:51:47 UTC (rev 843) +++ pkg/pomp/src/SSA.f 2013-04-16 14:21:36 UTC (rev 844) @@ -123,18 +123,20 @@ c c Recording output at required time points c - do while((icount.le.ntimes).and.(t.ge.times(icount))) - do i=1,n - xout(i,irep,icount)=y(i) - enddo + if (icount.le.ntimes) then + do while((icount.le.ntimes).and.(t.ge.times(icount))) + do i=1,n + xout(i,irep,icount)=y(i) + enddo c=============================== c Set appropriate states to zero c=============================== - do i=1,nzero - y(izero(i)+1)=0.0d0 + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo + icount=icount+1 enddo - icount=icount+1 - enddo + endif if((mcov.gt.0).and.(t.le.tmax))then call tlook(lcov,mcov,tcov,cov,t,covars) Modified: pkg/pomp/tests/ou2-mif.Rout.save =================================================================== --- pkg/pomp/tests/ou2-mif.Rout.save 2013-04-16 13:51:47 UTC (rev 843) +++ pkg/pomp/tests/ou2-mif.Rout.save 2013-04-16 14:21:36 UTC (rev 844) @@ -1,7 +1,6 @@ -R version 2.15.2 (2012-10-26) -- "Trick or Treat" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -87,7 +86,7 @@ > plot(mif1) > compare.mif(mif2) > try(compare.mif(mif1,mif2)) -Error in compare.mif(mif1, mif2) : unused argument(s) (mif2) +Error in compare.mif(mif1, mif2) : unused argument (mif2) > compare.mif(list(mif1,mif2)) > dev.off() null device @@ -283,4 +282,4 @@ > > proc.time() user system elapsed - 11.384 0.072 11.591 + 12.416 0.084 12.654 From noreply at r-forge.r-project.org Tue Apr 16 16:48:29 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 16:48:29 +0200 (CEST) Subject: [Pomp-commits] r845 - branches/premif2 Message-ID: <20130416144829.D561E1848BE@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 16:48:28 +0200 (Tue, 16 Apr 2013) New Revision: 845 Removed: branches/premif2/DESCRIPTION branches/premif2/NAMESPACE branches/premif2/R/ branches/premif2/data/ branches/premif2/demo/ branches/premif2/inst/ branches/premif2/man/ branches/premif2/src/ branches/premif2/tests/ Log: - start over Deleted: branches/premif2/DESCRIPTION =================================================================== --- branches/premif2/DESCRIPTION 2013-04-16 14:21:36 UTC (rev 844) +++ branches/premif2/DESCRIPTION 2013-04-16 14:48:28 UTC (rev 845) @@ -1,25 +0,0 @@ -Package: pomp -Type: Package -Title: Statistical inference for partially observed Markov processes -Version: 0.44-1 -Date: 2013-01-09 -Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman -Maintainer: Aaron A. King -URL: http://pomp.r-forge.r-project.org -Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.14.1), stats, methods, graphics, mvtnorm, subplex, deSolve -License: GPL(>= 2) -LazyLoad: true -LazyData: false -BuildVignettes: no -Collate: aaa.R authors.R version.R eulermultinom.R plugins.R - parmat.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R - pomp-fun.R pomp-class.R pomp.R pomp-methods.R - rmeasure-pomp.R rprocess-pomp.R init-state-pomp.R dmeasure-pomp.R dprocess-pomp.R skeleton-pomp.R - simulate-pomp.R trajectory-pomp.R plot-pomp.R - pfilter.R pfilter-methods.R traj-match.R bsmc.R - mif-class.R particles-mif.R mif.R mif-methods.R compare-mif.R - pmcmc.R pmcmc-methods.R compare-pmcmc.R - nlf-funcs.R nlf-guts.R nlf-objfun.R nlf.R - probe.R probe-match.R basic-probes.R spect.R spect-match.R - builder.R example.R Deleted: branches/premif2/NAMESPACE =================================================================== --- branches/premif2/NAMESPACE 2013-04-16 14:21:36 UTC (rev 844) +++ branches/premif2/NAMESPACE 2013-04-16 14:48:28 UTC (rev 845) @@ -1,97 +0,0 @@ -useDynLib( - pomp, - get_pomp_fun, - bspline_basis, - periodic_bspline_basis, - bspline_basis_function, - systematic_resampling, - euler_model_simulator, - euler_model_density, - lookup_in_table, - SSA_simulator, - R_Euler_Multinom,D_Euler_Multinom,R_GammaWN, - pfilter_computations, - simulation_computations, - iterate_map,traj_transp_and_copy, - apply_probe_data,apply_probe_sim, - probe_marginal_setup,probe_marginal_solve, - probe_acf,probe_ccf, - probe_nlar, - synth_loglik, - pomp_desolve_setup,pomp_desolve_takedown, - pomp_vf_eval, - do_partrans, - do_rprocess, - do_dprocess, - do_rmeasure, - do_dmeasure, - do_skeleton, - do_init_state - ) - -importFrom(graphics,plot) -importFrom(stats,simulate,time,coef,logLik,window) -importFrom(mvtnorm,dmvnorm,rmvnorm) -importFrom(subplex,subplex) -importFrom(deSolve,ode) - -exportClasses( - pomp, - pfilterd.pomp, - mif, - pmcmc, - traj.matched.pomp, - probed.pomp,probe.matched.pomp, - spect.pomp,spect.matched.pomp - ) - -exportMethods( - pomp, - plot,show,print,coerce,summary,logLik,window,"$", - dprocess,rprocess,rmeasure,dmeasure,init.state,skeleton, - data.array,obs,partrans,coef,"coef<-",time,"time<-",timezero,"timezero<-", - simulate,pfilter, - eff.sample.size,cond.logLik, - particles,mif,continue,states,trajectory, - pred.mean,pred.var,filter.mean,conv.rec, - bsmc, - pmcmc,dprior, - spect,probe, - probe.match,traj.match - ) - -export( - as.data.frame.pomp, - reulermultinom, - deulermultinom, - rgammawn, - euler.sim, - discrete.time.sim, - onestep.sim, - onestep.dens, - gillespie.sim, - sobol, - sobolDesign, - sliceDesign, - profileDesign, - bspline.basis, - periodic.bspline.basis, - compare.mif, - nlf, - parmat, - probe.mean, - probe.median, - probe.var, - probe.sd, - probe.period, - probe.quantile, - probe.acf, - probe.ccf, - probe.nlar, - probe.marginal, - sannbox, - spect.match, - traj.match.objfun, - pompBuilder, - pompExample - ) From noreply at r-forge.r-project.org Tue Apr 16 16:49:42 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 16:49:42 +0200 (CEST) Subject: [Pomp-commits] r846 - branches Message-ID: <20130416144942.7540B1848BE@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 16:49:41 +0200 (Tue, 16 Apr 2013) New Revision: 846 Removed: branches/premif2/ Log: - start over From noreply at r-forge.r-project.org Tue Apr 16 16:50:36 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 16:50:36 +0200 (CEST) Subject: [Pomp-commits] r847 - branches Message-ID: <20130416145036.4EFF81848BE@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 16:50:35 +0200 (Tue, 16 Apr 2013) New Revision: 847 Added: branches/premif2/ Log: - branch for needed changes that must precede the release of the 'mif2' version From noreply at r-forge.r-project.org Tue Apr 16 18:27:03 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 18:27:03 +0200 (CEST) Subject: [Pomp-commits] r848 - in branches/premif2: . R src tests Message-ID: <20130416162704.040751851AE@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 18:27:02 +0200 (Tue, 16 Apr 2013) New Revision: 848 Modified: branches/premif2/DESCRIPTION branches/premif2/R/authors.R branches/premif2/src/SSA.f branches/premif2/src/SSA_wrapper.c branches/premif2/src/blowfly.c branches/premif2/src/dprocess.c branches/premif2/src/partrans.c branches/premif2/src/pomp_fun.c branches/premif2/tests/bbs-trajmatch.Rout.save branches/premif2/tests/bbs.Rout.save branches/premif2/tests/blowflies.Rout.save branches/premif2/tests/dacca.Rout.save branches/premif2/tests/dimchecks.Rout.save branches/premif2/tests/fhn.Rout.save branches/premif2/tests/filtfail.Rout.save branches/premif2/tests/gillespie.Rout.save branches/premif2/tests/gompertz.Rout.save branches/premif2/tests/logistic.Rout.save branches/premif2/tests/ou2-bsmc.Rout.save branches/premif2/tests/ou2-forecast.Rout.save branches/premif2/tests/ou2-icfit.Rout.save branches/premif2/tests/ou2-kalman.Rout.save branches/premif2/tests/ou2-mif-fp.Rout.save branches/premif2/tests/ou2-mif.Rout.save branches/premif2/tests/ou2-nlf.Rout.save branches/premif2/tests/ou2-pmcmc.Rout.save branches/premif2/tests/ou2-probe.Rout.save branches/premif2/tests/ou2-procmeas.Rout.save branches/premif2/tests/ou2-simulate.Rout.save branches/premif2/tests/ou2-trajmatch.Rout.save branches/premif2/tests/partrans.Rout.save branches/premif2/tests/pfilter.Rout.save branches/premif2/tests/pomppomp.Rout.save branches/premif2/tests/ricker-bsmc.Rout.save branches/premif2/tests/ricker-probe.Rout.save branches/premif2/tests/ricker-spect.Rout.save branches/premif2/tests/ricker.Rout.save branches/premif2/tests/rw2.Rout.save branches/premif2/tests/sir.Rout.save branches/premif2/tests/skeleton.Rout.save branches/premif2/tests/steps.Rout.save branches/premif2/tests/synlik.Rout.save branches/premif2/tests/verhulst.Rout.save Log: - checkout revision 765, then merge changes in revisions 775, 780, 788, 816, 839, 844 - update author list - modify fortran code to eliminate (false positive) bounds violation error when -fbounds-check flag is given to gfortran. - fig bug in mif: non-constant Np was ignored - cosmetic changes to code (indentation, etc.) - more informative error message when pomp_fun handler fails - update bibliography database Modified: branches/premif2/DESCRIPTION =================================================================== --- branches/premif2/DESCRIPTION 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/DESCRIPTION 2013-04-16 16:27:02 UTC (rev 848) @@ -1,10 +1,21 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.43-4 -Date: 2012-08-08 -Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman +Version: 0.43-8 +Date: 2013-04-16 +Author: Aaron A. King, Edward L. Ionides, Carles Breto +Contributor: Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood Maintainer: Aaron A. King +Author at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), + person(given=c("Edward","L."),family="Ionides",role=c("aut")), + person(given=c("Carles"),family="Breto",role=c("aut")), + person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), + person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), + person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), + person(given=c("Michael"),family="Lavine",role=c("ctb")), + person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), + person(given=c("Helen"),family="Wearing",role=c("ctb")), + person(given=c("Simon","N."),family="Wood",role=c("ctb"))) URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes Depends: R(>= 2.14.1), stats, methods, graphics, mvtnorm, subplex, deSolve Modified: branches/premif2/R/authors.R =================================================================== --- branches/premif2/R/authors.R 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/R/authors.R 2013-04-16 16:27:02 UTC (rev 848) @@ -1,9 +1,9 @@ list( aak=person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), - eli=person(given=c("Edward","L."),family="Ionides",role=c("aut"),email="ionides at umich.edu"), - cb=person(given=c("Carles"),family="Breto",role=c("aut")), - spe=person(given=c("Stephen","P."),family="Ellner",role=c("aut")), - bek=person(given=c("Bruce","E."),family="Kendall",role=c("aut")), + eli=person(given=c("Edward","L."),family="Ionides",role=c("ctb")), + cb=person(given=c("Carles"),family="Breto",role=c("ctb")), + spe=person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), + bek=person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), mf=person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), ml=person(given=c("Michael"),family="Lavine",role=c("ctb")), dcr=person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), Modified: branches/premif2/src/SSA.f =================================================================== --- branches/premif2/src/SSA.f 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/SSA.f 2013-04-16 16:27:02 UTC (rev 848) @@ -123,18 +123,20 @@ c c Recording output at required time points c - do while((icount.le.ntimes).and.(t.ge.times(icount))) - do i=1,n - xout(i,irep,icount)=y(i) - enddo + if (icount.le.ntimes) then + do while((icount.le.ntimes).and.(t.ge.times(icount))) + do i=1,n + xout(i,irep,icount)=y(i) + enddo c=============================== c Set appropriate states to zero c=============================== - do i=1,nzero - y(izero(i)+1)=0.0d0 + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo + icount=icount+1 enddo - icount=icount+1 - enddo + endif if((mcov.gt.0).and.(t.le.tmax))then call tlook(lcov,mcov,tcov,cov,t,covars) Modified: branches/premif2/src/SSA_wrapper.c =================================================================== --- branches/premif2/src/SSA_wrapper.c 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/SSA_wrapper.c 2013-04-16 16:27:02 UTC (rev 848) @@ -3,6 +3,10 @@ #include "pomp_internal.h" #include +typedef double (*_pomp_rxnrate) (const int *j, const double *t, const double *x, const double *p, + int *stateindex, int *parindex, int *covarindex, + int *ncovar, double *covar); + void F77_SUB(rndstart)(void) { GetRNGstate(); } void F77_SUB(rndend)(void) { PutRNGstate(); } double F77_SUB(unifrnd)(void) { return unif_rand(); } @@ -11,7 +15,7 @@ double F77_SUB(gammarnd)(double shape, double scale) { return rgamma(shape,scale); } void F77_SUB(multinomrnd)(int N, double *p, int ncat, int *ix) { rmultinom(N,p,ncat,ix); } -void F77_NAME(driverssa)(void *fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, +void F77_NAME(driverssa)(_pomp_rxnrate *fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, int *kflag, double *xstart, double *times, double *params, double *xout, double *e, double *v, double *d, int *nzero, int *izero, int *istate, int *ipar, int *ncov, int *icov, int *lcov, int *mcov, double *tcov, double *cov); Modified: branches/premif2/src/blowfly.c =================================================================== --- branches/premif2/src/blowfly.c 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/blowfly.c 2013-04-16 16:27:02 UTC (rev 848) @@ -5,7 +5,7 @@ #include "pomp.h" #define P (p[parindex[0]]) // growth rate -#define NZERO (p[parindex[1]]) // density-dependence parameter +#define N0 (p[parindex[1]]) // density-dependence parameter #define DELTA (p[parindex[2]]) // survival parameter #define SIGMAP (p[parindex[3]]) // recruitment noise SD #define SIGMAD (p[parindex[4]]) // survivorship noise SD @@ -29,7 +29,7 @@ double eps = rgammawn(SIGMAD,dt)/dt; int k; - R = rpois(P*N[tau]*exp(-N[tau]/NZERO)*dt*e); + R = rpois(P*N[tau]*exp(-N[tau]/N0)*dt*e); S = rbinom(N[0],exp(-DELTA*dt*eps)); E = e; EPS = eps; @@ -60,7 +60,7 @@ #undef EPS #undef P -#undef NZERO +#undef N0 #undef DELTA #undef SIGMAP #undef SIGMAD Modified: branches/premif2/src/dprocess.c =================================================================== --- branches/premif2/src/dprocess.c 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/dprocess.c 2013-04-16 16:27:02 UTC (rev 848) @@ -12,7 +12,7 @@ int nprotect = 0; int *xdim, npars, nvars, nreps, nrepsx, ntimes; SEXP X, fn, fcall, rho; - SEXP dimP, dimF; + SEXP dimF; ntimes = length(times); if (ntimes < 2) Modified: branches/premif2/src/partrans.c =================================================================== --- branches/premif2/src/partrans.c 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/partrans.c 2013-04-16 16:27:02 UTC (rev 848) @@ -12,7 +12,7 @@ int nprotect = 0; SEXP fn, fcall, rho, ans, nm; SEXP pdim, pvec; - SEXP tparams; + SEXP tparams = R_NilValue; int mode = -1; int qmat; int ndim[2], *dim, *idx; Modified: branches/premif2/src/pomp_fun.c =================================================================== --- branches/premif2/src/pomp_fun.c 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/src/pomp_fun.c 2013-04-16 16:27:02 UTC (rev 848) @@ -33,7 +33,7 @@ PROTECT(f = getListElement(nsi,"address")); nprotect++; break; default: - error("'pomp_fun_handler': invalid 'mode' value"); + error("operation cannot be completed: some needed function has not been specified"); break; } Modified: branches/premif2/tests/bbs-trajmatch.Rout.save =================================================================== --- branches/premif2/tests/bbs-trajmatch.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/bbs-trajmatch.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -68,4 +67,4 @@ > > proc.time() user system elapsed - 2.180 0.032 2.236 + 2.180 0.068 2.271 Modified: branches/premif2/tests/bbs.Rout.save =================================================================== --- branches/premif2/tests/bbs.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/bbs.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -45,7 +44,7 @@ Walker's alias method used: results are different from R < 2.2.0 > signif(coef(fit1),3) gamma mu iota beta beta.sd pop rho sigma - 0.333 0.000 0.000 3.460 0.000 1400.000 0.900 2.050 + 0.333 0.000 0.000 3.220 0.000 1400.000 0.900 2.240 S.0 I.0 R.0 0.999 0.001 0.000 > @@ -58,4 +57,4 @@ > > proc.time() user system elapsed - 2.816 0.028 2.867 + 2.884 0.060 2.969 Modified: branches/premif2/tests/blowflies.Rout.save =================================================================== --- branches/premif2/tests/blowflies.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/blowflies.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.14.2 (2012-02-29) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -68,3 +67,6 @@ > logLik(f2) [1] -1471.781 > +> proc.time() + user system elapsed + 1.268 0.036 1.319 Modified: branches/premif2/tests/dacca.Rout.save =================================================================== --- branches/premif2/tests/dacca.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/dacca.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -50,4 +49,4 @@ > > proc.time() user system elapsed - 3.428 0.052 3.501 + 3.392 0.056 3.472 Modified: branches/premif2/tests/dimchecks.Rout.save =================================================================== --- branches/premif2/tests/dimchecks.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/dimchecks.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -160,4 +159,4 @@ > > proc.time() user system elapsed - 0.436 0.044 0.494 + 0.516 0.056 0.588 Modified: branches/premif2/tests/fhn.Rout.save =================================================================== --- branches/premif2/tests/fhn.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/fhn.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -93,4 +92,4 @@ > > proc.time() user system elapsed - 1.016 0.044 1.198 + 1.000 0.056 1.187 Modified: branches/premif2/tests/filtfail.Rout.save =================================================================== --- branches/premif2/tests/filtfail.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/filtfail.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -119,4 +118,4 @@ > > proc.time() user system elapsed - 0.424 0.040 0.475 + 0.492 0.052 0.558 Modified: branches/premif2/tests/gillespie.Rout.save =================================================================== --- branches/premif2/tests/gillespie.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/gillespie.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -131,4 +130,4 @@ > > proc.time() user system elapsed - 2.248 0.044 2.308 + 2.576 0.044 2.641 Modified: branches/premif2/tests/gompertz.Rout.save =================================================================== --- branches/premif2/tests/gompertz.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/gompertz.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -131,4 +130,4 @@ > > proc.time() user system elapsed - 1.496 0.056 1.567 + 1.572 0.048 1.640 Modified: branches/premif2/tests/logistic.Rout.save =================================================================== --- branches/premif2/tests/logistic.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/logistic.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -124,4 +123,4 @@ > > proc.time() user system elapsed - 0.800 0.052 0.937 + 0.932 0.032 1.152 Modified: branches/premif2/tests/ou2-bsmc.Rout.save =================================================================== --- branches/premif2/tests/ou2-bsmc.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-bsmc.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -62,7 +61,7 @@ > post <- smc$post > > print(etime <- toc-tic) -Time difference of 3.02021 secs +Time difference of 3.065297 secs > > print( + cbind( @@ -74,8 +73,8 @@ + ) prior.mean posterior.mean truth 2.5% 50% 97.5% alpha.1 0.8000000 0.8000000 0.8 0.8000000 0.8000000 0.8000000 -alpha.2 -0.4999287 -0.4853833 -0.5 -0.5353593 -0.4881214 -0.4521997 -alpha.3 0.2996065 0.3186368 0.3 0.2933113 0.3120256 0.3476582 +alpha.2 -0.4999287 -0.5105023 -0.5 -0.5402483 -0.4993459 -0.4536930 +alpha.3 0.2996065 0.3148637 0.3 0.2823821 0.3260754 0.3388949 alpha.4 0.9000000 0.9000000 0.9 0.9000000 0.9000000 0.9000000 sigma.1 3.0000000 3.0000000 3.0 3.0000000 3.0000000 3.0000000 sigma.2 -0.5000000 -0.5000000 -0.5 -0.5000000 -0.5000000 -0.5000000 @@ -85,9 +84,9 @@ x2.0 4.0000000 4.0000000 4.0 4.0000000 4.0000000 4.0000000 > > print(min(smc$eff.sample.size)) -[1] 40.66176 +[1] 22.94863 > print(smc$log.evidence) -[1] 44.55899 +[1] 45.47584 > > smc <- bsmc(ou2,ntries=5,Np=5000,smooth=0.1,est=estnames,seed=648651945L) > print(smc$eff.sample.size) @@ -98,4 +97,4 @@ > > proc.time() user system elapsed - 4.848 0.040 4.912 + 5.044 0.064 5.138 Modified: branches/premif2/tests/ou2-forecast.Rout.save =================================================================== --- branches/premif2/tests/ou2-forecast.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-forecast.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -61,4 +60,4 @@ > > proc.time() user system elapsed - 1.492 0.048 1.691 + 1.656 0.052 1.834 Modified: branches/premif2/tests/ou2-icfit.Rout.save =================================================================== --- branches/premif2/tests/ou2-icfit.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-icfit.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -107,4 +106,4 @@ > > proc.time() user system elapsed - 16.365 0.056 16.483 + 17.725 0.052 17.851 Modified: branches/premif2/tests/ou2-kalman.Rout.save =================================================================== --- branches/premif2/tests/ou2-kalman.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-kalman.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -164,7 +163,7 @@ 117 function evaluations used > toc <- Sys.time() > print(toc-tic) -Time difference of 5.289137 secs +Time difference of 3.744109 secs > tic <- Sys.time() > print(loglik.mle <- -kalm.fit1$value,digits=4) [1] -477.2 @@ -188,4 +187,4 @@ > > proc.time() user system elapsed - 5.776 0.040 5.861 + 4.296 0.056 4.385 Modified: branches/premif2/tests/ou2-mif-fp.Rout.save =================================================================== --- branches/premif2/tests/ou2-mif-fp.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-mif-fp.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -68,4 +67,4 @@ > > proc.time() user system elapsed - 19.521 0.056 19.776 + 20.673 0.060 20.945 Modified: branches/premif2/tests/ou2-mif.Rout.save =================================================================== --- branches/premif2/tests/ou2-mif.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-mif.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -80,7 +79,7 @@ > plot(mif1) > compare.mif(mif2) > try(compare.mif(mif1,mif2)) -Error in compare.mif(mif1, mif2) : unused argument(s) (mif2) +Error in compare.mif(mif1, mif2) : unused argument (mif2) > compare.mif(list(mif1,mif2)) > dev.off() null device @@ -267,4 +266,4 @@ > > proc.time() user system elapsed - 13.728 0.036 13.921 + 13.704 0.044 13.926 Modified: branches/premif2/tests/ou2-nlf.Rout.save =================================================================== --- branches/premif2/tests/ou2-nlf.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-nlf.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -220,4 +219,4 @@ > > proc.time() user system elapsed - 8.256 0.040 8.334 + 8.472 0.028 8.558 Modified: branches/premif2/tests/ou2-pmcmc.Rout.save =================================================================== --- branches/premif2/tests/ou2-pmcmc.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-pmcmc.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -85,4 +84,4 @@ > > proc.time() user system elapsed - 2.744 0.040 3.037 + 2.872 0.052 3.187 Modified: branches/premif2/tests/ou2-probe.Rout.save =================================================================== --- branches/premif2/tests/ou2-probe.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-probe.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -294,4 +293,4 @@ > > proc.time() user system elapsed - 1.320 0.040 1.484 + 1.368 0.060 1.491 Modified: branches/premif2/tests/ou2-procmeas.Rout.save =================================================================== --- branches/premif2/tests/ou2-procmeas.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-procmeas.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -54,4 +53,4 @@ > > proc.time() user system elapsed - 0.432 0.040 0.480 + 0.480 0.040 0.537 Modified: branches/premif2/tests/ou2-simulate.Rout.save =================================================================== --- branches/premif2/tests/ou2-simulate.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-simulate.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -35,7 +34,7 @@ > ou2.sim <- simulate(ou2,params=p,nsim=100,seed=32043858) > toc <- Sys.time() > print(toc-tic) -Time difference of 0.01002026 secs +Time difference of 0.009061098 secs > > coef(ou2,c('x1.0','x2.0')) <- c(-50,50) > @@ -46,4 +45,4 @@ > > proc.time() user system elapsed - 0.432 0.048 0.493 + 0.480 0.064 0.558 Modified: branches/premif2/tests/ou2-trajmatch.Rout.save =================================================================== --- branches/premif2/tests/ou2-trajmatch.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ou2-trajmatch.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -184,4 +183,4 @@ > > proc.time() user system elapsed - 2.244 0.044 2.311 + 1.656 0.044 1.720 Modified: branches/premif2/tests/partrans.Rout.save =================================================================== --- branches/premif2/tests/partrans.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/partrans.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -52,4 +51,4 @@ > > proc.time() user system elapsed - 0.424 0.036 0.472 + 0.492 0.052 0.560 Modified: branches/premif2/tests/pfilter.Rout.save =================================================================== --- branches/premif2/tests/pfilter.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/pfilter.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -66,4 +65,4 @@ > > proc.time() user system elapsed - 6.224 0.048 6.307 + 6.124 0.056 6.215 Modified: branches/premif2/tests/pomppomp.Rout.save =================================================================== --- branches/premif2/tests/pomppomp.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/pomppomp.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.0 (2012-03-30) -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -41,4 +40,4 @@ > > proc.time() user system elapsed - 0.432 0.036 0.491 + 0.508 0.060 0.588 Modified: branches/premif2/tests/ricker-bsmc.Rout.save =================================================================== --- branches/premif2/tests/ricker-bsmc.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ricker-bsmc.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -53,4 +52,4 @@ > > proc.time() user system elapsed - 23.861 0.076 24.137 + 23.553 0.072 23.855 Modified: branches/premif2/tests/ricker-probe.Rout.save =================================================================== --- branches/premif2/tests/ricker-probe.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ricker-probe.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -296,4 +295,4 @@ > > proc.time() user system elapsed - 12.404 0.060 12.659 + 12.588 0.080 12.896 Modified: branches/premif2/tests/ricker-spect.Rout.save =================================================================== --- branches/premif2/tests/ricker-spect.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ricker-spect.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -70,4 +69,4 @@ > > proc.time() user system elapsed - 2.264 0.064 2.509 + 2.376 0.068 2.613 Modified: branches/premif2/tests/ricker.Rout.save =================================================================== --- branches/premif2/tests/ricker.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/ricker.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -83,4 +82,4 @@ > > proc.time() user system elapsed - 0.508 0.028 0.665 + 0.640 0.052 0.829 Modified: branches/premif2/tests/rw2.Rout.save =================================================================== --- branches/premif2/tests/rw2.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/rw2.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 +R version 3.0.0 (2013-04-03) -- "Masked Marvel" +Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -260,7 +259,7 @@ } y } - + measurement model density, dmeasure = function (y, x, t, params, log, covars, ...) { @@ -273,11 +272,11 @@ f else exp(f) } - + skeleton ( map ) = function (x, t, params, covars, ...) stop(sQuote("skeleton"), " not specified") - + initializer = function (params, t0, ...) { @@ -433,4 +432,4 @@ > > proc.time() user system elapsed - 0.876 0.048 0.940 + 0.964 0.044 1.024 Modified: branches/premif2/tests/sir.Rout.save =================================================================== --- branches/premif2/tests/sir.Rout.save 2013-04-16 14:50:35 UTC (rev 847) +++ branches/premif2/tests/sir.Rout.save 2013-04-16 16:27:02 UTC (rev 848) @@ -1,7 +1,6 @@ -R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" -Copyright (C) 2012 The R Foundation for Statistical Computing -ISBN 3-900051-07-0 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 848 From noreply at r-forge.r-project.org Tue Apr 16 19:00:00 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 19:00:00 +0200 (CEST) Subject: [Pomp-commits] r849 - pkg/pomp Message-ID: <20130416170001.63DBB18513C@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 19:00:00 +0200 (Tue, 16 Apr 2013) New Revision: 849 Modified: pkg/pomp/DESCRIPTION Log: - fix DESCRIPTION file Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2013-04-16 16:27:02 UTC (rev 848) +++ pkg/pomp/DESCRIPTION 2013-04-16 17:00:00 UTC (rev 849) @@ -1,12 +1,10 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.44-3 -Date: 2013-03-21 -Author: Aaron A. King, Edward L. Ionides, Carles Breto -Contributor: Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood +Version: 0.44-4 +Date: 2013-04-16 Maintainer: Aaron A. King -Author at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), +Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), person(given=c("Edward","L."),family="Ionides",role=c("aut")), person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), @@ -15,7 +13,8 @@ person(given=c("Michael"),family="Lavine",role=c("ctb")), person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), person(given=c("Helen"),family="Wearing",role=c("ctb")), - person(given=c("Simon","N."),family="Wood",role=c("ctb"))) + person(given=c("Simon","N."),family="Wood",role=c("ctb")), + person(given="Dao",family="Nguyen",role=c("ctb")) ) URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes Depends: R(>= 2.14.1), stats, methods, graphics, mvtnorm, subplex, deSolve From noreply at r-forge.r-project.org Tue Apr 16 19:00:23 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 16 Apr 2013 19:00:23 +0200 (CEST) Subject: [Pomp-commits] r850 - branches/premif2 Message-ID: <20130416170024.1803718513C@r-forge.r-project.org> Author: kingaa Date: 2013-04-16 19:00:22 +0200 (Tue, 16 Apr 2013) New Revision: 850 Modified: branches/premif2/DESCRIPTION Log: - fix DESCRIPTION file Modified: branches/premif2/DESCRIPTION =================================================================== --- branches/premif2/DESCRIPTION 2013-04-16 17:00:00 UTC (rev 849) +++ branches/premif2/DESCRIPTION 2013-04-16 17:00:22 UTC (rev 850) @@ -3,10 +3,8 @@ Title: Statistical inference for partially observed Markov processes Version: 0.43-8 Date: 2013-04-16 -Author: Aaron A. King, Edward L. Ionides, Carles Breto -Contributor: Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood Maintainer: Aaron A. King -Author at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), +Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), person(given=c("Edward","L."),family="Ionides",role=c("aut")), person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), From noreply at r-forge.r-project.org Wed Apr 17 13:27:55 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 17 Apr 2013 13:27:55 +0200 (CEST) Subject: [Pomp-commits] r851 - branches/premif2/src Message-ID: <20130417112755.8F5A8184BA3@r-forge.r-project.org> Author: kingaa Date: 2013-04-17 13:27:55 +0200 (Wed, 17 Apr 2013) New Revision: 851 Added: branches/premif2/src/SSA.f90 Removed: branches/premif2/src/SSA.f Modified: branches/premif2/src/SSA_wrapper.c Log: - fix the fortran90 in SSA.f and designate this file as fortran90 - fix minor inconsistency in SSA_wrapper.c Deleted: branches/premif2/src/SSA.f =================================================================== --- branches/premif2/src/SSA.f 2013-04-16 17:00:22 UTC (rev 850) +++ branches/premif2/src/SSA.f 2013-04-17 11:27:55 UTC (rev 851) @@ -1,354 +0,0 @@ - subroutine driverSSA(fprob,nvar,nevent,npar,nreps,ntimes,kflag, - & xstart,times,params,xout,e,v,d,nzero,izero,istate,ipar, - & ncovar,icovar,lcov,mcov,tcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension xstart(nvar,nreps), times(ntimes) - dimension params(npar,nreps), par(npar) - dimension xout(nvar,nreps,ntimes) - dimension e(nvar),v(nvar,nevent),d(nvar,nevent) - dimension izero(nzero) - dimension istate(nvar), ipar(npar), icovar(ncovar) - dimension tcov(lcov), cov(lcov,mcov) - dimension covars(mcov) - external fprob - ntreeh=1+int(log(nevent*1.0)/log(2.0)+1) - do irep=1,nreps - call SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps, - & ntimes,kflag,xstart,times,params,xout,e,v,d, - & nzero,izero,istate,ipar,ncovar,icovar,lcov,mcov, - & tcov,cov) - enddo - return - end - - subroutine SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps, - & ntimes,kflag,xstart,times,params,xout,e,v,d,nzero, - & izero,istate,ipar,ncovar,icovar,lcov,mcov,tcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension xstart(nvar,nreps), times(ntimes) - dimension params(npar,nreps), par(npar) - dimension xout(nvar,nreps,ntimes) - dimension y(nvar),f(nevent,ntreeh),k(nevent) - dimension e(nvar),v(nvar,nevent),d(nvar,nevent) - dimension izero(nzero) - dimension istate(nvar), ipar(npar), icovar(ncovar) - dimension tcov(lcov), cov(lcov,mcov) - dimension covars(mcov) - external gillespie,kleap,fprob - n=nvar - m=nevent -c================ -c Initialisation -c================ - t=times(1) - tmax=times(ntimes) - iflag=0 - icount=2 - do i=1,npar - par(i)=params(i,irep) - enddo - do i=1,n - y(i)=xstart(i,irep) - enddo -c Set appropriate states to zero - do i=1,nzero - y(izero(i)+1)=0.0d0 - enddo -c Copy initial states into xout - do i=1,n - xout(i,irep,1)=y(i) - enddo -c Initialize the covariate vector - if(mcov.gt.0)then - call tlook(lcov,mcov,tcov,cov,t,covars) - endif -c======================================== -c Initialise propensity functions & tree -c======================================== - do j=1,m - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,covars) - enddo - jdum=m - do itree=2,ntreeh - jend=int((jdum+1)/2) - do j=1,jend - if(2*j.le.jdum)then - f(j,itree)=f(2*j-1,itree-1)+f(2*j,itree-1) - else - f(j,itree)=f(2*j-1,itree-1) - endif - enddo - jdum=jend - enddo -c===== - do while(icount.le.ntimes) - call rchkusr - if(kflag.eq.0)then - call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar, - & jevent,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - else !if(kflag.eq.1)then -c================= -c Determine kappa (most accurate but slowest method) -c================= - dum=10d8 - do i=1,n - dum=min(e(i)*y(i),dum) - if(dum.le.1.0)goto 50 - enddo - 50 kappa=max(dum,1.0d0) - if(kappa.eq.1)then - call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar, - & jevent,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - else - call kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar, - & k,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - endif -c else -c=============== -c Determine tau (need to add code to avoid negative #s & determine tau) -c=============== -c tau=e(1) -c call tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar, -c & k,iflag) -c if(iflag.eq.1)goto 100 - endif -c -c Recording output at required time points -c - if (icount.le.ntimes) then - do while((icount.le.ntimes).and.(t.ge.times(icount))) - do i=1,n - xout(i,irep,icount)=y(i) - enddo -c=============================== -c Set appropriate states to zero -c=============================== - do i=1,nzero - y(izero(i)+1)=0.0d0 - enddo - icount=icount+1 - enddo - endif - - if((mcov.gt.0).and.(t.le.tmax))then - call tlook(lcov,mcov,tcov,cov,t,covars) - endif -c - enddo -c===== - 100 return - end - - subroutine gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,jevent, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),v(n,m),d(n,m),par(npar),ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external unifrnd,fprob -c================================= -c Generate uniform random numbers -c================================= - p1=unifrnd() - p2=unifrnd() -c========================================= -c Determine time interval and update time -c========================================= - fsum=f(1,ntreeh) - if(fsum.gt.0.0)then - tstep=-log(p1)/fsum - t=t+tstep - else - iflag=1 - goto 500 - endif -c========================================= -c Determine event, update pops & events -c========================================= - jtree=1 - temp=p2*fsum - do itree=ntreeh-1,1,-1 - if(itree.eq.1)then - if(temp.lt.f(jtree,itree))then - jevent=jtree - else - jevent=jtree+1 - endif - else - if(temp.lt.f(jtree,itree))then - jtree=2*jtree-1 - else - temp=temp-f(jtree,itree) - jtree=2*jtree+1 - endif - endif - enddo - do i=1,n - ichangey(i)=0 - enddo - do i = 1,n - if(v(i,jevent).ne.0)then - y(i) = y(i) + v(i,jevent) - ichangey(i)=1 - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end - - subroutine kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,k, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),p(m),v(n,m),d(n,m),par(npar) - dimension k(m),ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external gammarnd,fprob -c========================================= -c Determine time interval and update time -c========================================= - fsum=f(1,ntreeh) - if(fsum.gt.0.0d0)then - tstep=gammarnd(kappa,fsum) - t=t+tstep - else - iflag=1 - goto 500 - endif -c===================================================== -c Determine frequency of events, update pops & events -c===================================================== - do j=1,m - p(j)=f(j,1)/fsum - enddo - call multinomrnd(kappa,p,m,k) -c -c some matrix-vector multiplication but only where necessary -c - do i=1,n - ichangey(i)=0 - enddo - do j=1,m - if(k(j).ne.0)then - temp=k(j) - do i = 1,n - if(v(i,j).ne.0)then - y(i) = y(i) + temp*v(i,j) - ichangey(i)=1 - endif - enddo - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end - - subroutine tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,k, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),k(m),v(n,m),d(n,m),par(npar) - dimension ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external poisrnd,fprob -c====================================================================== -c Generate Poisson random variables (number of event firings in t+tau) -c====================================================================== - fsum=f(1,ntreeh) - if(fsum.gt.0.0d0)then - do j=1,m - k(j)=poisrnd(f(j,1)*tau) - enddo - else - iflag=1 - goto 500 - endif -c========== -c Update t -c========== - t=t+tau -c================================================ -c Compute changes in population numbers & events -c================================================ -c -c some matrix-vector multiplication but only where necessary -c - do i=1,n - ichangey(i)=0 - enddo - do j=1,m - if(k(j).ne.0)then - temp=k(j) - do i = 1,n - if(v(i,j).ne.0)then - y(i) = y(i) + temp*v(i,j) - ichangey(i)=1 - endif - enddo - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end Copied: branches/premif2/src/SSA.f90 (from rev 850, branches/premif2/src/SSA.f) =================================================================== --- branches/premif2/src/SSA.f90 (rev 0) +++ branches/premif2/src/SSA.f90 2013-04-17 11:27:55 UTC (rev 851) @@ -0,0 +1,352 @@ + subroutine driverSSA(fprob,nvar,nevent,npar,nreps,ntimes,kflag,& + xstart,times,params,xout,e,v,d,nzero,izero,istate,ipar,ncovar,& + icovar,lcov,mcov,tcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension xstart(nvar,nreps), times(ntimes) + dimension params(npar,nreps) + dimension xout(nvar,nreps,ntimes) + dimension e(nvar),v(nvar,nevent),d(nvar,nevent) + dimension izero(nzero) + dimension istate(nvar), ipar(npar), icovar(ncovar) + dimension tcov(lcov), cov(lcov,mcov) + external fprob + ntreeh=1+int(log(nevent*1.0)/log(2.0)+1) + do irep=1,nreps + call SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps,& + ntimes,kflag,xstart,times,params,xout,e,v,d,& + nzero,izero,istate,ipar,ncovar,icovar,lcov,mcov,& + tcov,cov) + enddo + return + end + + subroutine SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps,& + ntimes,kflag,xstart,times,params,xout,e,v,d,nzero,& + izero,istate,ipar,ncovar,icovar,lcov,mcov,tcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension xstart(nvar,nreps), times(ntimes) + dimension params(npar,nreps), par(npar) + dimension xout(nvar,nreps,ntimes) + dimension y(nvar),f(nevent,ntreeh),k(nevent) + dimension e(nvar),v(nvar,nevent),d(nvar,nevent) + dimension izero(nzero) + dimension istate(nvar), ipar(npar), icovar(ncovar) + dimension tcov(lcov), cov(lcov,mcov) + dimension covars(mcov) + external gillespie,kleap,fprob + n=nvar + m=nevent +!================ +! Initialisation +!================ + t=times(1) + tmax=times(ntimes) + iflag=0 + icount=2 + do i=1,npar + par(i)=params(i,irep) + enddo + do i=1,n + y(i)=xstart(i,irep) + enddo +! Set appropriate states to zero + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo +! Copy initial states into xout + do i=1,n + xout(i,irep,1)=y(i) + enddo +! Initialize the covariate vector + if(mcov.gt.0)then + call tlook(lcov,mcov,tcov,cov,t,covars) + endif +!======================================== +! Initialise propensity functions & tree +!======================================== + do j=1,m + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,covars) + enddo + jdum=m + do itree=2,ntreeh + jend=int((jdum+1)/2) + do j=1,jend + if(2*j.le.jdum)then + f(j,itree)=f(2*j-1,itree-1)+f(2*j,itree-1) + else + f(j,itree)=f(2*j-1,itree-1) + endif + enddo + jdum=jend + enddo +!===== + do while(icount.le.ntimes) + call rchkusr + if(kflag.eq.0)then + call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,& + jevent,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + else !if(kflag.eq.1)then +!================= +! Determine kappa (most accurate but slowest method) +!================= + dum=10d8 + do i=1,n + dum=min(e(i)*y(i),dum) + if(dum.le.1.0)goto 50 + enddo + 50 kappa=int(max(dum,1.0d0)) + if(kappa.eq.1)then + call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,& + jevent,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + else + call kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,& + k,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + endif +! else +!=============== +! Determine tau (need to add code to avoid negative #s & determine tau) +!=============== +! tau=e(1) +! call tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,& +! k,iflag) +! if(iflag.eq.1)goto 100 + endif +! +! Recording output at required time points +! + do while ((icount.le.ntimes).and.(t.ge.times(icount))) + do i=1,n + xout(i,irep,icount)=y(i) + enddo +!=============================== +! Set appropriate states to zero +!=============================== + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo + icount=icount+1 + if (icount.gt.ntimes) exit + enddo + + if((mcov.gt.0).and.(t.le.tmax))then + call tlook(lcov,mcov,tcov,cov,t,covars) + endif +! + enddo +!===== + 100 return + end + + subroutine gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,jevent,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),v(n,m),d(n,m),par(npar),ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external unifrnd,fprob +!================================= +! Generate uniform random numbers +!================================= + p1=unifrnd() + p2=unifrnd() +!========================================= +! Determine time interval and update time +!========================================= + fsum=f(1,ntreeh) + if(fsum.gt.0.0)then + tstep=-log(p1)/fsum + t=t+tstep + else + iflag=1 + goto 500 + endif +!========================================= +! Determine event, update pops & events +!========================================= + jtree=1 + temp=p2*fsum + do itree=ntreeh-1,1,-1 + if(itree.eq.1)then + if(temp.lt.f(jtree,itree))then + jevent=jtree + else + jevent=jtree+1 + endif + else + if(temp.lt.f(jtree,itree))then + jtree=2*jtree-1 + else + temp=temp-f(jtree,itree) + jtree=2*jtree+1 + endif + endif + enddo + do i=1,n + ichangey(i)=0 + enddo + do i = 1,n + if(v(i,jevent).ne.0)then + y(i) = y(i) + v(i,jevent) + ichangey(i)=1 + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end + + subroutine kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,k,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),p(m),v(n,m),d(n,m),par(npar) + dimension k(m),ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external gammarnd,fprob +!========================================= +! Determine time interval and update time +!========================================= + fsum=f(1,ntreeh) + if(fsum.gt.0.0d0)then + tstep=gammarnd(kappa,fsum) + t=t+tstep + else + iflag=1 + goto 500 + endif +!===================================================== +! Determine frequency of events, update pops & events +!===================================================== + do j=1,m + p(j)=f(j,1)/fsum + enddo + call multinomrnd(kappa,p,m,k) +! +! some matrix-vector multiplication but only where necessary +! + do i=1,n + ichangey(i)=0 + enddo + do j=1,m + if(k(j).ne.0)then + temp=k(j) + do i = 1,n + if(v(i,j).ne.0)then + y(i) = y(i) + temp*v(i,j) + ichangey(i)=1 + endif + enddo + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end + + subroutine tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,k,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),k(m),v(n,m),d(n,m),par(npar) + dimension ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external poisrnd,fprob +!====================================================================== +! Generate Poisson random variables (number of event firings in t+tau) +!====================================================================== + fsum=f(1,ntreeh) + if(fsum.gt.0.0d0)then + do j=1,m + k(j)=int(poisrnd(f(j,1)*tau)) + enddo + else + iflag=1 + goto 500 + endif +!========== +! Update t +!========== + t=t+tau +!================================================ +! Compute changes in population numbers & events +!================================================ +! +! some matrix-vector multiplication but only where necessary +! + do i=1,n + ichangey(i)=0 + enddo + do j=1,m + if(k(j).ne.0)then + temp=k(j) + do i = 1,n + if(v(i,j).ne.0)then + y(i) = y(i) + temp*v(i,j) + ichangey(i)=1 + endif + enddo + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end Modified: branches/premif2/src/SSA_wrapper.c =================================================================== --- branches/premif2/src/SSA_wrapper.c 2013-04-16 17:00:22 UTC (rev 850) +++ branches/premif2/src/SSA_wrapper.c 2013-04-17 11:27:55 UTC (rev 851) @@ -15,7 +15,7 @@ double F77_SUB(gammarnd)(double shape, double scale) { return rgamma(shape,scale); } void F77_SUB(multinomrnd)(int N, double *p, int ncat, int *ix) { rmultinom(N,p,ncat,ix); } -void F77_NAME(driverssa)(_pomp_rxnrate *fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, +void F77_NAME(driverssa)(_pomp_rxnrate fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, int *kflag, double *xstart, double *times, double *params, double *xout, double *e, double *v, double *d, int *nzero, int *izero, int *istate, int *ipar, int *ncov, int *icov, int *lcov, int *mcov, double *tcov, double *cov); From noreply at r-forge.r-project.org Wed Apr 17 14:14:12 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 17 Apr 2013 14:14:12 +0200 (CEST) Subject: [Pomp-commits] r852 - pkg/pomp/src Message-ID: <20130417121412.5CA8318501D@r-forge.r-project.org> Author: kingaa Date: 2013-04-17 14:14:11 +0200 (Wed, 17 Apr 2013) New Revision: 852 Added: pkg/pomp/src/SSA.f90 Removed: pkg/pomp/src/SSA.f Modified: pkg/pomp/src/SSA_wrapper.c Log: - fix the fortran90 in SSA.f and designate this file as fortran90 - fix minor inconsistency in SSA_wrapper.c Deleted: pkg/pomp/src/SSA.f =================================================================== --- pkg/pomp/src/SSA.f 2013-04-17 11:27:55 UTC (rev 851) +++ pkg/pomp/src/SSA.f 2013-04-17 12:14:11 UTC (rev 852) @@ -1,354 +0,0 @@ - subroutine driverSSA(fprob,nvar,nevent,npar,nreps,ntimes,kflag, - & xstart,times,params,xout,e,v,d,nzero,izero,istate,ipar, - & ncovar,icovar,lcov,mcov,tcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension xstart(nvar,nreps), times(ntimes) - dimension params(npar,nreps), par(npar) - dimension xout(nvar,nreps,ntimes) - dimension e(nvar),v(nvar,nevent),d(nvar,nevent) - dimension izero(nzero) - dimension istate(nvar), ipar(npar), icovar(ncovar) - dimension tcov(lcov), cov(lcov,mcov) - dimension covars(mcov) - external fprob - ntreeh=1+int(log(nevent*1.0)/log(2.0)+1) - do irep=1,nreps - call SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps, - & ntimes,kflag,xstart,times,params,xout,e,v,d, - & nzero,izero,istate,ipar,ncovar,icovar,lcov,mcov, - & tcov,cov) - enddo - return - end - - subroutine SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps, - & ntimes,kflag,xstart,times,params,xout,e,v,d,nzero, - & izero,istate,ipar,ncovar,icovar,lcov,mcov,tcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension xstart(nvar,nreps), times(ntimes) - dimension params(npar,nreps), par(npar) - dimension xout(nvar,nreps,ntimes) - dimension y(nvar),f(nevent,ntreeh),k(nevent) - dimension e(nvar),v(nvar,nevent),d(nvar,nevent) - dimension izero(nzero) - dimension istate(nvar), ipar(npar), icovar(ncovar) - dimension tcov(lcov), cov(lcov,mcov) - dimension covars(mcov) - external gillespie,kleap,fprob - n=nvar - m=nevent -c================ -c Initialisation -c================ - t=times(1) - tmax=times(ntimes) - iflag=0 - icount=2 - do i=1,npar - par(i)=params(i,irep) - enddo - do i=1,n - y(i)=xstart(i,irep) - enddo -c Set appropriate states to zero - do i=1,nzero - y(izero(i)+1)=0.0d0 - enddo -c Copy initial states into xout - do i=1,n - xout(i,irep,1)=y(i) - enddo -c Initialize the covariate vector - if(mcov.gt.0)then - call tlook(lcov,mcov,tcov,cov,t,covars) - endif -c======================================== -c Initialise propensity functions & tree -c======================================== - do j=1,m - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,covars) - enddo - jdum=m - do itree=2,ntreeh - jend=int((jdum+1)/2) - do j=1,jend - if(2*j.le.jdum)then - f(j,itree)=f(2*j-1,itree-1)+f(2*j,itree-1) - else - f(j,itree)=f(2*j-1,itree-1) - endif - enddo - jdum=jend - enddo -c===== - do while(icount.le.ntimes) - call rchkusr - if(kflag.eq.0)then - call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar, - & jevent,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - else !if(kflag.eq.1)then -c================= -c Determine kappa (most accurate but slowest method) -c================= - dum=10d8 - do i=1,n - dum=min(e(i)*y(i),dum) - if(dum.le.1.0)goto 50 - enddo - 50 kappa=max(dum,1.0d0) - if(kappa.eq.1)then - call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar, - & jevent,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - else - call kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar, - & k,iflag,istate,ipar,ncovar,icovar, - & mcov,covars) - if(iflag.eq.1)goto 100 - endif -c else -c=============== -c Determine tau (need to add code to avoid negative #s & determine tau) -c=============== -c tau=e(1) -c call tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar, -c & k,iflag) -c if(iflag.eq.1)goto 100 - endif -c -c Recording output at required time points -c - if (icount.le.ntimes) then - do while((icount.le.ntimes).and.(t.ge.times(icount))) - do i=1,n - xout(i,irep,icount)=y(i) - enddo -c=============================== -c Set appropriate states to zero -c=============================== - do i=1,nzero - y(izero(i)+1)=0.0d0 - enddo - icount=icount+1 - enddo - endif - - if((mcov.gt.0).and.(t.le.tmax))then - call tlook(lcov,mcov,tcov,cov,t,covars) - endif -c - enddo -c===== - 100 return - end - - subroutine gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,jevent, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),v(n,m),d(n,m),par(npar),ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external unifrnd,fprob -c================================= -c Generate uniform random numbers -c================================= - p1=unifrnd() - p2=unifrnd() -c========================================= -c Determine time interval and update time -c========================================= - fsum=f(1,ntreeh) - if(fsum.gt.0.0)then - tstep=-log(p1)/fsum - t=t+tstep - else - iflag=1 - goto 500 - endif -c========================================= -c Determine event, update pops & events -c========================================= - jtree=1 - temp=p2*fsum - do itree=ntreeh-1,1,-1 - if(itree.eq.1)then - if(temp.lt.f(jtree,itree))then - jevent=jtree - else - jevent=jtree+1 - endif - else - if(temp.lt.f(jtree,itree))then - jtree=2*jtree-1 - else - temp=temp-f(jtree,itree) - jtree=2*jtree+1 - endif - endif - enddo - do i=1,n - ichangey(i)=0 - enddo - do i = 1,n - if(v(i,jevent).ne.0)then - y(i) = y(i) + v(i,jevent) - ichangey(i)=1 - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end - - subroutine kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,k, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),p(m),v(n,m),d(n,m),par(npar) - dimension k(m),ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external gammarnd,fprob -c========================================= -c Determine time interval and update time -c========================================= - fsum=f(1,ntreeh) - if(fsum.gt.0.0d0)then - tstep=gammarnd(kappa,fsum) - t=t+tstep - else - iflag=1 - goto 500 - endif -c===================================================== -c Determine frequency of events, update pops & events -c===================================================== - do j=1,m - p(j)=f(j,1)/fsum - enddo - call multinomrnd(kappa,p,m,k) -c -c some matrix-vector multiplication but only where necessary -c - do i=1,n - ichangey(i)=0 - enddo - do j=1,m - if(k(j).ne.0)then - temp=k(j) - do i = 1,n - if(v(i,j).ne.0)then - y(i) = y(i) + temp*v(i,j) - ichangey(i)=1 - endif - enddo - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end - - subroutine tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,k, - & iflag,istate,ipar,ncovar,icovar,mcov,cov) - implicit integer (i-n) - implicit double precision (a-h,o-z) - dimension y(n),f(m,ntreeh),k(m),v(n,m),d(n,m),par(npar) - dimension ichangey(n) - dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) - external poisrnd,fprob -c====================================================================== -c Generate Poisson random variables (number of event firings in t+tau) -c====================================================================== - fsum=f(1,ntreeh) - if(fsum.gt.0.0d0)then - do j=1,m - k(j)=poisrnd(f(j,1)*tau) - enddo - else - iflag=1 - goto 500 - endif -c========== -c Update t -c========== - t=t+tau -c================================================ -c Compute changes in population numbers & events -c================================================ -c -c some matrix-vector multiplication but only where necessary -c - do i=1,n - ichangey(i)=0 - enddo - do j=1,m - if(k(j).ne.0)then - temp=k(j) - do i = 1,n - if(v(i,j).ne.0)then - y(i) = y(i) + temp*v(i,j) - ichangey(i)=1 - endif - enddo - endif - enddo -c -c only updating events & tree entries that have changed -c - do j=1,m - do i=1,n - if(ichangey(i).ne.0.and.d(i,j).ne.0)then - fold=f(j,1) - f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) - diff=f(j,1)-fold - jdum=int((j+1)/2) - do itree=2,ntreeh - f(jdum,itree)=f(jdum,itree)+diff - jdum=int((jdum+1)/2) - enddo - goto 400 - endif - enddo - 400 continue - enddo - 500 return - end Copied: pkg/pomp/src/SSA.f90 (from rev 850, pkg/pomp/src/SSA.f) =================================================================== --- pkg/pomp/src/SSA.f90 (rev 0) +++ pkg/pomp/src/SSA.f90 2013-04-17 12:14:11 UTC (rev 852) @@ -0,0 +1,352 @@ + subroutine driverSSA(fprob,nvar,nevent,npar,nreps,ntimes,kflag,& + xstart,times,params,xout,e,v,d,nzero,izero,istate,ipar,ncovar,& + icovar,lcov,mcov,tcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension xstart(nvar,nreps), times(ntimes) + dimension params(npar,nreps) + dimension xout(nvar,nreps,ntimes) + dimension e(nvar),v(nvar,nevent),d(nvar,nevent) + dimension izero(nzero) + dimension istate(nvar), ipar(npar), icovar(ncovar) + dimension tcov(lcov), cov(lcov,mcov) + external fprob + ntreeh=1+int(log(nevent*1.0)/log(2.0)+1) + do irep=1,nreps + call SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps,& + ntimes,kflag,xstart,times,params,xout,e,v,d,& + nzero,izero,istate,ipar,ncovar,icovar,lcov,mcov,& + tcov,cov) + enddo + return + end + + subroutine SSA(fprob,irep,nvar,nevent,ntreeh,npar,nreps,& + ntimes,kflag,xstart,times,params,xout,e,v,d,nzero,& + izero,istate,ipar,ncovar,icovar,lcov,mcov,tcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension xstart(nvar,nreps), times(ntimes) + dimension params(npar,nreps), par(npar) + dimension xout(nvar,nreps,ntimes) + dimension y(nvar),f(nevent,ntreeh),k(nevent) + dimension e(nvar),v(nvar,nevent),d(nvar,nevent) + dimension izero(nzero) + dimension istate(nvar), ipar(npar), icovar(ncovar) + dimension tcov(lcov), cov(lcov,mcov) + dimension covars(mcov) + external gillespie,kleap,fprob + n=nvar + m=nevent +!================ +! Initialisation +!================ + t=times(1) + tmax=times(ntimes) + iflag=0 + icount=2 + do i=1,npar + par(i)=params(i,irep) + enddo + do i=1,n + y(i)=xstart(i,irep) + enddo +! Set appropriate states to zero + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo +! Copy initial states into xout + do i=1,n + xout(i,irep,1)=y(i) + enddo +! Initialize the covariate vector + if(mcov.gt.0)then + call tlook(lcov,mcov,tcov,cov,t,covars) + endif +!======================================== +! Initialise propensity functions & tree +!======================================== + do j=1,m + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,covars) + enddo + jdum=m + do itree=2,ntreeh + jend=int((jdum+1)/2) + do j=1,jend + if(2*j.le.jdum)then + f(j,itree)=f(2*j-1,itree-1)+f(2*j,itree-1) + else + f(j,itree)=f(2*j-1,itree-1) + endif + enddo + jdum=jend + enddo +!===== + do while(icount.le.ntimes) + call rchkusr + if(kflag.eq.0)then + call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,& + jevent,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + else !if(kflag.eq.1)then +!================= +! Determine kappa (most accurate but slowest method) +!================= + dum=10d8 + do i=1,n + dum=min(e(i)*y(i),dum) + if(dum.le.1.0)goto 50 + enddo + 50 kappa=int(max(dum,1.0d0)) + if(kappa.eq.1)then + call gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,& + jevent,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + else + call kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,& + k,iflag,istate,ipar,ncovar,icovar,& + mcov,covars) + if(iflag.eq.1)goto 100 + endif +! else +!=============== +! Determine tau (need to add code to avoid negative #s & determine tau) +!=============== +! tau=e(1) +! call tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,& +! k,iflag) +! if(iflag.eq.1)goto 100 + endif +! +! Recording output at required time points +! + do while ((icount.le.ntimes).and.(t.ge.times(icount))) + do i=1,n + xout(i,irep,icount)=y(i) + enddo +!=============================== +! Set appropriate states to zero +!=============================== + do i=1,nzero + y(izero(i)+1)=0.0d0 + enddo + icount=icount+1 + if (icount.gt.ntimes) exit + enddo + + if((mcov.gt.0).and.(t.le.tmax))then + call tlook(lcov,mcov,tcov,cov,t,covars) + endif +! + enddo +!===== + 100 return + end + + subroutine gillespie(fprob,t,f,y,v,d,par,n,m,ntreeh,npar,jevent,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),v(n,m),d(n,m),par(npar),ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external unifrnd,fprob +!================================= +! Generate uniform random numbers +!================================= + p1=unifrnd() + p2=unifrnd() +!========================================= +! Determine time interval and update time +!========================================= + fsum=f(1,ntreeh) + if(fsum.gt.0.0)then + tstep=-log(p1)/fsum + t=t+tstep + else + iflag=1 + goto 500 + endif +!========================================= +! Determine event, update pops & events +!========================================= + jtree=1 + temp=p2*fsum + do itree=ntreeh-1,1,-1 + if(itree.eq.1)then + if(temp.lt.f(jtree,itree))then + jevent=jtree + else + jevent=jtree+1 + endif + else + if(temp.lt.f(jtree,itree))then + jtree=2*jtree-1 + else + temp=temp-f(jtree,itree) + jtree=2*jtree+1 + endif + endif + enddo + do i=1,n + ichangey(i)=0 + enddo + do i = 1,n + if(v(i,jevent).ne.0)then + y(i) = y(i) + v(i,jevent) + ichangey(i)=1 + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end + + subroutine kleap(fprob,kappa,t,f,y,v,d,par,n,m,ntreeh,npar,k,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),p(m),v(n,m),d(n,m),par(npar) + dimension k(m),ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external gammarnd,fprob +!========================================= +! Determine time interval and update time +!========================================= + fsum=f(1,ntreeh) + if(fsum.gt.0.0d0)then + tstep=gammarnd(kappa,fsum) + t=t+tstep + else + iflag=1 + goto 500 + endif +!===================================================== +! Determine frequency of events, update pops & events +!===================================================== + do j=1,m + p(j)=f(j,1)/fsum + enddo + call multinomrnd(kappa,p,m,k) +! +! some matrix-vector multiplication but only where necessary +! + do i=1,n + ichangey(i)=0 + enddo + do j=1,m + if(k(j).ne.0)then + temp=k(j) + do i = 1,n + if(v(i,j).ne.0)then + y(i) = y(i) + temp*v(i,j) + ichangey(i)=1 + endif + enddo + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end + + subroutine tauleap(fprob,tau,t,f,y,v,d,par,n,m,ntreeh,npar,k,& + iflag,istate,ipar,ncovar,icovar,mcov,cov) + implicit integer (i-n) + implicit double precision (a-h,o-z) + dimension y(n),f(m,ntreeh),k(m),v(n,m),d(n,m),par(npar) + dimension ichangey(n) + dimension istate(n),ipar(npar),icovar(ncovar),cov(mcov) + external poisrnd,fprob +!====================================================================== +! Generate Poisson random variables (number of event firings in t+tau) +!====================================================================== + fsum=f(1,ntreeh) + if(fsum.gt.0.0d0)then + do j=1,m + k(j)=int(poisrnd(f(j,1)*tau)) + enddo + else + iflag=1 + goto 500 + endif +!========== +! Update t +!========== + t=t+tau +!================================================ +! Compute changes in population numbers & events +!================================================ +! +! some matrix-vector multiplication but only where necessary +! + do i=1,n + ichangey(i)=0 + enddo + do j=1,m + if(k(j).ne.0)then + temp=k(j) + do i = 1,n + if(v(i,j).ne.0)then + y(i) = y(i) + temp*v(i,j) + ichangey(i)=1 + endif + enddo + endif + enddo +! +! only updating events & tree entries that have changed +! + do j=1,m + do i=1,n + if(ichangey(i).ne.0.and.d(i,j).ne.0)then + fold=f(j,1) + f(j,1)=fprob(j,t,y,par,istate,ipar,icovar,mcov,cov) + diff=f(j,1)-fold + jdum=int((j+1)/2) + do itree=2,ntreeh + f(jdum,itree)=f(jdum,itree)+diff + jdum=int((jdum+1)/2) + enddo + goto 400 + endif + enddo + 400 continue + enddo + 500 return + end Modified: pkg/pomp/src/SSA_wrapper.c =================================================================== --- pkg/pomp/src/SSA_wrapper.c 2013-04-17 11:27:55 UTC (rev 851) +++ pkg/pomp/src/SSA_wrapper.c 2013-04-17 12:14:11 UTC (rev 852) @@ -15,7 +15,7 @@ double F77_SUB(gammarnd)(double shape, double scale) { return rgamma(shape,scale); } void F77_SUB(multinomrnd)(int N, double *p, int ncat, int *ix) { rmultinom(N,p,ncat,ix); } -void F77_NAME(driverssa)(_pomp_rxnrate *fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, +void F77_NAME(driverssa)(_pomp_rxnrate fprob, int *nvar, int *nevent, int *npar, int *nreps, int *ntimes, int *kflag, double *xstart, double *times, double *params, double *xout, double *e, double *v, double *d, int *nzero, int *izero, int *istate, int *ipar, int *ncov, int *icov, int *lcov, int *mcov, double *tcov, double *cov); From noreply at r-forge.r-project.org Wed Apr 17 14:21:19 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 17 Apr 2013 14:21:19 +0200 (CEST) Subject: [Pomp-commits] r853 - pkg/pomp Message-ID: <20130417122119.3823B18465C@r-forge.r-project.org> Author: kingaa Date: 2013-04-17 14:21:18 +0200 (Wed, 17 Apr 2013) New Revision: 853 Modified: pkg/pomp/DESCRIPTION Log: - update DESCRIPTION file Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2013-04-17 12:14:11 UTC (rev 852) +++ pkg/pomp/DESCRIPTION 2013-04-17 12:21:18 UTC (rev 853) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.44-4 -Date: 2013-04-16 +Date: 2013-04-17 Maintainer: Aaron A. King Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), person(given=c("Edward","L."),family="Ionides",role=c("aut")), From noreply at r-forge.r-project.org Mon Apr 22 14:02:38 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 22 Apr 2013 14:02:38 +0200 (CEST) Subject: [Pomp-commits] r854 - in pkg/pompExamples: . man tests Message-ID: <20130422120238.F3BA9184988@r-forge.r-project.org> Author: kingaa Date: 2013-04-22 14:02:38 +0200 (Mon, 22 Apr 2013) New Revision: 854 Modified: pkg/pompExamples/DESCRIPTION pkg/pompExamples/man/budmoth.Rd pkg/pompExamples/man/pertussis.Rd pkg/pompExamples/tests/budmoth.R pkg/pompExamples/tests/pertussis.R Log: - update DESCRIPTION file - fix errors in man pages Modified: pkg/pompExamples/DESCRIPTION =================================================================== --- pkg/pompExamples/DESCRIPTION 2013-04-17 12:21:18 UTC (rev 853) +++ pkg/pompExamples/DESCRIPTION 2013-04-22 12:02:38 UTC (rev 854) @@ -2,11 +2,20 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.21-1 -Date: 2013-01-13 -Author: NCEAS Working Group on Inference for Mechanistic Models: Aaron King, Steve Ellner, Bruce Kendall, Daniel C. Reuman, Matt Ferrari, Ed Ionides, Helen Wearing +Date: 2013-04-22 Maintainer: Aaron A. King -Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.14.2), stats, methods, graphics, pomp(>= 0.42-2) +Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), + person(given=c("Edward","L."),family="Ionides",role=c("aut")), + person(given=c("Carles"),family="Breto",role=c("aut")), + person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), + person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), + person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), + person(given=c("Michael"),family="Lavine",role=c("ctb")), + person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), + person(given=c("Helen"),family="Wearing",role=c("ctb"))) +URL: http://pomp.r-forge.r-project.org +Description: More 'pomp' examples. +Depends: R(>= 3.0.0), stats, methods, graphics, pomp(>= 0.43-8) License: GPL (>= 2) LazyLoad: true LazyData: false Modified: pkg/pompExamples/man/budmoth.Rd =================================================================== --- pkg/pompExamples/man/budmoth.Rd 2013-04-17 12:21:18 UTC (rev 853) +++ pkg/pompExamples/man/budmoth.Rd 2013-04-22 12:02:38 UTC (rev 854) @@ -22,5 +22,5 @@ plot(budmoth.sim(para2)) plot(budmoth.sim(tri)) } -\seealso{the dQuote{budmoth-model} vignette} +\seealso{the \dQuote{budmoth-model} vignette} \keyword{datasets} Modified: pkg/pompExamples/man/pertussis.Rd =================================================================== --- pkg/pompExamples/man/pertussis.Rd 2013-04-17 12:21:18 UTC (rev 853) +++ pkg/pompExamples/man/pertussis.Rd 2013-04-22 12:02:38 UTC (rev 854) @@ -20,5 +20,5 @@ plot(pertussis.sim(SEIRR.small)) plot(pertussis.sim(full.big)) } -\seealso{the dQuote{pertussis-model} vignette} +\seealso{the \dQuote{pertussis-model} vignette} \keyword{datasets} Modified: pkg/pompExamples/tests/budmoth.R =================================================================== --- pkg/pompExamples/tests/budmoth.R 2013-04-17 12:21:18 UTC (rev 853) +++ pkg/pompExamples/tests/budmoth.R 2013-04-22 12:02:38 UTC (rev 854) @@ -1,4 +1,4 @@ -require(pompExamples) +library(pompExamples) all <- c("food","para1","para2","tri") Modified: pkg/pompExamples/tests/pertussis.R =================================================================== --- pkg/pompExamples/tests/pertussis.R 2013-04-17 12:21:18 UTC (rev 853) +++ pkg/pompExamples/tests/pertussis.R 2013-04-22 12:02:38 UTC (rev 854) @@ -1,4 +1,4 @@ -require(pompExamples) +library(pompExamples) all <- c("SEIR.small","SEIR.big","SEIRS.small","SEIRS.big","SEIRR.small","SEIRR.big","full.small","full.big")