From noreply at r-forge.r-project.org Tue Apr 1 09:54:20 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 1 Apr 2014 09:54:20 +0200 (CEST) Subject: [Pomp-commits] r915 - in pkg: . tao tao/R tao/inst tao/man Message-ID: <20140401075420.2FA46186E19@r-forge.r-project.org> Author: kingaa Date: 2014-04-01 09:54:19 +0200 (Tue, 01 Apr 2014) New Revision: 915 Added: pkg/tao/ pkg/tao/DESCRIPTION pkg/tao/NAMESPACE pkg/tao/R/ pkg/tao/R/do.nothing.R pkg/tao/R/do.nothing.else.R pkg/tao/inst/ pkg/tao/inst/GPL pkg/tao/inst/NEWS pkg/tao/man/ pkg/tao/man/do.nothing.Rd pkg/tao/man/tao.Rd Log: 2014-04-01 Added: pkg/tao/DESCRIPTION =================================================================== --- pkg/tao/DESCRIPTION (rev 0) +++ pkg/tao/DESCRIPTION 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,9 @@ +Package: tao +Version: 1.0-1 +Date: 2014-04-01 +Title: The great Tao package +Author: Lao Tsu, Aaron A. King, Bruce E. Kendall, Steve Ellner +Maintainer: Aaron A. King +Depends: R(>= 3.0.0) +Description: The package that can be described is not the Tao package. +License: GPL(>= 2) Added: pkg/tao/NAMESPACE =================================================================== --- pkg/tao/NAMESPACE (rev 0) +++ pkg/tao/NAMESPACE 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,4 @@ +export( + do.nothing, + do.nothing.else + ) Added: pkg/tao/R/do.nothing.R =================================================================== --- pkg/tao/R/do.nothing.R (rev 0) +++ pkg/tao/R/do.nothing.R 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,3 @@ +do.nothing <- function (...) { + invisible(NULL) +} Added: pkg/tao/R/do.nothing.else.R =================================================================== --- pkg/tao/R/do.nothing.else.R (rev 0) +++ pkg/tao/R/do.nothing.else.R 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,6 @@ +do.nothing.else <- function (...) { + while (TRUE) { + do.nothing(...) + } + invisible(NULL) +} Added: pkg/tao/inst/GPL =================================================================== --- pkg/tao/inst/GPL (rev 0) +++ pkg/tao/inst/GPL 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,118 @@ + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + Copyright (C) 19yy + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Added: pkg/tao/inst/NEWS =================================================================== Added: pkg/tao/man/do.nothing.Rd =================================================================== --- pkg/tao/man/do.nothing.Rd (rev 0) +++ pkg/tao/man/do.nothing.Rd 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,27 @@ +\name{do.nothing} +\alias{do.nothing} +\alias{do.nothing.else} +\title{Do nothing, do not do nothing.} +\description{ + Nothing is done, nothing is left undone. +} +\usage{ +do.nothing(\dots) +do.nothing.else(\dots) +} +\arguments{ + \item{\dots}{Arguments avail not.} +} +\value{ + Practice not-doing, and everything will fall into place. +} +\details{If nothing is done, then all will be well.} +\author{Lao Tsu, Aaron A. King} +\examples{ +do.nothing() +\dontrun{ +do.nothing.else() +} +} +\keyword{programming} + Added: pkg/tao/man/tao.Rd =================================================================== --- pkg/tao/man/tao.Rd (rev 0) +++ pkg/tao/man/tao.Rd 2014-04-01 07:54:19 UTC (rev 915) @@ -0,0 +1,22 @@ +\name{tao-package} +\docType{package} +\alias{tao-package} +\title{That which cannot be packaged.} +\description{The package that can be described is not the great Tao package.} +\details{ + Without opening your door,\cr + you can open your heart to the world.\cr + Without looking out your window,\cr + you can see the essence of the Tao.\cr\cr + The more you know,\cr + the less you understand.\cr\cr + The Master arrives without leaving,\cr\cr + sees the light without looking,\cr + achieves without doing a thing\cr +} +\references{ + Lao Tsu, Tao Te Ching. +} +\author{Lao Tsu, Aaron A. King} +\seealso{\code{\link{do.nothing}}, \code{\link{do.nothing.else}}} +\keyword{programming} From noreply at r-forge.r-project.org Tue Apr 1 21:48:44 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 1 Apr 2014 21:48:44 +0200 (CEST) Subject: [Pomp-commits] r916 - pkg/tao Message-ID: <20140401194844.21F96186D26@r-forge.r-project.org> Author: kingaa Date: 2014-04-01 21:48:43 +0200 (Tue, 01 Apr 2014) New Revision: 916 Modified: pkg/tao/DESCRIPTION Log: Modified: pkg/tao/DESCRIPTION =================================================================== --- pkg/tao/DESCRIPTION 2014-04-01 07:54:19 UTC (rev 915) +++ pkg/tao/DESCRIPTION 2014-04-01 19:48:43 UTC (rev 916) @@ -2,7 +2,7 @@ Version: 1.0-1 Date: 2014-04-01 Title: The great Tao package -Author: Lao Tsu, Aaron A. King, Bruce E. Kendall, Steve Ellner +Author: Lao Tsu, Aaron A. King, Bruce E. Kendall, Stephen P. Ellner Maintainer: Aaron A. King Depends: R(>= 3.0.0) Description: The package that can be described is not the Tao package. From noreply at r-forge.r-project.org Mon Apr 7 23:15:08 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 7 Apr 2014 23:15:08 +0200 (CEST) Subject: [Pomp-commits] r917 - in pkg/pomp: . R inst/doc Message-ID: <20140407211508.24054186F0F@r-forge.r-project.org> Author: kingaa Date: 2014-04-07 23:15:07 +0200 (Mon, 07 Apr 2014) New Revision: 917 Removed: pkg/pomp/R/mif-class.R pkg/pomp/R/particles-mif.R Modified: pkg/pomp/DESCRIPTION pkg/pomp/R/mif-methods.R pkg/pomp/R/mif.R pkg/pomp/inst/doc/manual.pdf Log: - consolidate some files Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-01 19:48:43 UTC (rev 916) +++ pkg/pomp/DESCRIPTION 2014-04-07 21:15:07 UTC (rev 917) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.49-3 -Date: 2014-03-31 +Version: 0.49-4 +Date: 2014-04-07 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")), @@ -32,7 +32,7 @@ dprior-pomp.R rprior-pomp.R simulate-pomp.R trajectory-pomp.R plot-pomp.R pfilter.R pfilter-methods.R minim.R traj-match.R bsmc.R - mif-class.R particles-mif.R mif.R mif-methods.R compare-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 Deleted: pkg/pomp/R/mif-class.R =================================================================== --- pkg/pomp/R/mif-class.R 2014-04-01 19:48:43 UTC (rev 916) +++ pkg/pomp/R/mif-class.R 2014-04-07 21:15:07 UTC (rev 917) @@ -1,19 +0,0 @@ -## define the mif class -setClass( - 'mif', - contains='pfilterd.pomp', - representation=representation( - transform = "logical", - ivps = 'character', - pars = 'character', - Nmif = 'integer', - particles = 'function', - var.factor='numeric', - ic.lag='integer', - cooling.type='character', - cooling.fraction='numeric', - method='character', - random.walk.sd = 'numeric', - conv.rec = 'matrix' - ) - ) Modified: pkg/pomp/R/mif-methods.R =================================================================== --- pkg/pomp/R/mif-methods.R 2014-04-01 19:48:43 UTC (rev 916) +++ pkg/pomp/R/mif-methods.R 2014-04-07 21:15:07 UTC (rev 917) @@ -1,5 +1,46 @@ ## this file contains short definitions of methods for the 'mif' class +## draw a set of Np particles from the user-specified distribution +particles.internal <- function (object, Np = 1, center = coef(object), sd = 0, ...) { + if ((length(sd)==1) && (sd == 0)) { + sd <- rep(0,length(center)) + names(sd) <- names(center) + } + if (is.null(names(center)) || is.null(names(sd))) + stop("particles error: ",sQuote("center")," and ",sQuote("sd")," must have names",call.=FALSE) + if (length(sd)!=length(center)) + stop("particles error: ",sQuote("center")," and ",sQuote("sd")," must be of equal length",call.=FALSE) + x <- try( + do.call( + object at particles, + c( + list(Np=Np,center=center,sd=sd), + object at userdata + ) + ), + silent=FALSE + ) + if (inherits(x,'try-error')) + stop("particles error: error in user-specified ",sQuote("particles")," function",call.=FALSE) + if ( + !is.matrix(x) || + Np!=ncol(x) || + is.null(rownames(x)) + ) + stop("particles error: user ",sQuote("particles")," function must return a matrix with Np columns and rownames",call.=FALSE) + x +} + +setMethod( + "particles", + signature=signature(object="mif"), + definition=function (object, Np = 1, center = coef(object), + sd = 0, ...) { + particles.internal(object=object,Np=Np,center=center,sd=sd,...) + } + ) + + ## extract the estimated log likelihood setMethod('logLik','mif',function(object,...)object at loglik) Modified: pkg/pomp/R/mif.R =================================================================== --- pkg/pomp/R/mif.R 2014-04-01 19:48:43 UTC (rev 916) +++ pkg/pomp/R/mif.R 2014-04-07 21:15:07 UTC (rev 917) @@ -1,5 +1,26 @@ ## MIF algorithm functions +## define the mif class +setClass( + 'mif', + contains='pfilterd.pomp', + representation=representation( + transform = "logical", + ivps = 'character', + pars = 'character', + Nmif = 'integer', + particles = 'function', + var.factor='numeric', + ic.lag='integer', + cooling.type='character', + cooling.fraction='numeric', + method='character', + random.walk.sd = 'numeric', + conv.rec = 'matrix' + ) + ) + + default.pomp.particles.fun <- function (Np, center, sd, ...) { matrix( data=rnorm( Deleted: pkg/pomp/R/particles-mif.R =================================================================== --- pkg/pomp/R/particles-mif.R 2014-04-01 19:48:43 UTC (rev 916) +++ pkg/pomp/R/particles-mif.R 2014-04-07 21:15:07 UTC (rev 917) @@ -1,37 +0,0 @@ -## draw a set of Np particles from the user-specified distribution - -particles.internal <- function (object, Np = 1, center = coef(object), sd = 0, ...) { - if ((length(sd)==1) && (sd == 0)) { - sd <- rep(0,length(center)) - names(sd) <- names(center) - } - if (is.null(names(center)) || is.null(names(sd))) - stop("particles error: ",sQuote("center")," and ",sQuote("sd")," must have names",call.=FALSE) - if (length(sd)!=length(center)) - stop("particles error: ",sQuote("center")," and ",sQuote("sd")," must be of equal length",call.=FALSE) - x <- try( - do.call( - object at particles, - c( - list(Np=Np,center=center,sd=sd), - object at userdata - ) - ), - silent=FALSE - ) - if (inherits(x,'try-error')) - stop("particles error: error in user-specified ",sQuote("particles")," function",call.=FALSE) - if ( - !is.matrix(x) || - Np!=ncol(x) || - is.null(rownames(x)) - ) - stop("particles error: user ",sQuote("particles")," function must return a matrix with Np columns and rownames",call.=FALSE) - x -} - -setMethod("particles",signature=signature(object="mif"), - function (object, Np = 1, center = coef(object), sd = 0, ...) { - particles.internal(object=object,Np=Np,center=center,sd=sd,...) - } - ) Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Thu Apr 10 15:56:15 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 10 Apr 2014 15:56:15 +0200 (CEST) Subject: [Pomp-commits] r918 - in pkg/tao: . inst Message-ID: <20140410135615.2077E18708F@r-forge.r-project.org> Author: kingaa Date: 2014-04-10 15:56:14 +0200 (Thu, 10 Apr 2014) New Revision: 918 Removed: pkg/tao/inst/NEWS Modified: pkg/tao/NAMESPACE Log: Modified: pkg/tao/NAMESPACE =================================================================== --- pkg/tao/NAMESPACE 2014-04-07 21:15:07 UTC (rev 917) +++ pkg/tao/NAMESPACE 2014-04-10 13:56:14 UTC (rev 918) @@ -1,4 +1 @@ -export( - do.nothing, - do.nothing.else - ) +export(do.nothing,do.nothing.else) Deleted: pkg/tao/inst/NEWS =================================================================== From noreply at r-forge.r-project.org Tue Apr 15 19:59:09 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 15 Apr 2014 19:59:09 +0200 (CEST) Subject: [Pomp-commits] r919 - in pkg/pomp: . R demo inst man src Message-ID: <20140415175909.CE674186E43@r-forge.r-project.org> Author: kingaa Date: 2014-04-15 19:59:09 +0200 (Tue, 15 Apr 2014) New Revision: 919 Modified: pkg/pomp/DESCRIPTION pkg/pomp/R/builder.R pkg/pomp/demo/sir.R pkg/pomp/inst/NEWS pkg/pomp/inst/NEWS.Rd pkg/pomp/man/builder.Rd pkg/pomp/src/pfilter.c Log: - add 'globals' argument to 'pompBuilder' (thanks to Carl Pearson) - format NEWS file Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-10 13:56:14 UTC (rev 918) +++ pkg/pomp/DESCRIPTION 2014-04-15 17:59:09 UTC (rev 919) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.49-4 -Date: 2014-04-07 +Version: 0.49-5 +Date: 2014-04-15 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")), @@ -32,7 +32,7 @@ dprior-pomp.R rprior-pomp.R simulate-pomp.R trajectory-pomp.R plot-pomp.R pfilter.R pfilter-methods.R minim.R traj-match.R bsmc.R - mif.R mif-methods.R compare-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 Modified: pkg/pomp/R/builder.R =================================================================== --- pkg/pomp/R/builder.R 2014-04-10 13:56:14 UTC (rev 918) +++ pkg/pomp/R/builder.R 2014-04-15 17:59:09 UTC (rev 919) @@ -22,9 +22,10 @@ pompBuilder <- function (data, times, t0, name, statenames, paramnames, tcovar, covar, rmeasure, dmeasure, step.fn, step.fn.delta.t, - skeleton, skeleton.type, skelmap.delta.t = 1, + skeleton, skeleton.type = c("map","vectorfield"), + skelmap.delta.t = 1, parameter.transform, parameter.inv.transform, - ..., link = TRUE, save = FALSE) { + globals, ..., link = TRUE, save = FALSE) { if (!is.data.frame(data)) stop(sQuote("data")," must be a data-frame") obsnames <- names(data) obsnames <- setdiff(obsnames,times) @@ -37,6 +38,7 @@ tcovar <- numeric(0) covarnames <- character(0) } + skeleton.type <- match.arg(skeleton.type) pompCBuilder( name=name, statenames=statenames, @@ -49,6 +51,7 @@ skeleton=skeleton, parameter.transform=parameter.transform, parameter.inv.transform=parameter.inv.transform, + globals=globals, save=save ) if (link) { @@ -114,9 +117,9 @@ decl <- list( periodic_bspline_basis_eval="\tvoid (*periodic_bspline_basis_eval)(double,double,int,int,double*);\nperiodic_bspline_basis_eval = (void (*)(double,double,int,int,double*)) R_GetCCallable(\"pomp\",\"periodic_bspline_basis_eval\");\n", - get_pomp_userdata="\tconst SEXP (*get_pomp_userdata)(const char *);\npomp_get_userdata = (const SEXP (*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata\");\n", - get_pomp_userdata_int="\tconst int * (*get_pomp_userdata_int)(const char *);\npomp_get_userdata_int = (const int *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_int\");\n", - get_pomp_userdata_double="\tconst double * (*get_pomp_userdata_double)(const char *);\npomp_get_userdata_double = (const double *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_double\");\n" + get_pomp_userdata_int="\tconst int * (*get_pomp_userdata_int)(const char *);\nget_pomp_userdata_int = (const int *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_int\");\n", + get_pomp_userdata_double="\tconst double * (*get_pomp_userdata_double)(const char *);\nget_pomp_userdata_double = (const double *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_double\");\n", + `get_pomp_userdata(\\b|[^_])`="\tconst SEXP (*get_pomp_userdata)(const char *);\nget_pomp_userdata = (const SEXP (*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata\");\n" ) footer <- list( @@ -128,20 +131,28 @@ parameter.inv.transform="\n}\n\n" ) -utility.fns <- list( - ) +utility.fns <- list() +callable.decl <- function (code) { + fns <- vapply(names(decl),grepl,logical(1),code,perl=TRUE) + do.call(paste0,decl[fns]) +} +missing.fun <- function (name) { + paste0(" error(\"'",name,"' not defined\");") +} + pompCBuilder <- function (name, statenames, paramnames, covarnames, obsnames, rmeasure, dmeasure, step.fn, skeleton, parameter.transform, parameter.inv.transform, - save = FALSE) + globals, save = FALSE) { if (missing(name)) stop(sQuote("name")," must be supplied"); if (missing(statenames)) stop(sQuote("statenames")," must be supplied"); if (missing(paramnames)) stop(sQuote("paramnames")," must be supplied"); if (missing(obsnames)) stop(sQuote("obsnames")," must be supplied"); if (missing(covarnames)) stop(sQuote("covarnames")," must be supplied"); + if (missing(globals)) globals <- "" mpt <- missing(parameter.transform) mpit <- missing(parameter.inv.transform) @@ -173,6 +184,8 @@ cat(file=out,f) } + cat(file=out,globals) + ## variable/parameter/observations definitions for (v in seq_along(paramnames)) { cat(file=out,render(define$var,variable=paramnames[v],ptr='__p',ilist='__parindex',index=v-1)) @@ -197,40 +210,32 @@ if (has.trans) { ## parameter transformation function cat(file=out,render(header$parameter.transform,name=name)) - for (fn in names(decl)) { - if (grepl(fn,parameter.transform)) - cat(file=out,decl[[fn]]) - } + cat(file=out,callable.decl(parameter.transform)) cat(file=out,parameter.transform,footer$parameter.transform) ## inverse parameter transformation function cat(file=out,render(header$parameter.inv.transform,name=name)) - for (fn in names(decl)) { - if (grepl(fn,parameter.inv.transform)) - cat(file=out,decl[[fn]]) - } + cat(file=out,callable.decl(parameter.inv.transform)) cat(file=out,parameter.inv.transform,footer$parameter.inv.transform) } ## rmeasure function + if (missing(rmeasure)) rmeasure <- missing.fun("rmeasure") cat(file=out,render(header$rmeasure,name=name),rmeasure,footer$rmeasure) ## dmeasure function + if (missing(dmeasure)) dmeasure <- missing.fun("dmeasure") cat(file=out,render(header$dmeasure,name=name),dmeasure,footer$dmeasure) ## Euler step function + if (missing(step.fn)) step.fn <- missing.fun("step.fn") cat(file=out,render(header$step.fn,name=name)) - for (fn in names(decl)) { - if (grepl(fn,step.fn)) - cat(file=out,decl[[fn]]) - } + cat(file=out,callable.decl(step.fn)) cat(file=out,step.fn,footer$step.fn) ## skeleton function + if (missing(skeleton)) skeleton <- missing.fun("skeleton") cat(file=out,render(header$skeleton,name=name)) - for (fn in names(decl)) { - if (grepl(fn,skeleton)) - cat(file=out,decl[[fn]]) - } + cat(file=out,callable.decl(skeleton)) cat(file=out,skeleton,footer$skeleton) ## undefine variables @@ -266,7 +271,8 @@ if (rv!=0) stop("cannot compile shared-object library ",sQuote(solib)) else - cat("model codes written to",sQuote(modelfile),"\nlink to shared-object library",sQuote(solib),"\n") + cat("model codes written to",sQuote(modelfile), + "\nlink to shared-object library",sQuote(solib),"\n") invisible(NULL) } @@ -280,7 +286,8 @@ render <- function (template, ...) { vars=list(...) n <- sapply(vars,length) - if (!all((n==max(n))|(n==1))) stop("incommensurate lengths of replacements") + if (!all((n==max(n))|(n==1))) + stop("incommensurate lengths of replacements") short <- which(n==1) n <- max(n) for (i in short) vars[[i]] <- rep(vars[[i]],n) Modified: pkg/pomp/demo/sir.R =================================================================== --- pkg/pomp/demo/sir.R 2014-04-10 13:56:14 UTC (rev 918) +++ pkg/pomp/demo/sir.R 2014-04-15 17:59:09 UTC (rev 919) @@ -11,6 +11,10 @@ lik = dnbinom_mu(cases,theta,rho*incid,give_log); ' +globals <- ' + static int nbasis = 3; +' + ## SIR process model with extra-demographic stochasticity ## and seasonal transmission step.fn <- ' @@ -22,7 +26,8 @@ int k; // seasonality in transmission - beta = beta1*seas1+beta2*seas2+beta3*seas3; + for (k = 0, beta = 0.0; k < nbasis; k++) + beta += (&beta1)[k]*(&seas1)[k]; // compute the environmental stochasticity dW = rgammawn(beta_sd,dt); @@ -57,7 +62,8 @@ double dW; // white noise increment int k; - beta = beta1*seas1+beta2*seas2+beta3*seas3; + for (k = 0, beta = 0.0; k < nbasis; k++) + beta += (&beta1)[k]*(&seas1)[k]; // compute the transition rates rate[0] = mu*popsize; // birth into susceptible class @@ -88,12 +94,12 @@ ## the success of this depends on S0, I0, R0 being in ## adjacent memory locations, in that order partrans <- " + int k; Tgamma = exp(gamma); Tmu = exp(mu); Tiota = exp(iota); - Tbeta1 = exp(beta1); - Tbeta2 = exp(beta2); - Tbeta3 = exp(beta3); + for (k = 0; k < nbasis; k++) + (&Tbeta1)[k] = exp((&beta1)[k]); Tbeta_sd = exp(beta_sd); Trho = expit(rho); Ttheta = exp(theta); @@ -101,12 +107,12 @@ " paruntrans <- " + int k; Tgamma = log(gamma); Tmu = log(mu); Tiota = log(iota); - Tbeta1 = log(beta1); - Tbeta2 = log(beta2); - Tbeta3 = log(beta3); + for (k = 0; k < nbasis; k++) + (&Tbeta1)[k] = log((&beta1)[k]); Tbeta_sd = log(beta_sd); Trho = logit(rho); Ttheta = log(theta); @@ -137,6 +143,7 @@ ), times="time", t0=1928, + globals=globals, dmeasure=dmeas, rmeasure=rmeas, step.fn=step.fn, @@ -149,7 +156,7 @@ parameter.inv.transform=paruntrans, statenames=c("S","I","R","incid","W"), paramnames=c( - "gamma","mu","iota","beta1","beta2","beta3","beta.sd", + "gamma","mu","iota","beta1","beta.sd", "popsize","rho","theta","S.0","I.0","R.0" ), zeronames=c("incid","W"), @@ -161,7 +168,9 @@ fracs <- params[ic.names] x0[comp.names] <- round(params['popsize']*fracs/sum(fracs)) x0 - } + }, + save=FALSE, + link=TRUE ) -> po coef(po) <- c( Modified: pkg/pomp/inst/NEWS =================================================================== --- pkg/pomp/inst/NEWS 2014-04-10 13:56:14 UTC (rev 918) +++ pkg/pomp/inst/NEWS 2014-04-15 17:59:09 UTC (rev 919) @@ -1,724 +1,731 @@ -_N_e_w_s _f_o_r _P_a_c_k_a_g_e '_p_o_m_p' +_N_e_w_s _f_o_r _p_a_c_k_a_g_e '_p_o_m_p' -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_9-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_0-_1: - ? A new method, 'probe.match.objfun', constructs objective + ? It is now possible to specify global variables and typedefs + using the ?globals? argument to ?pompBuilder?. See the ?sir? + demo for a demonstration. Thanks to Carl Pearson for the + suggestion. + +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_9-_1: + + ? A new method, ?probe.match.objfun?, constructs objective functions suitable for use in optimizers. - ? 'pomp' now depends on 'nloptr', which provides a suite of + ? ?pomp? now depends on ?nloptr?, which provides a suite of optimization algorithms. This package can now be used in various methods for optimization of an objective function. - ? New inline C functions 'to_log_barycentric' and - 'from_log_barycentric' are provided in 'pomp.h' to facilitate + ? New inline C functions ?to_log_barycentric? and + ?from_log_barycentric? are provided in ?pomp.h? to facilitate log-barycentric transformations. These have proven very useful in dealing with parameters constrained to sum to one (e.g., initial conditions of compartmental models). - ? Bug fix in 'periodic.bspline.basis'. + ? Bug fix in ?periodic.bspline.basis?. - ? Package vignettes are no longer available via 'vignette()' + ? Package vignettes are no longer available via ?vignette()? but can be reached from the help index. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_8-_3: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_8-_3: - ? Correct a bug in 'abc' to do with parameter transformation. + ? Correct a bug in ?abc? to do with parameter transformation. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_8-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_8-_1: - ? Create new 'dprior' and 'rprior' slots for 'pomp' objects. - These will be used by the Bayesian methods (currently 'abc', - 'bsmc', and 'pmcmc'). The 'hyperparams' argument to these + ? Create new ?dprior? and ?rprior? slots for ?pomp? objects. + These will be used by the Bayesian methods (currently ?abc?, + ?bsmc?, and ?pmcmc?). The ?hyperparams? argument to these methods has been removed; hyperparameters are now treated just as any others. - ? 'bsmc' can now be called so that the particles are drawn from - the prior distribution (as set by the 'rpior' slot). + ? ?bsmc? can now be called so that the particles are drawn from + the prior distribution (as set by the ?rprior? slot). ? Some of the longer tests will only be run if an environment variable is set. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_7-_4: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_7-_4: - ? Revisit 'dacca' bug. Set negative compartments to zero along + ? Revisit ?dacca? bug. Set negative compartments to zero along with compartments immediately downstream. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_7-_3: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_7-_3: - ? Fix bug that arises only very occasionally in the 'dacca' + ? Fix bug that arises only very occasionally in the ?dacca? cholera example. - ? Modify 'dacca' model so that rare positivity violations are + ? Modify ?dacca? model so that rare positivity violations are punished in a different way. This modifies the formal model slightly. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_7-_2: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_7-_2: - ? By default, 'pompBuilder' now creates all files in the + ? By default, ?pompBuilder? now creates all files in the temporary directory. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_7-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_7-_1: - ? 'abc' implements Approximate Bayesian Computation for pomp + ? ?abc? implements Approximate Bayesian Computation for pomp models. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_6-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_6-_1: - ? 'pompExample' now has an optional argument, 'envir', - determining which environment the pomp object will be loaded - into. + ? ?pompExample? now has an optional argument, ?envir?, + determining which environment the ?pomp? object will be + loaded into. - ? 'logmeanexp' now has an optional argument, 'se', allowing for + ? ?logmeanexp? now has an optional argument, ?se?, allowing for computation of an approximate standard error. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_8: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_8: - ? bug fix in 'gompertz' example. + ? bug fix in ?gompertz? example. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_7: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_7: - ? bug fix in 'pmcmc': Metropolis-Hastings ratio was incorrect + ? bug fix in ?pmcmc?: Metropolis-Hastings ratio was incorrect except for flat priors! -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_6: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_6: - ? a fix so that 'pompBuilder' will find 'pomp.h' header file on + ? a fix so that ?pompBuilder? will find ?pomp.h? header file on Windows machines. Thanks to Dave Hayman for finding the problem. - ? new 'logmeanexp' function. + ? new ?logmeanexp? function. ? some reorganization of the source package structure. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_4: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_4: - ? changes in the way 'reulermultinom', 'deulermultinom', - 'dot_product' are exported to other packages. Rather than + ? changes in the way ?reulermultinom?, ?deulermultinom?, + ?dot_product? are exported to other packages. Rather than just being exported as linkables, these are now also defined - as static inline functions in the 'pomp.h' header. + as static inline functions in the ?pomp.h? header. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_3: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_3: - ? fix bug with 'continue' and method 'mif2' + ? Fix bug with ?continue? and method ?"mif2"?. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_2: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_2: - ? new method to coerce 'pfilterd.pomp' objects to data-frames. + ? new method to coerce ?pfilterd.pomp? objects to data-frames. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_5-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_5-_1: - ? 'profileDesign' can now handle variables of mixed type. + ? ?profileDesign? can now handle variables of mixed type. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_4-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_4-_1: - ? New 'mif2' option for 'mif'. + ? New ?"mif2"? option for ?mif?. - ? The default behavior for 'mif' and 'pfilter' with respect to + ? The default behavior for ?mif? and ?pfilter? with respect to filtering failures has been changed. Before, the default behavior has been to stop with an error on the first - filtering failure ('max.fail=0'). Now, the default is - 'max.fail=Inf', i.e., an error is never triggered. + filtering failure (?max.fail=0?). Now, the default is + ?max.fail=Inf?, i.e., an error is never triggered. ? The implementation of MIF cooling schedules has been changed to make it more general. The cooling schedule is now - specified by a 'type' and a 'fraction'. Currently, supported - 'cooling.type's include 'geometric' (the old behavior) and - 'hyperbolic', i.e., a 1/(1+n) schedule. The - 'cooling.fraction' argument specifies the cooling at 50 - iterations. That is, if s is the intensity of the + specified by a ?type? and a ?fraction?. Currently, supported + ?cooling.type?s include ?geometric? (the old behavior) and + ?hyperbolic?, i.e., a 1/(1+n) schedule. The + ?cooling.fraction? argument specifies the cooling at 50 + iterations. That is, if ?s? is the intensity of the random-walk perturbation to parameters at the first iteration - ('rw.sd'), then the intensity at iteration 50 is - s*cooling.fraction. + (?rw.sd?), then the intensity at iteration 50 is + ?s*cooling.fraction?. - ? Remove all data()-loadable pomp objects. To load the - prebuilt example pomp objects from previous versions, use the - new 'pompExample' function. E.g., instead of - 'data(euler.sir)', do 'pompExample("euler.sir")'. + ? Remove all ?data()?-loadable ?pomp? objects. To load the + prebuilt example ?pomp? objects from previous versions, use + the new ?pompExample? function. E.g., instead of + ?data(euler.sir)?, do ?pompExample("euler.sir")?. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_3-_4: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_3-_4: ? Clean up tests. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_3-_3: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_3-_3: - ? Fix bug in 'pompBuilder' on mac. + ? Fix bug in ?pompBuilder? on mac. - ? Fix bug in 'dmeasure' when log=TRUE. Bug located by R. + ? Fix bug in ?dmeasure? when ?log=TRUE?. Bug located by R. Reiner. - ? Add 'eff.sample.size' and 'cond.logLik' methods for - 'pfilterd.pomp' objects. + ? Add ?eff.sample.size? and ?cond.logLik? methods for + ?pfilterd.pomp? objects. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_3-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_3-_1: - ? Modify 'traj.match.objfun' to allow arbitrary parameters to + ? Modify ?traj.match.objfun? to allow arbitrary parameters to be passed to the ODE integrator. - ? Add 'params' argument to 'pomp' so that parameters can be - specified at the time the pomp object is created. + ? Add ?params? argument to ?pomp? so that parameters can be + specified at the time the ?pomp? object is created. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_2-_6: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_2-_6: - ? Improve error checking in 'pomp'. + ? Improve error checking in ?pomp?. - ? Add support for covariates to 'pompBuilder'. + ? Add support for covariates to ?pompBuilder?. ? Add native parameter transformation routines to the demos. - ? Change the warning behavior in 'lookup_table' so that + ? Change the warning behavior in ?lookup_table? so that warnings are not generated unless true extrapolation is performed (i.e., eliminate the warnings at the boundary). - ? Some small modifications to the 'pomp.h' header file. + ? Some small modifications to the ?pomp.h? header file. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_2-_4: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_2-_4: - ? When 'trajectory' calls 'ode', there is a need to preserve + ? When ?trajectory? calls ?ode?, there is a need to preserve information across calls to the vectorfield-evaluating function. The code has been modified to do this in a cleaner way. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_2-_2: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_2-_2: ? Several minor bugs have been fixed. See the ChangeLog for details. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_2-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_2-_1: - ? An EXPERIMENTAL facility for constructing pomp objects out of - native C routines is now included (pompBuilder). This + ? An EXPERIMENTAL facility for constructing ?pomp? objects out + of native C routines is now included (pompBuilder). This facility is being actively developed and future changes may not be backward compatible. - ? A new facility allowing access to the 'userdata' slot of a - pomp object from compiled 'rprocess', 'rmeasure', 'dprocess', - 'dmeasure', 'skeleton', and 'partrans' codes is now - available. Calls to the new C routines 'get_pomp_userdata', - 'get_pomp_userdata_int', and 'get_pomp_userdata_double' allow - retrieval of these elements. + ? A new facility allowing access to the ?userdata? slot of a + ?pomp? object from compiled ?rprocess?, ?rmeasure?, + ?dprocess?, ?dmeasure?, ?skeleton?, and ?partrans? codes is + now available. Calls to the new C routines + ?get_pomp_userdata?, ?get_pomp_userdata_int?, and + ?get_pomp_userdata_double? allow retrieval of these elements. - ? Some of the data()-loadable examples have been reworked to + ? Some of the ?data()?-loadable examples have been reworked to make use of the above facility. The parameterization of these examples has changed. These changes are not backward - compatible: codes that depend on the data()-loadable examples - may be broken. + compatible: codes that depend on the ?data()?-loadable + examples may be broken. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_8: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_8: - ? A demonstration of 'pompBuilder' has been put into the - 'advanced topics' vignette. + ? A demonstration of ?pompBuilder? has been put into the + ?advanced topics? vignette. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_7: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_7: - ? A bug in the 'blowflies' example has been fixed. Thanks to + ? A bug in the ?blowflies? example has been fixed. Thanks to Greg Minshall for discovering it. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_6: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_6: - ? The 'gompertz' example parameter transformations have been + ? The ?gompertz? example parameter transformations have been changed. No longer are the names of the parameter vector changed in the transformation. This change is not backward-compatible, but only codes using this example are affected. - ? The 'euler.sir' and 'gillespie.sir' examples have been + ? The ?euler.sir? and ?gillespie.sir? examples have been changed. The transmission rate beta(t) is now the arithmetic sum of the seasonality basis functions. Before, it was the - geometric sum. R0 is now given by the arithmetic average of - the beta parameters divided by (gamma+mu). This change is - not backward-compatible, but only codes using these examples - are affected. + geometric sum. R_0 is now given by the arithmetic average of + the beta parameters divided by gamma+mu. This change is not + backward-compatible, but only codes using these examples are + affected. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_5: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_5: - ? An experimental facility for constructing pomp objects with + ? An experimental facility for constructing ?pomp? objects with native C routines is now included. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_4: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_4: - ? The 'blowflies', 'euler.sir', 'gillespie.sir', 'bbs', and - 'ricker' data()-loadable examples have been changed to make + ? The ?blowflies?, ?euler.sir?, ?gillespie.sir?, ?bbs?, and + ?ricker? ?data()?-loadable examples have been changed to make the parameterization simpler and more natural. This change is not backward-compatible, but only codes using this example are affected. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_3: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_3: - ? In 'trajectory', all vectorfield and map evaluation is now + ? In ?trajectory?, all vectorfield and map evaluation is now done in C for speed. For continuous-time dynamical systems, this gives an approximately 4-fold speedup. ? Demos have been created to show some examples. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_2: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_2: - ? A segfault bug in 'bbs' example has been fixed. + ? A segfault bug in ?bbs? example has been fixed. ? The posterior medians (not means) are now stored in the - 'params' slot of the 'bsmcd.pomp' object. + ?params? slot of the ?bsmcd.pomp? object. -_C_h_a_n_g_e_s _i_n _p_o_m_p _v_e_r_s_i_o_n _0._4_1-_1: +_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._4_1-_1: - ? New arguments in 'mif', 'nlf', 'bsmc', 'pmcmc', - 'probe-match', and 'traj-match' allow the estimation to be - done on a transformed parameter space. When 'transform=TRUE' - in these commands ('transform.params=TRUE' for 'nlf'), + ? New arguments in ?mif?, ?nlf?, ?bsmc?, ?pmcmc?, + ?probe-match?, and ?traj-match? allow the estimation to be + done on a transformed parameter space. When ?transform=TRUE? + in these commands (?transform.params=TRUE? for ?nlf?), estimation is performed on the transformed parameter space. - This is described and demonstrated in the 'intro_to_pomp' + This is described and demonstrated in the ?intro_to_pomp? vignette. - ? The data()-loadable examples have been re-implemented to make - use of the above-mentioned facility. Note that this new + ? The ?data()?-loadable examples have been re-implemented to + make use of the above-mentioned facility. Note that this new functionality makes it unnecessary to "un-transform" model - parameters within the user-specified 'rprocess', 'dprocess', - 'rmeasure', 'dmeasure', 'skeleton', and 'initializer' codes. + parameters within the user-specified ?rprocess?, ?dprocess?, + ?rmeasure?, ?dmeasure?, ?skeleton?, and ?initializer? codes. This change is not backward-compatible, but only codes using - these data()-loadable example are affected. + these ?data()?-loadable example are affected. - ? The Bayesian sequential Monte Carlo command 'bsmc' now - returns not a list but an object of class 'bsmcd.pomp'. An - experimental 'plot' method for objects of this class now + ? The Bayesian sequential Monte Carlo command ?bsmc? now + returns not a list but an object of class ?bsmcd.pomp?. An + experimental ?plot? method for objects of this class now exists. Also, the parameter posterior means are now stored - in the 'params' slot of the 'bsmcd.pomp' object: access them - with the 'coef' command as usual. + in the ?params? slot of the ?bsmcd.pomp? object: access them + with the ?coef? command as usual. ? A new example, using data from an influenza outbreak in a British boarding school and an SIR model, has been included. - Do 'data(bbs)' to load it. + Do ?data(bbs)? to load it. [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 919 From noreply at r-forge.r-project.org Tue Apr 15 20:03:43 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 15 Apr 2014 20:03:43 +0200 (CEST) Subject: [Pomp-commits] r920 - pkg/pomp Message-ID: <20140415180344.2AA90187393@r-forge.r-project.org> Author: kingaa Date: 2014-04-15 20:03:43 +0200 (Tue, 15 Apr 2014) New Revision: 920 Modified: pkg/pomp/DESCRIPTION Log: - increment version number Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-15 17:59:09 UTC (rev 919) +++ pkg/pomp/DESCRIPTION 2014-04-15 18:03:43 UTC (rev 920) @@ -1,7 +1,7 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.49-5 +Version: 0.50-1 Date: 2014-04-15 Authors at R: c(person(given=c("Aaron","A."),family="King", role=c("aut","cre"),email="kingaa at umich.edu"), From noreply at r-forge.r-project.org Thu Apr 17 15:13:21 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 17 Apr 2014 15:13:21 +0200 (CEST) Subject: [Pomp-commits] r921 - in pkg/pomp: . inst/doc man tests Message-ID: <20140417131321.EC912185C71@r-forge.r-project.org> Author: kingaa Date: 2014-04-17 15:13:21 +0200 (Thu, 17 Apr 2014) New Revision: 921 Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/manual.pdf pkg/pomp/man/example.Rd pkg/pomp/man/pomp.Rd pkg/pomp/tests/ou2-nlf.R pkg/pomp/tests/ou2-nlf.Rout.save Log: - tweak ou2-nlf test - fix error in pomp documentation Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-15 18:03:43 UTC (rev 920) +++ pkg/pomp/DESCRIPTION 2014-04-17 13:13:21 UTC (rev 921) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.50-1 -Date: 2014-04-15 +Date: 2014-04-17 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")), Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/man/example.Rd =================================================================== --- pkg/pomp/man/example.Rd 2014-04-15 18:03:43 UTC (rev 920) +++ pkg/pomp/man/example.Rd 2014-04-17 13:13:21 UTC (rev 921) @@ -24,6 +24,7 @@ pompExample() pompExample(euler.sir) pompExample("gompertz") + file.show(system.file("include/pomp.h",package="pomp")) } \seealso{ \code{\link{blowflies}}, \code{\link{dacca}}, \code{\link{gompertz}}, Modified: pkg/pomp/man/pomp.Rd =================================================================== --- pkg/pomp/man/pomp.Rd 2014-04-15 18:03:43 UTC (rev 920) +++ pkg/pomp/man/pomp.Rd 2014-04-17 13:13:21 UTC (rev 921) @@ -69,7 +69,7 @@ optional; the measurement model simulator. This can be specified in one of three ways: (1) as a function of prototype \code{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}. - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{examples/pomp.h}. + (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}. In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call. (3) using the formula-based \code{measurement.model} facility (see below). } @@ -77,7 +77,7 @@ optional; the measurement model probability density function. This can be specified in one of three ways: (1) as a function of prototype \code{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}. - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{examples/pomp.h}. + (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}. In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call. (3) using the formula-based \code{measurement.model} facility (see below). As might be expected, if \code{log=TRUE}, this function should return the log likelihood. Modified: pkg/pomp/tests/ou2-nlf.R =================================================================== --- pkg/pomp/tests/ou2-nlf.R 2014-04-15 18:03:43 UTC (rev 920) +++ pkg/pomp/tests/ou2-nlf.R 2014-04-17 13:13:21 UTC (rev 921) @@ -1,6 +1,6 @@ library(pomp) -set.seed(594861940L) +set.seed(583615606L) pompExample(ou2) estnames=c("alpha.2","alpha.3","tau") @@ -17,7 +17,7 @@ trace=1, verbose=TRUE, eval.only=TRUE, - seed=384886L, + seed=426094906L, lql.frac = 0.025 ) se1 <- rep(NA,length(estnames)) @@ -34,10 +34,9 @@ maxit=500, trace=1, verbose=TRUE, - seed=384886L, + seed=426094906L, lql.frac = 0.025 ) - se2 <- m2$se m3 <- nlf( @@ -51,7 +50,7 @@ trace=1, verbose=TRUE, eval.only=TRUE, - seed=384886L, + seed=426094906L, lql.frac = 0.025 ) se3 <- rep(NA,length(estnames)) @@ -67,17 +66,20 @@ maxit=500, trace=1, verbose=TRUE, - seed=384886L, + seed=426094906L, lql.frac = 0.025 ) - se4 <- m4$se +options(scipen=-3) print( - cbind( - guess=c(theta.guess[estnames],se=se3,value=m3), - truth=c(theta.truth[estnames],se=se1,value=m1), - fit.from.guess=c(m4$params[estnames],se=se4,value=m4$value), - fit.from.truth=c(m2$params[estnames],se=se2,value=m2$value) - ) + signif( + cbind( + guess=c(theta.guess[estnames],se=se3,value=m3), + truth=c(theta.truth[estnames],se=se1,value=m1), + fit.from.guess=c(m4$params[estnames],se=se4,value=m4$value), + fit.from.truth=c(m2$params[estnames],se=se2,value=m2$value) + ), + 4 + ) ) Modified: pkg/pomp/tests/ou2-nlf.Rout.save =================================================================== --- pkg/pomp/tests/ou2-nlf.Rout.save 2014-04-15 18:03:43 UTC (rev 920) +++ pkg/pomp/tests/ou2-nlf.Rout.save 2014-04-17 13:13:21 UTC (rev 921) @@ -1,5 +1,5 @@ -R version 3.0.3 (2014-03-06) -- "Warm Puppy" +R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) @@ -21,7 +21,7 @@ Loading required package: nloptr Loading required package: deSolve > -> set.seed(594861940L) +> set.seed(583615606L) > > pompExample(ou2) newly created pomp object(s): @@ -40,12 +40,12 @@ + trace=1, + verbose=TRUE, + eval.only=TRUE, -+ seed=384886L, ++ seed=426094906L, + lql.frac = 0.025 + ) > se1 <- rep(NA,length(estnames)) > print(m1) -[1] -555.0868 +[1] -551.8268 > > m2 <- nlf( + object=ou2, @@ -58,57 +58,65 @@ + maxit=500, + trace=1, + verbose=TRUE, -+ seed=384886L, ++ seed=426094906L, + lql.frac = 0.025 + ) Nelder-Mead direct search function minimizer -function value for initial parameters = 555.086814 - Scaled convergence tolerance is 8.27144e-06 +function value for initial parameters = 551.826845 + Scaled convergence tolerance is 8.22286e-06 Stepsize computed as 0.100000 -BUILD 4 559.254725 555.086814 -HI-REDUCTION 6 556.109178 555.086814 -HI-REDUCTION 8 555.476443 554.544555 -LO-REDUCTION 10 555.105949 554.544555 -LO-REDUCTION 12 555.086814 554.519288 -LO-REDUCTION 14 554.740190 554.519288 -HI-REDUCTION 16 554.618696 554.519288 -LO-REDUCTION 18 554.548158 554.515101 -HI-REDUCTION 20 554.544555 554.508577 -HI-REDUCTION 22 554.519288 554.497436 -REFLECTION 24 554.515101 554.492388 -LO-REDUCTION 26 554.508577 554.492388 -HI-REDUCTION 28 554.497436 554.492388 -REFLECTION 30 554.494893 554.491176 -REFLECTION 32 554.494183 554.489759 -HI-REDUCTION 34 554.492388 554.489759 -REFLECTION 36 554.491176 554.488524 -HI-REDUCTION 38 554.489976 554.488524 -REFLECTION 40 554.489759 554.486675 -HI-REDUCTION 42 554.488704 554.486675 -REFLECTION 44 554.488524 554.486318 -LO-REDUCTION 46 554.487711 554.486318 -EXTENSION 48 554.486945 554.485619 -LO-REDUCTION 50 554.486675 554.485619 -LO-REDUCTION 52 554.486318 554.485607 -HI-REDUCTION 54 554.485830 554.485607 -REFLECTION 56 554.485734 554.485498 -HI-REDUCTION 58 554.485619 554.485498 -HI-REDUCTION 60 554.485607 554.485495 -LO-REDUCTION 62 554.485535 554.485466 -HI-REDUCTION 64 554.485498 554.485466 -HI-REDUCTION 66 554.485495 554.485466 -HI-REDUCTION 68 554.485479 554.485466 +BUILD 4 555.857055 551.809812 +HI-REDUCTION 6 553.587531 551.809812 +HI-REDUCTION 8 552.896950 551.547043 +LO-REDUCTION 10 551.826845 551.547043 +REFLECTION 12 551.809812 551.525614 +HI-REDUCTION 14 551.582310 551.444555 +HI-REDUCTION 16 551.547043 551.429120 +HI-REDUCTION 18 551.525614 551.417773 +HI-REDUCTION 20 551.444555 551.417773 +HI-REDUCTION 22 551.429120 551.390624 +LO-REDUCTION 24 551.419291 551.390624 +LO-REDUCTION 26 551.417773 551.384044 +LO-REDUCTION 28 551.396651 551.379480 +HI-REDUCTION 30 551.390624 551.379480 +HI-REDUCTION 32 551.384044 551.379480 +HI-REDUCTION 34 551.381372 551.379480 +HI-REDUCTION 36 551.380899 551.378810 +LO-REDUCTION 38 551.379724 551.378261 +REFLECTION 40 551.379480 551.378023 +HI-REDUCTION 42 551.378810 551.378023 +LO-REDUCTION 44 551.378261 551.377746 +HI-REDUCTION 46 551.378120 551.377589 +EXTENSION 48 551.378023 551.376695 +LO-REDUCTION 50 551.377746 551.376695 +LO-REDUCTION 52 551.377589 551.376695 +EXTENSION 54 551.377112 551.375515 +LO-REDUCTION 56 551.376869 551.375515 +LO-REDUCTION 58 551.376695 551.375515 +EXTENSION 60 551.375706 551.374028 +LO-REDUCTION 62 551.375521 551.374028 +EXTENSION 64 551.375515 551.373593 +LO-REDUCTION 66 551.374448 551.373593 +REFLECTION 68 551.374028 551.373497 +HI-REDUCTION 70 551.373639 551.373497 +LO-REDUCTION 72 551.373623 551.373486 +REFLECTION 74 551.373593 551.373446 +HI-REDUCTION 76 551.373497 551.373425 +LO-REDUCTION 78 551.373486 551.373425 +HI-REDUCTION 80 551.373446 551.373419 +HI-REDUCTION 82 551.373429 551.373411 +REFLECTION 84 551.373425 551.373407 +HI-REDUCTION 86 551.373419 551.373407 Exiting from Nelder Mead minimizer - 70 function evaluations used + 88 function evaluations used h in NLF = 0.1 -epsilon in NLF = 0.07715219 0.08600406 1.29893 -Fitted param 1 -5.928762 -5.928762 up in 'nlf' -Fitted param 1 -5.918791 down in 'NLF' -Fitted param 2 -5.92007 -5.92007 up in 'nlf' -Fitted param 2 -5.933666 down in 'NLF' -Fitted param 3 -5.937785 -5.937785 up in 'nlf' -Fitted param 3 -5.903043 down in 'NLF' -> +epsilon in NLF = 0.07430234 0.07131381 1.121473 +Fitted param 1 -5.893573 -5.893573 up in 'nlf' +Fitted param 1 -5.887746 down in 'NLF' +Fitted param 2 -5.888468 -5.888468 up in 'nlf' +Fitted param 2 -5.890894 down in 'NLF' +Fitted param 3 -5.901121 -5.901121 up in 'nlf' +Fitted param 3 -5.872183 down in 'NLF' > se2 <- m2$se > > m3 <- nlf( @@ -122,7 +130,7 @@ + trace=1, + verbose=TRUE, + eval.only=TRUE, -+ seed=384886L, ++ seed=426094906L, + lql.frac = 0.025 + ) > se3 <- rep(NA,length(estnames)) @@ -138,88 +146,93 @@ + maxit=500, + trace=1, + verbose=TRUE, -+ seed=384886L, ++ seed=426094906L, + lql.frac = 0.025 + ) Nelder-Mead direct search function minimizer -function value for initial parameters = 10330.933626 - Scaled convergence tolerance is 0.000153943 +function value for initial parameters = 10349.712405 + Scaled convergence tolerance is 0.000154223 Stepsize computed as 0.150000 -BUILD 4 29742.647014 576.824636 -REFLECTION 6 10330.933626 564.186576 -EXTENSION 8 10330.933626 556.163486 -LO-REDUCTION 10 576.824636 555.749535 -LO-REDUCTION 12 564.186576 555.749535 -LO-REDUCTION 14 557.909279 555.749535 -REFLECTION 16 556.174151 555.518836 -HI-REDUCTION 18 556.163486 555.234932 -REFLECTION 20 555.749535 555.069014 -HI-REDUCTION 22 555.518836 555.069014 -LO-REDUCTION 24 555.234932 555.041059 -REFLECTION 26 555.161158 554.878667 -LO-REDUCTION 28 555.069014 554.878667 -LO-REDUCTION 30 555.041059 554.820011 -HI-REDUCTION 32 554.902564 554.820011 -HI-REDUCTION 34 554.878667 554.820011 -HI-REDUCTION 36 554.863049 554.818271 -REFLECTION 38 554.823167 554.795312 -LO-REDUCTION 40 554.820011 554.795312 -HI-REDUCTION 42 554.818271 554.795007 -EXTENSION 44 554.796015 554.739129 -LO-REDUCTION 46 554.795312 554.739129 -LO-REDUCTION 48 554.795007 554.739129 -EXTENSION 50 554.757998 554.655046 -LO-REDUCTION 52 554.746394 554.655046 -EXTENSION 54 554.739129 554.611468 -EXTENSION 56 554.680717 554.529970 -LO-REDUCTION 58 554.655046 554.529970 -REFLECTION 60 554.611468 554.508046 -REFLECTION 62 554.533844 554.490991 -LO-REDUCTION 64 554.529970 554.490991 -LO-REDUCTION 66 554.508046 554.490991 -HI-REDUCTION 68 554.499927 554.490991 -HI-REDUCTION 70 554.499566 554.490991 -LO-REDUCTION 72 554.495632 554.490991 -LO-REDUCTION 74 554.494415 554.490991 -EXTENSION 76 554.493222 554.488394 -HI-REDUCTION 78 554.492456 554.488394 -EXTENSION 80 554.490991 554.486164 -LO-REDUCTION 82 554.490490 554.486164 -LO-REDUCTION 84 554.488394 554.486164 -REFLECTION 86 554.486677 554.486008 -REFLECTION 88 554.486468 554.485672 -HI-REDUCTION 90 554.486164 554.485662 -HI-REDUCTION 92 554.486008 554.485580 +BUILD 4 29590.472476 574.029743 +REFLECTION 6 10349.712405 561.069623 +EXTENSION 8 10349.712405 552.918157 +LO-REDUCTION 10 574.029743 552.446706 +LO-REDUCTION 12 561.069623 552.446706 +LO-REDUCTION 14 554.933811 552.446706 +LO-REDUCTION 16 553.288596 552.188648 +HI-REDUCTION 18 552.918157 552.188648 +REFLECTION 20 552.446706 551.941892 +HI-REDUCTION 22 552.310402 551.941892 +LO-REDUCTION 24 552.188648 551.941892 +EXTENSION 26 552.061458 551.693153 +LO-REDUCTION 28 551.960407 551.693153 +HI-REDUCTION 30 551.941892 551.693153 +EXTENSION 32 551.777968 551.552226 +LO-REDUCTION 34 551.749550 551.552226 +HI-REDUCTION 36 551.693153 551.552226 +EXTENSION 38 551.598023 551.421898 +HI-REDUCTION 40 551.581645 551.421898 +LO-REDUCTION 42 551.552226 551.421898 +REFLECTION 44 551.511351 551.401006 +LO-REDUCTION 46 551.462702 551.401006 +REFLECTION 48 551.428693 551.390416 +LO-REDUCTION 50 551.421898 551.388095 +LO-REDUCTION 52 551.401006 551.388095 +REFLECTION 54 551.395541 551.387873 +LO-REDUCTION 56 551.390416 551.385576 +REFLECTION 58 551.388095 551.379441 +HI-REDUCTION 60 551.387873 551.379441 +HI-REDUCTION 62 551.385576 551.379441 +LO-REDUCTION 64 551.383020 551.379441 +HI-REDUCTION 66 551.382723 551.379441 +EXTENSION 68 551.381009 551.378081 +LO-REDUCTION 70 551.380921 551.378081 +EXTENSION 72 551.379441 551.374956 +LO-REDUCTION 74 551.379030 551.374956 +LO-REDUCTION 76 551.378081 551.374956 +LO-REDUCTION 78 551.376822 551.374956 +EXTENSION 80 551.375968 551.373995 +LO-REDUCTION 82 551.375446 551.373995 +REFLECTION 84 551.374956 551.373649 +LO-REDUCTION 86 551.374162 551.373649 +REFLECTION 88 551.373995 551.373632 +HI-REDUCTION 90 551.373845 551.373632 +REFLECTION 92 551.373739 551.373469 +REFLECTION 94 551.373649 551.373462 +LO-REDUCTION 96 551.373632 551.373462 Exiting from Nelder Mead minimizer - 94 function evaluations used + 98 function evaluations used h in NLF = 0.1 -epsilon in NLF = 0.07703295 0.08568253 1.296531 -Fitted param 1 -5.928954 -5.928954 up in 'nlf' -Fitted param 1 -5.918596 down in 'NLF' -Fitted param 2 -5.919574 -5.919574 up in 'nlf' -Fitted param 2 -5.933857 down in 'NLF' -Fitted param 3 -5.937754 -5.937754 up in 'nlf' -Fitted param 3 -5.903045 down in 'NLF' -> +epsilon in NLF = 0.07430743 0.07134126 1.118089 +Fitted param 1 -5.893548 -5.893548 up in 'nlf' +Fitted param 1 -5.887774 down in 'NLF' +Fitted param 2 -5.888571 -5.888571 up in 'nlf' +Fitted param 2 -5.89076 down in 'NLF' +Fitted param 3 -5.901152 -5.901152 up in 'nlf' +Fitted param 3 -5.872222 down in 'NLF' > se4 <- m4$se > +> options(scipen=-3) > print( -+ cbind( -+ guess=c(theta.guess[estnames],se=se3,value=m3), -+ truth=c(theta.truth[estnames],se=se1,value=m1), -+ fit.from.guess=c(m4$params[estnames],se=se4,value=m4$value), -+ fit.from.truth=c(m2$params[estnames],se=se2,value=m2$value) -+ ) ++ signif( ++ cbind( ++ guess=c(theta.guess[estnames],se=se3,value=m3), ++ truth=c(theta.truth[estnames],se=se1,value=m1), ++ fit.from.guess=c(m4$params[estnames],se=se4,value=m4$value), ++ fit.from.truth=c(m2$params[estnames],se=se2,value=m2$value) ++ ), ++ 4 ++ ) + ) - guess truth fit.from.guess fit.from.truth -alpha.2 -0.75 -0.5000 -0.45749499 -0.45774692 -alpha.3 0.45 0.3000 0.30150315 0.30194588 -tau 1.50 1.0000 1.09790880 1.09526822 -se1 NA NA 0.04374829 0.04397017 -se2 NA NA 0.05423946 0.05463665 -se3 NA NA 0.54596143 0.54625858 -value -10330.93 -555.0868 -554.48554809 -554.48546595 + guess truth fit.from.guess fit.from.truth +alpha.2 -7.500e-01 -0.5 -4.663e-01 -4.664e-01 +alpha.3 4.500e-01 0.3 3.005e-01 3.003e-01 +tau 1.500e+00 1.0 1.129e+00 1.125e+00 +se1 NA NA 3.531e-02 3.533e-02 +se2 NA NA 3.978e-02 3.974e-02 +se3 NA NA 5.287e-01 5.312e-01 +value -1.035e+04 -551.8 -5.514e+02 -5.514e+02 > > proc.time() user system elapsed - 8.112 0.052 8.216 + 6.836 0.060 6.942 From noreply at r-forge.r-project.org Thu Apr 17 15:21:30 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 17 Apr 2014 15:21:30 +0200 (CEST) Subject: [Pomp-commits] r922 - in branches/mif2: . inst tests Message-ID: <20140417132130.31889186CB7@r-forge.r-project.org> Author: kingaa Date: 2014-04-17 15:21:28 +0200 (Thu, 17 Apr 2014) New Revision: 922 Removed: branches/mif2/data/ branches/mif2/demo/ branches/mif2/inst/CHANGES_0.29-1.txt branches/mif2/inst/CITATION branches/mif2/inst/ChangeLog branches/mif2/inst/NEWS branches/mif2/inst/O_CHANGES branches/mif2/inst/TODO branches/mif2/inst/doc/ branches/mif2/inst/examples/ branches/mif2/inst/include/ branches/mif2/tests/bbs-trajmatch.R branches/mif2/tests/bbs-trajmatch.Rout.save branches/mif2/tests/bbs.R branches/mif2/tests/bbs.Rout.save branches/mif2/tests/blowflies.R branches/mif2/tests/blowflies.Rout.save branches/mif2/tests/dacca.R branches/mif2/tests/dacca.Rout.save branches/mif2/tests/dimchecks.R branches/mif2/tests/dimchecks.Rout.save branches/mif2/tests/fhn.R branches/mif2/tests/fhn.Rout.save branches/mif2/tests/filtfail.R branches/mif2/tests/filtfail.Rout.save branches/mif2/tests/gillespie.R branches/mif2/tests/gillespie.Rout.save branches/mif2/tests/gompertz.R branches/mif2/tests/gompertz.Rout.save branches/mif2/tests/logistic.R branches/mif2/tests/logistic.Rout.save branches/mif2/tests/ou2-bsmc.R branches/mif2/tests/ou2-bsmc.Rout.save branches/mif2/tests/ou2-forecast.R branches/mif2/tests/ou2-forecast.Rout.save branches/mif2/tests/ou2-icfit.R branches/mif2/tests/ou2-icfit.Rout.save branches/mif2/tests/ou2-kalman.R branches/mif2/tests/ou2-kalman.Rout.save branches/mif2/tests/ou2-mif-fp.R branches/mif2/tests/ou2-mif-fp.Rout.save branches/mif2/tests/ou2-mif.R branches/mif2/tests/ou2-mif.Rout.save branches/mif2/tests/ou2-nlf.R branches/mif2/tests/ou2-nlf.Rout.save branches/mif2/tests/ou2-pmcmc.R branches/mif2/tests/ou2-pmcmc.Rout.save branches/mif2/tests/ou2-probe.R branches/mif2/tests/ou2-probe.Rout.save branches/mif2/tests/ou2-procmeas.R branches/mif2/tests/ou2-procmeas.Rout.save branches/mif2/tests/ou2-simulate.R branches/mif2/tests/ou2-simulate.Rout.save branches/mif2/tests/ou2-trajmatch.R branches/mif2/tests/ou2-trajmatch.Rout.save branches/mif2/tests/partrans.R branches/mif2/tests/partrans.Rout.save branches/mif2/tests/pomppomp.R branches/mif2/tests/pomppomp.Rout.save branches/mif2/tests/ricker-bsmc.R branches/mif2/tests/ricker-bsmc.Rout.save branches/mif2/tests/ricker-probe.R branches/mif2/tests/ricker-probe.Rout.save branches/mif2/tests/ricker-spect.R branches/mif2/tests/ricker-spect.Rout.save branches/mif2/tests/ricker.R branches/mif2/tests/ricker.Rout.save branches/mif2/tests/rw2.R branches/mif2/tests/rw2.Rout.save branches/mif2/tests/sir.R branches/mif2/tests/sir.Rout.save branches/mif2/tests/skeleton.R branches/mif2/tests/skeleton.Rout.save branches/mif2/tests/steps.R branches/mif2/tests/steps.Rout.save branches/mif2/tests/synlik.R branches/mif2/tests/synlik.Rout.save branches/mif2/tests/verhulst.R branches/mif2/tests/verhulst.Rout.save Modified: branches/mif2/tests/ou2-mif2.R branches/mif2/tests/ou2-mif2.Rout.save branches/mif2/tests/pfilter.R branches/mif2/tests/pfilter.Rout.save Log: - make 'mif2' a descendant of 'pomp' Deleted: branches/mif2/inst/CHANGES_0.29-1.txt =================================================================== --- branches/mif2/inst/CHANGES_0.29-1.txt 2014-04-17 13:13:21 UTC (rev 921) +++ branches/mif2/inst/CHANGES_0.29-1.txt 2014-04-17 13:21:28 UTC (rev 922) @@ -1,225 +0,0 @@ -There are three main changes in version 0.29-1. - -1. Substantial improvements to the documentation, including both the vignettes -and the manual pages. - -2. A bigger, more intuitive, and easier-to-use set of "plugins" for filling the -'rprocess' slot of a 'pomp' object. - -3. Changes to the C interface for 'rmeasure' and 'dmeasure' functions. - -The first and second changes preserve backward compatibility: your old codes -will work fine even if you do not make use of the new functionality. Using the -old-style plugins 'euler.simulate' or 'onestep.simulate' will result in annoying -warnings about these functions being deprecated and suggesting that you migrate -to the new-style plugins sometime soon. In a future release of pomp, -'euler.simulate' and 'onestep.simulate' will disappear. - -The third change does NOT preserve backward compatibility. If you use compiled -native routines for 'rmeasure' and/or 'dmeasure', you must modify those routines -or your codes will not work properly (and will almost certainly crash) when used -with versions 0.29-1 and later of pomp. The required modification is quite -minor, however, and is detailed below. - -In more detail: - -Change 1. -The vignettes have been completely rewritten to be useful as tutorials. The -first vignette, "intro_to_pomp", is a step-by-step guide to the construction of -a 'pomp' and simulation, particle filtering, trajectory-matching, iterated -filtering, and nonlinear forecasting. View it by doing -R> ?vignette("intro_to_pomp") -The second vignette shows how to accelerate performance using compiled native -routines and briefly introduces the developer interface to pomp. View it by -doing -R> ?vignette("advanced_topics_in_pomp") - -Change 2. New plugins. -As you probably know very well, it can be challenging to implement a model in -pomp. In particular, the most difficult bit is typically writing the process -model simulator (rprocess). In an effort to make this more intuitive, I have -provided several new "plugins": functions that write the 'rprocess' function for -you given minimal input on the form of the model. - -For some time there has been some plugin functionality, but their structure has -made them nonintuitive and their documentation difficult to understand from the -user's point of view. The new plugins are much more straightforward to use and -their documentation is clearer (I hope). The new plugins provide precisely the -same functionality: only the interface has changed. To be clear: switching over -to the new-style plugins will have no effect on the underlying model nor, -therefore, on inferences that have been based on that model. - -If you have been using the old-style plugins (euler.simulate or -onestep.simulate), you can continue to do so for the time being. However, -warning messages will be generated to inform you that these functions are -deprecated and will be removed in a later release of pomp. - -To switch over to the new-style plugins, you need only edit a few lines in the R -code that constructs a pomp object. Specifically, if you use - -pomp(...,rprocess=euler.simulate,...,delta.t=dt,...,step.fun=foo,...,PACKAGE=bar, ...) - -where 'foo' is either an R function or the name of a compiled native routine, -and 'bar' is the name of the shared-object library where the compiled native -routine resides, you can achieve the same functionality by using - -pomp(...,rprocess=euler.sim(step.fun=foo,delta.t=dt,PACKAGE=bar),...) - -Similarly, if you use - -pomp(...,rprocess=onestep.simulate,...,step.fun=foo,...,PACKAGE=bar,...) - -replace it with - -pomp(...,rprocess=onestep.sim(step.fun=foo,PACKAGE=bar),...) - -Essentially, the new-style plugins are functions that return "customized" -functions suitable for use in the 'rprocess' slot of a 'pomp' object. - -There are now new plugins that include a discrete-time model plugin -('discrete.time.sim') and an implementation of the Gillespie algorithm -('gillespie.sim'). The FORTRAN codes that underly 'gillespie.sim' are due to -Helen Wearing. For documentation on the new functionality, see -R> ?plugins -or -R>?euler.sim -R>?gillespie.sim -R>?onestep.sim -R>?discrete.time.sim - -Change 3. New interface for C versions of 'rmeasure' and 'dmeasure'. - -This change only affects you if you use compiled native routines for the -measurement portion of your model. If you specify your measurement model either -using 'measurement.model=blah' or by specifying 'rmeasure' and/or 'dmeasure' as -R functions, you need do nothing. - -If you have written C functions to implement your measurement model, you have -written a C function of prototype - -void pomp_measure_model_simulator (double *y, double *x, double *p, int *stateindex, -int *parindex, int *covindex, int ncovars, double *covars, double t); - -and/or a function of prototype - -void pomp_measure_model_density (double *lik, double *y, double *x, double *p, -int give_log, int *stateindex, int *parindex, int *covindex, int ncovars, double -*covars, double t); - -In the new version of 'pomp', you must modify these functions to have prototypes - -void pomp_measure_model_simulator (double *y, double *x, double *p, -int *obsindex, int *stateindex, int *parindex, int *covindex, int ncovars, -double *covars, double t); - -and - -void pomp_measure_model_density (double *lik, double *y, double *x, double *p, -int give_log, int *obsindex, int *stateindex, int *parindex, int *covindex, int -ncovars, double *covars, double t); - -The only difference is that you need to insert a new int* argument 'obsindex' in -the appropriate place. - -If you simply insert the new argument and do nothing more, your codes should -function as before. If you wish to take advantage of the new functionality, it -should make your codes more robust. To do so, when constructing a 'pomp' object, -specify the names of observed variables in the 'obsnames' argument to 'pomp'. If -you have done this, upon any call to either your C 'dmeasure' or 'rmeasure' -function, 'obsindex' will be a pointer to a set of integers that indicate the -positions in 'y' that correspond to the variables in 'obsnames' in that order. -Thus, 'obsindex' is exactly analogous to 'stateindex', 'parindex', and -'covindex': 'obsindex' is to 'y' as 'stateindex' is to 'x' as 'parindex' is to -'p' as 'covindex' is to 'covars'. - -Here is an example of one of my own codes. Before version 0.29-1, the code was: -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -#define TAU (p[parindex[0]]) -#define DEATHS (x[stateindex[4]]) -#define DATADEATHS (y[0]) - -void norm_rmeasure (double *y, double *x, double *p, - int *stateindex, int *parindex, int *covindex, - int ncovars, double *covars, double t) -{ - double v, tol = 1.0e-18; - v = DEATHS*exp(TAU); - if (!(R_FINITE(v))) { - DATADEATHS = R_NaReal; - } else { - DATADEATHS = rnorm(DEATHS,v+tol); - } -} - -void norm_dmeasure (double *lik, double *y, double *x, double *p, int give_log, - int *stateindex, int *parindex, int *covindex, - int ncovars, double *covars, double t) -{ - double v, tol = 1.0e-18; - v = DEATHS*exp(TAU); - if (!(R_FINITE(v))) { - *lik = tol; - } else { - *lik = dnorm(DATADEATHS,DEATHS,v+tol,0)+tol; - } - if (give_log) *lik = log(*lik); -} - -#undef TAU -#undef DEATHS -#undef DATADEATHS -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - -As of pomp version 0.29-1, the code is: -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -#define TAU (p[parindex[0]]) -#define DEATHS (x[stateindex[4]]) -#define DATADEATHS (y[obsindex[0]]) - -void norm_rmeasure (double *y, double *x, double *p, - int *obsindex, int *stateindex, int *parindex, int *covindex, - int ncovars, double *covars, double t) -{ - double v, tol = 1.0e-18; - v = DEATHS*exp(TAU); - if (!(R_FINITE(v))) { - DATADEATHS = R_NaReal; - } else { - DATADEATHS = rnorm(DEATHS,v+tol); - } -} - -void norm_dmeasure (double *lik, double *y, double *x, double *p, int give_log, - int *obsindex, int *stateindex, int *parindex, int *covindex, - int ncovars, double *covars, double t) -{ - double v, tol = 1.0e-18; - v = DEATHS*exp(TAU); - if (!(R_FINITE(v))) { - *lik = tol; - } else { - *lik = dnorm(DATADEATHS,DEATHS,v+tol,0)+tol; - } - if (give_log) *lik = log(*lik); -} - -#undef TAU -#undef DEATHS -#undef DATADEATHS -ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - -A diff on these two shows just the changes: -ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd -3c3 -< #define DATADEATHS (y[0]) ---- -> #define DATADEATHS (y[obsindex[0]]) -6c6 -< int *stateindex, int *parindex, int *covindex, ---- -> int *obsindex, int *stateindex, int *parindex, int *covindex, -19c19 -< int *stateindex, int *parindex, int *covindex, ---- -> int *obsindex, int *stateindex, int *parindex, int *covindex, -ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd \ No newline at end of file Deleted: branches/mif2/inst/CITATION =================================================================== --- branches/mif2/inst/CITATION 2014-04-17 13:13:21 UTC (rev 921) +++ branches/mif2/inst/CITATION 2014-04-17 13:21:28 UTC (rev 922) @@ -1,26 +0,0 @@ -citHeader("To cite the pomp package in publications use:") - -citEntry( - entry="Manual", - title="pomp: Statistical inference for partially observed Markov processes (R package)", - author=personList( - as.person("Aaron A. King"), - as.person("Edward L. Ionides"), - as.person("Carles Martinez Bret\\'o"), - as.person("Steve Ellner"), - as.person("Bruce Kendall"), - as.person("Helen Wearing"), - as.person("Matthew J. Ferrari"), - as.person("Michael Lavine"), - as.person("Daniel C. Reuman") - ), - year=2010, - url="http://pomp.r-forge.r-rproject.org", - textVersion=paste( - "Aaron A. King, E. L. Ionides, C. M. Bret\\'o, S. P. Ellner, B. E. Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, and Daniel C. Reuman", - "pomp: Statistical inference for partially observed Markov processes (R package)", - "http://pomp.r-forge.r-project.org" - ) - ) - -citFooter("As pomp is continually evolving, you may want to cite its version number. Find it with 'help(package=pomp)'.") Deleted: branches/mif2/inst/ChangeLog =================================================================== --- branches/mif2/inst/ChangeLog 2014-04-17 13:13:21 UTC (rev 921) +++ branches/mif2/inst/ChangeLog 2014-04-17 13:21:28 UTC (rev 922) @@ -1,427 +0,0 @@ -2013-01-09 kingaa - - * [r806] R/mif-class.R, R/mif.R, R/pfilter.R, R/pmcmc.R, inst/NEWS, - man/mif-class.Rd, man/mif.Rd, man/pfilter.Rd, tests/ou2-mif2.R, - tests/ou2-mif2.Rout.save: - integrate MIF2 - * [r805] R/example.R: - improved 'pompExample' - * [r804] tests/bbs-trajmatch.R, tests/bbs-trajmatch.Rout.save, - tests/bbs.R, tests/bbs.Rout.save, tests/blowflies.R, - tests/blowflies.Rout.save, tests/dacca.R, tests/dacca.Rout.save, - tests/dimchecks.R, tests/dimchecks.Rout.save, tests/gillespie.R, - tests/gillespie.Rout.save, tests/gompertz.R, - tests/gompertz.Rout.save, tests/ou2-bsmc.R, - tests/ou2-bsmc.Rout.save, tests/ou2-forecast.R, - tests/ou2-forecast.Rout.save, tests/ou2-icfit.R, - tests/ou2-icfit.Rout.save, tests/ou2-kalman.R, - tests/ou2-kalman.Rout.save, tests/ou2-mif-fp.R, - tests/ou2-mif-fp.Rout.save, tests/ou2-mif.R, - tests/ou2-mif.Rout.save, tests/ou2-nlf.R, - tests/ou2-nlf.Rout.save, tests/ou2-pmcmc.R, - tests/ou2-pmcmc.Rout.save, tests/ou2-probe.R, - tests/ou2-probe.Rout.save, tests/ou2-procmeas.R, - tests/ou2-procmeas.Rout.save, tests/ou2-simulate.R, - tests/ou2-simulate.Rout.save, tests/ou2-trajmatch.R, - tests/ou2-trajmatch.Rout.save, tests/partrans.R, - tests/partrans.Rout.save, tests/pfilter.R, - tests/pfilter.Rout.save, tests/pomppomp.R, - tests/pomppomp.Rout.save, tests/ricker-bsmc.R, - tests/ricker-bsmc.Rout.save, tests/ricker-probe.R, - tests/ricker-probe.Rout.save, tests/ricker-spect.R, - tests/ricker-spect.Rout.save, tests/ricker.R, - tests/ricker.Rout.save, tests/rw2.R, tests/rw2.Rout.save, - tests/sir.R, tests/sir.Rout.save, tests/skeleton.R, - tests/skeleton.Rout.save, tests/steps.R, tests/steps.Rout.save, - tests/synlik.R, tests/synlik.Rout.save, tests/verhulst.R, - tests/verhulst.Rout.save: - improved 'pompExample' - * [r803] man/blowflies.Rd, man/dacca.Rd, man/example.Rd, - man/gompertz.Rd, man/init.state-pomp.Rd, man/ou2.Rd, - man/parmat.Rd, man/probe.Rd, man/ricker.Rd, man/rw2.Rd, - man/simulate-pomp.Rd, man/sir.Rd, man/spect.Rd, - man/traj-match.Rd, man/trajectory-pomp.Rd, man/verhulst.Rd: - - improved 'pompExample' - * [r802] man/pomp.Rd: - minor fix - * [r801] .Rbuildignore, DESCRIPTION, data/bbs.rda, - data/blowflies.rda, data/dacca.rda, data/euler.sir.rda, - data/gillespie.sir.rda, data/gompertz.rda, data/ou2.rda, - data/ricker.rda, data/rw2.rda, data/verhulst.rda, inst/NEWS, - inst/examples/bbs.R, inst/examples/euler.sir.R, - inst/examples/gillespie.sir.R, inst/examples/sir.R, - man/blowflies.Rd, man/dacca.Rd, man/example.Rd, man/gompertz.Rd, - man/init.state-pomp.Rd, man/ou2.Rd, man/parmat.Rd, man/probe.Rd, - man/ricker.Rd, man/rw2.Rd, man/simulate-pomp.Rd, man/sir.Rd, - man/spect.Rd, man/traj-match.Rd, man/trajectory-pomp.Rd, - man/verhulst.Rd, tests/bbs-trajmatch.R, - tests/bbs-trajmatch.Rout.save, tests/bbs.R, tests/bbs.Rout.save, - tests/blowflies.R, tests/blowflies.Rout.save, tests/dacca.R, - tests/dacca.Rout.save, tests/dimchecks.R, - tests/dimchecks.Rout.save, tests/fhn.Rout.save, - tests/filtfail.Rout.save, tests/gillespie.R, - tests/gillespie.Rout.save, tests/gompertz.R, - tests/gompertz.Rout.save, tests/logistic.Rout.save, - tests/ou2-bsmc.R, tests/ou2-bsmc.Rout.save, tests/ou2-forecast.R, - tests/ou2-forecast.Rout.save, tests/ou2-icfit.R, - tests/ou2-icfit.Rout.save, tests/ou2-kalman.R, - tests/ou2-kalman.Rout.save, tests/ou2-mif-fp.R, - tests/ou2-mif-fp.Rout.save, tests/ou2-mif.R, - tests/ou2-mif.Rout.save, tests/ou2-nlf.R, - tests/ou2-nlf.Rout.save, tests/ou2-pmcmc.R, - tests/ou2-pmcmc.Rout.save, tests/ou2-probe.R, - tests/ou2-probe.Rout.save, tests/ou2-procmeas.R, - tests/ou2-procmeas.Rout.save, tests/ou2-simulate.R, - tests/ou2-simulate.Rout.save, tests/ou2-trajmatch.R, - tests/ou2-trajmatch.Rout.save, tests/partrans.R, - tests/partrans.Rout.save, tests/pfilter.R, - tests/pfilter.Rout.save, tests/pomppomp.R, - tests/pomppomp.Rout.save, tests/ricker-bsmc.R, - tests/ricker-bsmc.Rout.save, tests/ricker-probe.R, - tests/ricker-probe.Rout.save, tests/ricker-spect.R, - tests/ricker-spect.Rout.save, tests/ricker.R, - tests/ricker.Rout.save, tests/rw2.R, tests/rw2.Rout.save, - tests/sir.R, tests/sir.Rout.save, tests/skeleton.R, - tests/skeleton.Rout.save, tests/steps.R, tests/steps.Rout.save, - tests/synlik.R, tests/synlik.Rout.save, tests/verhulst.R, - tests/verhulst.Rout.save: - get rid of all data()-loadable pomp - objects, replacing them with the new 'pompExample' facility - * [r800] DESCRIPTION, NAMESPACE, R/example.R, inst/data-R, - inst/examples/blowflies.R, inst/examples/dacca.R, - inst/examples/ewmeas.csv, inst/examples/gompertz.R, - inst/examples/ou2.R, inst/examples/ricker.R, inst/examples/rw2.R, - inst/examples/sir.R, inst/examples/verhulst.R: - remove - data()-loadable pomp objects in favor of the new 'pompExample' - mechanism. - -2013-01-08 kingaa - - * [r797] data/bbs.rda, data/blowflies.rda, data/dacca.rda, - data/euler.sir.rda, data/gillespie.sir.rda, data/gompertz.rda, - data/ou2.rda, data/ricker.rda, data/rw2.rda, data/verhulst.rda: - - update data directory - * [r794] DESCRIPTION, R/mif.R, tests/bbs.Rout.save, - tests/gompertz.Rout.save, tests/ou2-bsmc.Rout.save, - tests/ou2-mif.Rout.save: - update tests - * [r793] DESCRIPTION, R/pfilter.R, R/pomp-class.R, R/pomp.R: - some - changes preparatory to merging in mif2 - -2012-09-14 kingaa - - * [r780] src/pomp_fun.c: - more informative error message when - pomp_fun handler fails - -2012-08-22 kingaa - - * [r778] DESCRIPTION, inst/doc/advanced_topics_in_pomp.Rnw, - inst/doc/bsmc-ricker-flat-prior.rda, - inst/doc/bsmc-ricker-normal-prior.rda, - inst/doc/complex-sir-def.rda, inst/doc/fullnat.bst, - inst/doc/gompertz-multi-mif.rda, - inst/doc/gompertz-pfilter-guess.rda, - inst/doc/gompertz-trajmatch.rda, inst/doc/intro_to_pomp.Rnw, - inst/doc/nlf-block-boot.rda, inst/doc/nlf-boot.rda, - inst/doc/nlf-fit-from-truth.rda, inst/doc/nlf-fits.rda, - inst/doc/nlf-lag-tests.rda, inst/doc/nlf-multi-short.rda, - inst/doc/plugin-C-code.rda, inst/doc/plugin-R-code.rda, - inst/doc/pomp.bib, inst/doc/ricker-comparison.rda, - inst/doc/ricker-first-probe.rda, inst/doc/ricker-mif.rda, - inst/doc/ricker-probe-match.rda, inst/doc/ricker-probe.rda, - inst/doc/sim-sim.rda, inst/doc/sir-pomp-def.rda, - inst/doc/vectorized-C-code.rda, inst/doc/vectorized-R-code.rda: - - remove vignette codes - -2012-08-08 kingaa - - * [r765] DESCRIPTION, inst/doc/advanced_topics_in_pomp.Rnw, - inst/doc/advanced_topics_in_pomp.pdf, - inst/doc/bsmc-ricker-normal-prior.rda, - inst/doc/complex-sir-def.rda, - inst/doc/gompertz-pfilter-guess.rda, inst/doc/intro_to_pomp.Rnw, - inst/doc/intro_to_pomp.pdf, inst/doc/plugin-C-code.rda, - inst/doc/plugin-R-code.rda, inst/doc/ricker-comparison.rda, - inst/doc/ricker-first-probe.rda, inst/doc/ricker-probe.rda, - inst/doc/sim-sim.rda, inst/doc/sir-pomp-def.rda, - inst/doc/vectorized-C-code.rda, inst/doc/vectorized-R-code.rda: - - store more intermediate results in the building of the vignettes - to make vignette-checking quicker - -2012-08-03 kingaa - - * [r757] tests/fhn.R, tests/fhn.Rout.save, tests/ricker-spect.R, - tests/ricker-spect.Rout.save, tests/ricker.R, - tests/ricker.Rout.save, tests/rw2.R, tests/rw2.Rout.save, - tests/sir.R, tests/sir.Rout.save: - more modifications to test - files - * [r756] DESCRIPTION, inst/NEWS, tests/ou2-probe.R, - tests/ou2-probe.Rout.save, tests/ricker-bsmc.R, - tests/ricker-bsmc.Rout.save, tests/ricker-probe.R, - tests/ricker-probe.Rout.save: - clean up tests - -2012-07-31 kingaa - - * [r753] DESCRIPTION, R/authors.R, inst/NEWS, - man/pfilter-methods.Rd: - add authors list - - add documentation of 'cond.logLik' and 'eff.sample.size' - -2012-07-13 kingaa - - * [r752] DESCRIPTION, NAMESPACE, R/aaa.R, R/mif.R, - R/pfilter-methods.R, tests/gompertz.R, tests/gompertz.Rout.save, - tests/ou2-mif.Rout.save: - add 'eff.sample.size' and - 'cond.logLik' methods for 'pfilterd.pomp' objects - - make 'non-finite parameters' warning message more informative - * [r751] DESCRIPTION, src/dmeasure.c: - fix bug in 'dmeasure' when - log=T. bug found by R. Reiner. - -2012-07-10 kingaa - - * [r750] DESCRIPTION, R/builder.R, inst/include/pomp.h, src/pomp.h, - src/pomp_internal.h, src/sir.c: - fix bug with pompBuilder on mac - -2012-07-02 kingaa - - * [r744] DESCRIPTION: - require only R version >= 2.14.1 - -2012-07-01 kingaa - - * [r743] DESCRIPTION, inst/ChangeLog: - update changelog & date - * [r742] R/pomp-methods.R, R/pomp.R: - force storage.type to double - for params slot - -2012-06-29 kingaa - - * [r741] inst/ChangeLog, tests/sir.Rout.save: - update changelog - and unit test - * [r740] DESCRIPTION, R/pomp.R, inst/NEWS, man/pomp.Rd, - tests/sir.R: - add 'params' argument to 'pomp' constructor - * [r739] R/traj-match.R, man/traj-match.Rd, tests/bbs-trajmatch.R, - tests/bbs-trajmatch.Rout.save: - extra arguments (...) to - 'traj.match.objfun' are now passed on to the ODE integrator in - case the skeleton is a vectorfield - -2012-06-18 kingaa - - * [r732] inst/include/pomp.h: - update installed version of - 'pomp.h' - * [r731] DESCRIPTION, inst/NEWS, src/pomp.h: - update NEWS file - - minor changes to 'pomp.h' - -2012-06-12 kingaa - - * [r729] inst/doc/pomp.bib: - update bibliography database - -2012-06-01 kingaa - - * [r727] DESCRIPTION, demo/sir.R, inst/include/pomp.h, - src/lookup_table.c, src/pomp.h: - remove superfluous warnings - from 'lookup_table' - - fix 'sir' demo to work with covariate table - - add some inline functions to 'pomp.h' - * [r726] DESCRIPTION, R/builder.R, demo/gompertz.R, man/builder.Rd: - - fix incorrect error messages in 'pompBuilder' - - allow 'pompBuilder' to deal with covariates - -2012-05-29 kingaa - - * [r725] DESCRIPTION, R/builder.R, R/pomp.R, demo/gompertz.R, - demo/sir.R, man/builder.Rd, man/pomp.Rd: - add support for - parameter transformations to 'pompBuilder' - - more error-trapping in 'pomp' - - update demos to use compiled parameter transformations - - fix minor omission in 'pomp' man page - -2012-05-14 kingaa - - * [r722] DESCRIPTION: - update DESCRIPTION - * [r721] inst/ChangeLog, inst/NEWS, - inst/doc/advanced_topics_in_pomp.pdf, inst/doc/intro_to_pomp.pdf: - - update changelog NEWS file and vignettes - -2012-05-12 kingaa - - * [r716] DESCRIPTION, R/dmeasure-pomp.R, R/dprocess-pomp.R, - R/pomp-methods.R, R/rmeasure-pomp.R, R/rprocess-pomp.R, - R/skeleton-pomp.R, R/trajectory-pomp.R: - use fewer anonymous - functions - -2012-05-10 kingaa - - * [r715] DESCRIPTION, tests/sir.R, tests/sir.Rout.save: - add unit - test for new trajectory codes - -2012-05-09 kingaa - - * [r714] inst/ChangeLog: - -2012-05-08 kingaa - - * [r713] DESCRIPTION, R/trajectory-pomp.R, src/trajectory.c: - use - R_PreserveObject and R_ReleaseObject rather than the 'savelist' - trick - * [r711] DESCRIPTION: - -2012-05-07 kingaa - - * [r707] inst/ChangeLog, inst/NEWS: - update NEWS and ChangeLog - -2012-05-06 kingaa - - * [r706] inst/doc/advanced_topics_in_pomp.pdf, - inst/doc/intro_to_pomp.pdf: - update vignettes - -2012-05-03 kingaa - - * [r705] R/trajectory-pomp.R: - really fix bug in 'trajectory' that - occurs when 'zeronames' has length > 1 - * [r704] src/R_init_pomp.c: - forgot to export - 'get_pomp_userdata_int' and 'get_pomp_userdata_double' - * [r703] DESCRIPTION, R/builder.R, R/trajectory-pomp.R, demo/sir.R: - - fix bug in 'trajectory' for vectorfield case that shows up when - 'zeronames' has length > 1 - - re-work 'sir' demo so that it uses 'pompBuilder' - -2012-05-02 kingaa - - * [r702] inst/ChangeLog: - * [r701] R/trajectory-pomp.R, src/pomp_internal.h, src/skeleton.c, - src/trajectory.c: - work on the guts of the 'skeleton' and - 'trajectory' for speed up in vectorfield case - * [r700] tests/demos.R: - remove automatic running of demos (since - this fails under windows) - * [r699] R/builder.R: - add declarations for - 'get_pomp_userdata_int' and 'get_pomp_userdata_double' - * [r698] src/rmeasure.c: - remove unused variables - * [r697] DESCRIPTION, inst/ChangeLog: - * [r696] demo/gompertz.R, demo/sir.R, src/dmeasure.c, src/euler.c, - src/pomp_internal.h, src/rmeasure.c, src/skeleton.c, - src/trajectory.c, tests/demos.R, tests/examples.R: - changes to - eliminate pedantic warnings - - put covariate table interpolation into vectorfield trajectory - computation - * [r695] inst/ChangeLog: - * [r694] DESCRIPTION, R/trajectory-pomp.R, src/trajectory.c: - more - work on the guts of 'trajectory' for the vectorfield case - -2012-05-01 kingaa - - * [r693] src/trajectory.c: - make sure to set up 'userdata' access - to user functions - * [r692] inst/ChangeLog: - * [r691] R/simulate-pomp.R, R/trajectory-pomp.R, tests/ricker.R, - tests/ricker.Rout.save: - make 'sim' and 'traj' into factors when - 'simulate' or 'trajectory' are called with 'as.data.frame=TRUE' - -2012-04-30 kingaa - - * [r690] inst/doc/advanced_topics_in_pomp.pdf, - inst/doc/intro_to_pomp.pdf: - * [r689] inst/ChangeLog: - * [r688] DESCRIPTION, R/builder.R, inst/ChangeLog, man/builder.Rd, - src/trajectory.c: - rework the guts of 'iterate_map' for much - faster trajectory calculation - -2012-04-29 kingaa - - * [r687] src/dmeasure.c, src/skeleton.c: - more work on the guts - -2012-04-28 kingaa - - * [r686] DESCRIPTION, src/euler.c, src/rmeasure.c: - more changes - to the guts - -2012-04-27 kingaa - - * [r685] DESCRIPTION, R/pomp-fun.R, R/pomp.R, data/bbs.rda, - data/blowflies.rda, data/dacca.rda, data/euler.sir.rda, - data/gillespie.sir.rda, data/gompertz.rda, data/ou2.rda, - data/ricker.rda, data/rw2.rda, data/verhulst.rda, - inst/doc/advanced_topics_in_pomp.pdf, - inst/doc/bsmc-ricker-flat-prior.rda, - inst/doc/gompertz-multi-mif.rda, inst/doc/gompertz-trajmatch.rda, - inst/doc/intro_to_pomp.pdf, inst/doc/nlf-block-boot.rda, - inst/doc/nlf-boot.rda, inst/doc/nlf-fit-from-truth.rda, - inst/doc/nlf-fits.rda, inst/doc/nlf-lag-tests.rda, - inst/doc/nlf-multi-short.rda, inst/doc/ricker-mif.rda, - inst/doc/ricker-probe-match.rda, src/dmeasure.c, src/euler.c, - src/lookup_table.c, src/partrans.c, src/pomp_fun.c, - src/pomp_internal.h, src/rmeasure.c, src/skeleton.c: - changes to - the guts of 'rmeasure', 'dmeasure', 'partrans', and the Euler - rprocess plugins - -2012-04-26 kingaa - - * [r684] R/builder.R, demo/gompertz.R, inst/ChangeLog: - zeronames - argument in 'pompBuilder' is optional - * [r683] DESCRIPTION, NAMESPACE, R/builder.R, data/bbs.rda, - data/blowflies.rda, data/dacca.rda, data/euler.sir.rda, - data/gillespie.sir.rda, data/gompertz.rda, data/ou2.rda, - data/ricker.rda, data/rw2.rda, data/verhulst.rda, - demo/gompertz.R, demo/logistic.R, inst/ChangeLog, inst/NEWS, - inst/data-R/sir.R, inst/doc/advanced_topics_in_pomp.Rnw, - inst/doc/advanced_topics_in_pomp.pdf, inst/doc/intro_to_pomp.Rnw, - inst/doc/intro_to_pomp.pdf, inst/examples/gompertz.c, - inst/include/pomp.h, man/builder.Rd, src/R_init_pomp.c, - src/SSA_wrapper.c, src/dmeasure.c, src/euler.c, src/partrans.c, - src/pomp.h, src/pomp_internal.h, src/rmeasure.c, src/sir.c, - src/skeleton.c, src/userdata.c, tests/bbs.Rout.save, - tests/pfilter.Rout.save, tests/skeleton.R, - tests/skeleton.Rout.save: - add new facility for accessing - 'userdata' from within user-defined native routines: - get_pomp_userdata{,_int,_double} - - change some data()-loadable examples to make use of this - - make 'pompBuilder' visible - - modify 'gompertz' demo to make use of 'pompBuilder' - -2012-04-25 kingaa - - * [r682] inst/doc/advanced_topics_in_pomp.Rnw: - minor tweak to - pompBuilder example - * [r681] NAMESPACE, R/trajectory-pomp.R, src/trajectory.c: - put in - a routine to reset external variables after deSolve call - * [r680] src/bspline.c: - fix error message - -2012-04-24 kingaa - - * [r679] DESCRIPTION, R/builder.R, inst/ChangeLog, inst/NEWS, - inst/TODO, inst/doc/Makefile, - inst/doc/advanced_topics_in_pomp.Rnw, - inst/doc/advanced_topics_in_pomp.pdf: - put 'pompBuilder' - demonstration into 'advanced topics' vignette - * [r678] R/aaa.R, R/nlf-funcs.R, R/plot-pomp.R, R/pomp.R, - R/probe-match.R, R/probe.R, R/spect.R: - use 'paste0' where - appropriate. define 'paste0' for use with R <= 2.15.0 - -2012-04-23 kingaa - - * [r677] DESCRIPTION: - change Depends to 2.14.2 - * [r676] DESCRIPTION, R/builder.R, data/bbs.rda, - data/blowflies.rda, data/dacca.rda, data/euler.sir.rda, - data/gillespie.sir.rda, data/gompertz.rda, data/ou2.rda, - data/ricker.rda, data/rw2.rda, data/verhulst.rda, inst/NEWS, - inst/data-R/blowflies.R, src/blowfly.c, tests/blowflies.R, - tests/blowflies.Rout.save, tests/sir.Rout.save: - remove the - delay 'tau' from the blowflies example - - make the 'pompBuilder' work under 2.14.2 - - update the data()-loadable examples - -2012-04-21 kingaa - - * [r675] inst/doc/advanced_topics_in_pomp.pdf, - inst/doc/intro_to_pomp.pdf: - update vignettes - * [r674] DESCRIPTION, inst/ChangeLog, inst/NEWS: - bump version - number since R 2.15.0 is now needed - * [r673] inst/NEWS, tests/pfilter.Rout.save: - update unit tests - and NEWS - -2012-04-19 kingaa - - * [r670] DESCRIPTION, data/bbs.rda, data/blowflies.rda, - data/dacca.rda, data/euler.sir.rda, data/gillespie.sir.rda, - data/gompertz.rda, data/ou2.rda, data/ricker.rda, data/rw2.rda, - data/verhulst.rda, inst/data-R/blowflies.R, src/blowfly.c: - fix - segfault bug in blowfly example when tau is NA (thanks to Greg - Minshall for finding the bug) - -2012-04-17 kingaa - - * [r664] ., .Rbuildignore, .Rinstignore, DESCRIPTION, NAMESPACE, R, - data, demo, inst, man, src, tests: - move everything down one - level - Deleted: branches/mif2/inst/NEWS =================================================================== --- branches/mif2/inst/NEWS 2014-04-17 13:13:21 UTC (rev 921) +++ branches/mif2/inst/NEWS 2014-04-17 13:21:28 UTC (rev 922) @@ -1,511 +0,0 @@ -NEWS -0.45-4 - o changes in the way 'reulermultinom', 'deulermultinom', 'dot_product' are exported to other packages. Rather than just being exported as linkables, these are now also defined as static inline functions in the 'pomp.h' header. - -0.45-3 - o fix bug with 'continue' and method 'mif2' - -0.45-2 - o new method to coerce 'pfilterd.pomp' objects to data-frames. - -0.45-1 - o 'profileDesign' can now handle variables of mixed type. - -0.44-1 - o New 'mif2' option for 'mif'. - - o The default behavior for 'mif' and 'pfilter' with respect to filtering failures has been changed. - Before, the default behavior has been to stop with an error on the first filtering failure ('max.fail=0'). - Now, the default is 'max.fail=Inf', i.e., an error is never triggered. - - o The implementation of MIF cooling schedules has been changed to make it more general. - The cooling schedule is now specified by a 'type' and a 'fraction'. - Currently, supported 'cooling.type's include 'geometric' (the old behavior) and 'hyperbolic', i.e., a 1/(1+n) schedule. - The 'cooling.fraction' argument specifies the cooling at 50 iterations. - That is, if s is the intensity of the random-walk perturbation to parameters at the first iteration ('rw.sd'), then the intensity at iteration 50 is s*cooling.fraction. - - o Remove all data()-loadable pomp objects. - To load the prebuilt example pomp objects from previous versions, use the new 'pompExample' function. - E.g., instead of 'data(euler.sir)', do 'pompExample("euler.sir")'. - -0.43-4 - o Clean up tests. - -0.43-3 - o Fix bug in 'pompBuilder' on mac. - - o Fix bug in 'dmeasure' when log=TRUE. Bug located by R. Reiner. - - o Add 'eff.sample.size' and 'cond.logLik' methods for 'pfilterd.pomp' objects. - -0.43-1 - o Modify 'traj.match.objfun' to allow arbitrary parameters to be passed to the ODE integrator. - - o Add 'params' argument to 'pomp' so that parameters can be specified at the time the pomp object is created. - -0.42-6 - o Improve error checking in 'pomp'. - - o Add support for covariates to 'pompBuilder'. - - o Add native parameter transformation routines to the demos. - - o Change the warning behavior in 'lookup_table' so that warnings are not generated unless true extrapolation is performed (i.e., eliminate the warnings at the boundary). - - o Some small modifications to the 'pomp.h' header file. - -0.42-4 - o When 'trajectory' calls 'ode', there is a need to preserve information across calls to the vectorfield-evaluating function. - The code has been modified to do this in a cleaner way. - -0.42-2 - o Several minor bugs have been fixed. - See the ChangeLog for details. - -0.42-1 - o An EXPERIMENTAL facility for constructing pomp objects out of native C routines is now included (pompBuilder). - This facility is being actively developed and future changes may not be backward compatible. - - o A new facility allowing access to the 'userdata' slot of a pomp object from compiled 'rprocess', 'rmeasure', 'dprocess', 'dmeasure', 'skeleton', and 'partrans' codes is now available. - Calls to the new C routines 'get_pomp_userdata', 'get_pomp_userdata_int', and 'get_pomp_userdata_double' allow retrieval of these elements. - - o Some of the data()-loadable examples have been reworked to make use of the above facility. - The parameterization of these examples has changed. - These changes are not backward compatible: codes that depend on the data()-loadable examples may be broken. - -0.41-8 - o A demonstration of 'pompBuilder' has been put into the 'advanced topics' vignette. - -0.41-7 - o A bug in the 'blowflies' example has been fixed. - Thanks to Greg Minshall for discovering it. - -0.41-6 - o The 'gompertz' example parameter transformations have been changed. - No longer are the names of the parameter vector changed in the transformation. - This change is not backward-compatible, but only codes using this example are affected. - - o The 'euler.sir' and 'gillespie.sir' examples have been changed. - The transmission rate beta(t) is now the arithmetic sum of the seasonality basis functions. - Before, it was the geometric sum. [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 922 From noreply at r-forge.r-project.org Thu Apr 17 18:47:07 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 17 Apr 2014 18:47:07 +0200 (CEST) Subject: [Pomp-commits] r923 - in branches/mif2: . R inst man Message-ID: <20140417164707.69A79187479@r-forge.r-project.org> Author: kingaa Date: 2014-04-17 18:47:05 +0200 (Thu, 17 Apr 2014) New Revision: 923 Added: branches/mif2/R/generics.R branches/mif2/R/mif2-methods.R branches/mif2/R/mif2.R branches/mif2/inst/NEWS branches/mif2/inst/NEWS.Rd branches/mif2/man/mif2.Rd Removed: branches/mif2/R/authors.R branches/mif2/R/basic-probes.R branches/mif2/R/bsmc.R branches/mif2/R/bsplines.R branches/mif2/R/builder.R branches/mif2/R/compare-mif.R branches/mif2/R/compare-pmcmc.R branches/mif2/R/dmeasure-pomp.R branches/mif2/R/dprocess-pomp.R branches/mif2/R/eulermultinom.R branches/mif2/R/example.R branches/mif2/R/init-state-pomp.R branches/mif2/R/mif-class.R branches/mif2/R/mif-methods.R branches/mif2/R/mif.R branches/mif2/R/nlf-funcs.R branches/mif2/R/nlf-guts.R branches/mif2/R/nlf-objfun.R branches/mif2/R/nlf.R branches/mif2/R/parmat.R branches/mif2/R/particles-mif.R branches/mif2/R/pfilter-methods.R branches/mif2/R/pfilter.R branches/mif2/R/plot-pomp.R branches/mif2/R/plugins.R branches/mif2/R/pmcmc-methods.R branches/mif2/R/pmcmc.R branches/mif2/R/pomp-class.R branches/mif2/R/pomp-fun.R branches/mif2/R/pomp-methods.R branches/mif2/R/pomp.R branches/mif2/R/probe-match.R branches/mif2/R/probe.R branches/mif2/R/profile-design.R branches/mif2/R/rmeasure-pomp.R branches/mif2/R/rprocess-pomp.R branches/mif2/R/sannbox.R branches/mif2/R/simulate-pomp.R branches/mif2/R/skeleton-pomp.R branches/mif2/R/slice-design.R branches/mif2/R/sobol.R branches/mif2/R/spect-match.R branches/mif2/R/spect.R branches/mif2/R/traj-match.R branches/mif2/R/trajectory-pomp.R branches/mif2/inst/GPL branches/mif2/man/LondonYorke.Rd branches/mif2/man/basic-probes.Rd branches/mif2/man/blowflies.Rd branches/mif2/man/bsmc.Rd branches/mif2/man/bsplines.Rd branches/mif2/man/builder.Rd branches/mif2/man/dacca.Rd branches/mif2/man/dmeasure-pomp.Rd branches/mif2/man/dprocess-pomp.Rd branches/mif2/man/eulermultinom.Rd branches/mif2/man/example.Rd branches/mif2/man/gompertz.Rd branches/mif2/man/init.state-pomp.Rd branches/mif2/man/mif-class.Rd branches/mif2/man/mif-methods.Rd branches/mif2/man/mif.Rd branches/mif2/man/nlf.Rd branches/mif2/man/ou2.Rd branches/mif2/man/parmat.Rd branches/mif2/man/particles-mif.Rd branches/mif2/man/pfilter-methods.Rd branches/mif2/man/pfilter.Rd branches/mif2/man/plugins.Rd branches/mif2/man/pmcmc-methods.Rd branches/mif2/man/pmcmc.Rd branches/mif2/man/pomp-class.Rd branches/mif2/man/pomp-fun.Rd branches/mif2/man/pomp-methods.Rd branches/mif2/man/pomp-package.Rd branches/mif2/man/pomp.Rd branches/mif2/man/probe.Rd branches/mif2/man/probed-pomp-methods.Rd branches/mif2/man/profile-design.Rd branches/mif2/man/ricker.Rd branches/mif2/man/rmeasure-pomp.Rd branches/mif2/man/rprocess-pomp.Rd branches/mif2/man/rw2.Rd branches/mif2/man/sannbox.Rd branches/mif2/man/simulate-pomp.Rd branches/mif2/man/sir.Rd branches/mif2/man/skeleton-pomp.Rd branches/mif2/man/slice-design.Rd branches/mif2/man/sobol.Rd branches/mif2/man/spect.Rd branches/mif2/man/traj-match.Rd branches/mif2/man/trajectory-pomp.Rd branches/mif2/man/verhulst.Rd branches/mif2/src/ Modified: branches/mif2/DESCRIPTION branches/mif2/NAMESPACE branches/mif2/R/aaa.R branches/mif2/R/version.R Log: - remove overlap with 'pomp' Modified: branches/mif2/DESCRIPTION =================================================================== --- branches/mif2/DESCRIPTION 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/DESCRIPTION 2014-04-17 16:47:05 UTC (rev 923) @@ -1,37 +1,17 @@ -Package: pomp +Package: mif2 Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.46-1 -Date: 2013-10-30 -Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), +Version: 0.50-1 +Date: 2014-04-17 +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")), - person(given=c("Simon","N."),family="Wood",role=c("ctb")), - person(given="Dao",family="Nguyen",role=c("ctb")) ) -Maintainer: Aaron A. King -Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood, Dao Nguyen + 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, graphics, mvtnorm, subplex, deSolve -Imports: methods +Depends: R(>= 2.15.1), pomp(>= 0.49-1), methods License: GPL(>= 2) -LazyLoad: yes -LazyData: no -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 +LazyData: true +BuildVignettes: false +Collate: aaa.R generics.R version.R mif2.R mif2-methods.R Modified: branches/mif2/NAMESPACE =================================================================== --- branches/mif2/NAMESPACE 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/NAMESPACE 2014-04-17 16:47:05 UTC (rev 923) @@ -1,98 +1,6 @@ -useDynLib( - pomp, - 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, - mif_update, - 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 - ) +import(pomp) +import(methods) -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, - as.data.frame.pfilterd.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 - ) +exportClasses(mif2d.pomp) +exportMethods(mif2,continue,plot,conv.rec,logLik) +export() Modified: branches/mif2/R/aaa.R =================================================================== --- branches/mif2/R/aaa.R 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/R/aaa.R 2014-04-17 16:47:05 UTC (rev 923) @@ -1,25 +1,3 @@ -## .onAttach <- function (...) { -## version <- library(help=pomp)$info[[1L]] -## version <- strsplit(version[pmatch("Version",version)]," ")[[1L]] -## version <- version[nchar(version)>0][2L] -## packageStartupMessage("This is pomp version ",version,"\n") -## } - -setGeneric("print",function(x,...)standardGeneric("print")) -setGeneric("plot",function(x,y,...)standardGeneric("plot")) -setGeneric("summary",function(object,...)standardGeneric("summary")) -setGeneric("simulate",function(object,nsim=1,seed=NULL,...)standardGeneric("simulate")) -setGeneric("time",function(x,...)standardGeneric("time")) -setGeneric("coef",function(object,...)standardGeneric("coef")) -setGeneric("logLik",function(object,...)standardGeneric("logLik")) -setGeneric("window",function(x,...)standardGeneric("window")) -setGeneric("continue",function(object,...)standardGeneric("continue")) -setGeneric("pred.mean",function(object,...)standardGeneric("pred.mean")) -setGeneric("pred.var",function(object,...)standardGeneric("pred.var")) -setGeneric("filter.mean",function(object,...)standardGeneric("filter.mean")) -setGeneric("cond.logLik",function(object,...)standardGeneric("cond.logLik")) -setGeneric("eff.sample.size",function(object,...)standardGeneric("eff.sample.size")) - if (!exists("paste0",where="package:base")) { paste0 <- function(...) paste(...,sep="") } Deleted: branches/mif2/R/authors.R =================================================================== --- branches/mif2/R/authors.R 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/R/authors.R 2014-04-17 16:47:05 UTC (rev 923) @@ -1,12 +0,0 @@ -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("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")), - hw=person(given=c("Helen"),family="Wearing",role=c("ctb")), - snw=person(given=c("Simon","N."),family="Wood",role=c("ctb")) - ) -> author.list Deleted: branches/mif2/R/basic-probes.R =================================================================== --- branches/mif2/R/basic-probes.R 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/R/basic-probes.R 2014-04-17 16:47:05 UTC (rev 923) @@ -1,176 +0,0 @@ -probe.mean <- function (var, trim = 0, transform = identity, na.rm = TRUE) { - if (length(var)>1) stop(sQuote("probe.mean")," is a univariate probe") - transform <- match.fun(transform) - function(y) mean(x=transform(y[var,]),trim=trim,na.rm=na.rm) -} - -probe.median <- function (var, na.rm = TRUE) { - if (length(var)>1) stop(sQuote("probe.median")," is a univariate probe") - function(y) median(x=as.numeric(y[var,]),na.rm=na.rm) -} - -probe.var <- function (var, transform = identity, na.rm = TRUE) { - if (length(var)>1) stop(sQuote("probe.var")," is a univariate probe") - transform <- match.fun(transform) - function(y) var(x=transform(y[var,]),na.rm=na.rm) -} - -probe.sd <- function (var, transform = identity, na.rm = TRUE) { - if (length(var)>1) stop(sQuote("probe.sd")," is a univariate probe") - transform <- match.fun(transform) - function(y) sd(x=transform(y[var,]),na.rm=na.rm) -} - -probe.period <- function (var, kernel.width, transform = identity) { - if (length(var)>1) stop(sQuote("probe.period")," is a univariate probe") - transform <- match.fun(transform) - function (y) { - zz <- spec.pgram( - x=transform(y[var,]), - kernel=kernel("modified.daniell",m=kernel.width), - taper=0, - fast=FALSE, - pad=0, - detrend=FALSE, - plot=FALSE - ) - 1/zz$freq[which.max(zz$spec)] - } -} - -probe.quantile <- function (var, prob, transform = identity) { - if (length(var)>1) stop(sQuote("probe.quantile")," is a univariate probe") - transform <- match.fun(transform) - function (y) quantile(transform(y[var,]),probs=prob) -} - -probe.cov <- function ( - vars, - lag, - method = c("pearson", "kendall", "spearman"), - transform = identity - ) { - method <- match.arg(method) - lag <- as.integer(lag) - transform <- match.fun(transform) - var1 <- vars[1L] - if (length(vars)>1) - var2 <- vars[2L] - else - var2 <- var1 - function (y) { - if (lag>=0) { - val <- cov( - x=transform(y[var1,seq(from=1+lag,to=ncol(y),by=1)]), - y=transform(y[var2,seq(from=1,to=ncol(y)-lag,by=1)]), - method=method - ) - } else { - val <- cov( - x=transform(y[var1,seq(from=1,to=ncol(y)+lag,by=1)]), - y=transform(y[var2,seq(from=-lag,to=ncol(y),by=1)]), - method=method - ) - } - val - } -} - -probe.cor <- function ( - vars, - lag, - method = c("pearson", "kendall", "spearman"), - transform = identity - ) { - method <- match.arg(method) - lag <- as.integer(lag) - transform <- match.fun(transform) - var1 <- vars[1L] - if (length(vars)>1) - var2 <- vars[2L] - else - var2 <- var1 - function (y) { - if (lag>=0) { - val <- cor( - x=transform(y[var1,seq(from=1+lag,to=ncol(y),by=1)]), - y=transform(y[var2,seq(from=1,to=ncol(y)-lag,by=1)]), - method=method - ) - } else { - val <- cor( - x=transform(y[var1,seq(from=1,to=ncol(y)+lag,by=1)]), - y=transform(y[var2,seq(from=-lag,to=ncol(y),by=1)]), - method=method - ) - } - val - } -} - -probe.acf <- function (var, lags, type = c("covariance", "correlation"), transform = identity) { - type <- match.arg(type) - corr <- type=="correlation" - transform <- match.fun(transform) - if (corr && any(lags==0)) { - warning("useless zero lag discarded in ",sQuote("probe.acf")) - lags <- lags[lags!=0] - } - lags <- as.integer(lags) - function (y) .Call( - probe_acf, - x=transform(y[var,,drop=FALSE]), - lags=lags, - corr=corr - ) -} - -probe.ccf <- function (vars, lags, type = c("covariance", "correlation"), transform = identity) { - type <- match.arg(type) - corr <- type=="correlation" - transform <- match.fun(transform) - if (length(vars)!=2) - stop(sQuote("vars")," must name two variables") - lags <- as.integer(lags) - function (y) .Call( - probe_ccf, - x=transform(y[vars[1L],,drop=TRUE]), - y=transform(y[vars[2L],,drop=TRUE]), - lags=lags, - corr=corr - ) -} - -probe.marginal <- function (var, ref, order = 3, diff = 1, transform = identity) { - if (length(var)>1) stop(sQuote("probe.marginal")," is a univariate probe") - transform <- match.fun(transform) - setup <- .Call(probe_marginal_setup,transform(ref),order,diff) - function (y) .Call( - probe_marginal_solve, - x=transform(y[var,,drop=TRUE]), - setup=setup, - diff=diff - ) -} - -probe.nlar <- function (var, lags, powers, transform = identity) { - if (length(var)>1) stop(sQuote("probe.nlar")," is a univariate probe") - transform <- match.fun(transform) - if (any(lags<1)||any(powers<1)) - stop(sQuote("lags")," and ",sQuote("powers")," must be positive integers") - if (length(lags)1) stop(sQuote("lags")," must match ",sQuote("powers")," in length, or have length 1") - lags <- rep(lags,length(powers)) - } else if (length(lags)>length(powers)) { - if (length(powers)>1) stop(sQuote("powers")," must match ",sQuote("lags")," in length, or have length 1") - powers <- rep(powers,length(lags)) - } - lags <- as.integer(lags) - powers <- as.integer(powers) - function (y) .Call( - probe_nlar, - x=transform(y[var,,drop=TRUE]), - lags=lags, - powers=powers - ) -} Deleted: branches/mif2/R/bsmc.R =================================================================== --- branches/mif2/R/bsmc.R 2014-04-17 13:21:28 UTC (rev 922) +++ branches/mif2/R/bsmc.R 2014-04-17 16:47:05 UTC (rev 923) @@ -1,450 +0,0 @@ -## Bayesian particle filtering codes -## -## in annotation L&W AGM == Liu & West "A General Algorithm" -## -## params = the initial particles for the parameter values; -## these should be drawn from the prior distribution for the parameters -## est = names of parameters to estimate; other parameters are not updated. -## smooth = parameter 'h' from AGM -## ntries = number of samplesto draw from x_{t+1} | x(k)_{t} to estimate -## mean of mu(k)_t+1 as in sect 2.2 Liu & West -## lower = lower bounds on prior -## upper = upper bounds on prior - -setClass( - "bsmcd.pomp", - contains="pomp", - representation=representation( - transform="logical", - post="array", - prior="array", - est="character", - eff.sample.size="numeric", - smooth="numeric", - seed="integer", - nfail="integer", - cond.log.evidence="numeric", - log.evidence="numeric", - weights="numeric" - ) - ) - -setGeneric("bsmc",function(object,...)standardGeneric("bsmc")) - -bsmc.internal <- function (object, params, Np, est, - smooth = 0.1, - ntries = 1, - tol = 1e-17, - lower = -Inf, upper = Inf, - seed = NULL, - verbose = getOption("verbose"), - max.fail = 0, - transform = FALSE, - .getnativesymbolinfo = TRUE, - ...) { - - gnsi.rproc <- gnsi.dmeas <- as.logical(.getnativesymbolinfo) - ptsi.inv <- ptsi.for <- TRUE - transform <- as.logical(transform) - - if (missing(seed)) seed <- NULL - if (!is.null(seed)) { - if (!exists(".Random.seed",where=.GlobalEnv)) - runif(n=1L) ## need to initialize the RNG - save.seed <- get(".Random.seed",pos=.GlobalEnv) - set.seed(seed) - } - - error.prefix <- paste(sQuote("bsmc"),"error: ") - - if (missing(params)) { - if (length(coef(object))>0) { - params <- coef(object) - } else { - stop(error.prefix,sQuote("params")," must be supplied",call.=FALSE) - } - } - - if (missing(Np)) Np <- NCOL(params) - else if (is.matrix(params)&&(Np!=ncol(params))) - warning(sQuote("Np")," is ignored when ",sQuote("params")," is a matrix") - - if (transform) - params <- partrans(object,params,dir="inverse", - .getnativesymbolinfo=ptsi.inv) - ptsi.inv <- FALSE - - ntimes <- length(time(object)) - if (is.null(dim(params))) { - params <- matrix( - params, - nrow=length(params), - ncol=Np, - dimnames=list( - names(params), - NULL - ) - ) - } - - npars <- nrow(params) - paramnames <- rownames(params) - prior <- params - - if (missing(est)) - est <- paramnames[apply(params,1,function(x)diff(range(x))>0)] - estind <- match(est,paramnames) - npars.est <- length(estind) - - if (npars.est<1) - stop(error.prefix,"no parameters to estimate",call.=FALSE) - - if (is.null(paramnames)) - stop(error.prefix,sQuote("params")," must have rownames",call.=FALSE) - - if ((length(smooth)!=1)||(smooth>1)||(smooth<=0)) - stop(error.prefix,sQuote("smooth")," must be a scalar in [0,1)",call.=FALSE) - - hsq <- smooth^2 # see Liu & West eq(3.6) p10 - shrink <- sqrt(1-hsq) - - if ( - ((length(lower)>1)&&(length(lower)!=npars.est))|| - ((length(upper)>1)&&(length(upper)!=npars.est)) - ) { - stop( - error.prefix, - sQuote("lower")," and ",sQuote("upper"), - " must each have length 1 or length equal to that of ",sQuote("est"), - call.=FALSE - ) - } - - for (j in seq_len(Np)) { - if (any((params[estind,j]upper))) { - ind <- which((params[estind,j]upper)) - stop( - error.prefix, - "parameter(s) ",paste(paramnames[estind[ind]],collapse=","), - " in column ",j," in ",sQuote("params"), - " is/are outside the box defined by ", - sQuote("lower")," and ",sQuote("upper"), - call.=FALSE - ) - } - } - - xstart <- init.state( - object, - params=if (transform) { - partrans(object,params,dir="forward", - .getnativesymbolinfo=ptsi.for) - } else { - params - } - ) - statenames <- rownames(xstart) - nvars <- nrow(xstart) - ptsi.for <- FALSE - - times <- time(object,t0=TRUE) - x <- xstart - - evidence <- rep(NA,ntimes) - eff.sample.size <- rep(NA,ntimes) - nfail <- 0 - - mu <- array(data=NA,dim=c(nvars,Np,1)) - rownames(mu) <- rownames(xstart) - m <- array(data=NA,dim=c(npars,Np)) - rownames(m) <- rownames(params) - - for (nt in seq_len(ntimes)) { - - ## calculate particle means ; as per L&W AGM (1) - params.mean <- apply(params,1,mean) - ## calculate particle covariances : as per L&W AGM (1) - params.var <- cov(t(params[estind,,drop=FALSE])) - - if (verbose) { - cat("at step",nt,"(time =",times[nt+1],")\n") - print( - rbind( - prior.mean=params.mean[estind], - prior.sd=sqrt(diag(params.var)) - ) - ) - } - - ## update mean of states at time nt as per L&W AGM (1) - tries <- rprocess( - object, - xstart=parmat(x,nrep=ntries), - times=times[c(nt,nt+1)], - params=if (transform) { - partrans(object,params,dir="forward", - .getnativesymbolinfo=ptsi.for) - } else { - params - }, - offset=1, - .getnativesymbolinfo=gnsi.rproc - ) - dim(tries) <- c(nvars,Np,ntries,1) - mu <- apply(tries,c(1,2,4),mean) - rownames(mu) <- statenames - ## shrink parameters towards mean as per Liu & West eq (3.3) and L&W AGM (1) - m <- shrink*params+(1-shrink)*params.mean - gnsi.rproc <- FALSE - - ## evaluate probability of obervation given mean value of parameters and states (used in L&W AGM (5) below) - g <- dmeasure( - object, - y=object at data[,nt,drop=FALSE], - x=mu, - times=times[nt+1], - params=if (transform) { - partrans(object,m,dir="forward", - .getnativesymbolinfo=ptsi.for) - } else { - m - }, - .getnativesymbolinfo=gnsi.dmeas - ) - gnsi.dmeas <- FALSE - storeForEvidence1 <- log(sum(g)) - ## sample indices -- From L&W AGM (2) - ## k <- .Call(systematic_resampling,g) - k <- sample.int(n=Np,size=Np,replace=TRUE,prob=g) - params <- params[,k] - m <- m[,k] - g <- g[k] - - ## sample new parameter vector as per L&W AGM (3) and Liu & West eq(3.2) - pvec <- try( - mvtnorm::rmvnorm( - n=Np, - mean=rep(0,npars.est), - sigma=hsq*params.var, - method="svd" - ), - silent=FALSE - ) - if (inherits(pvec,"try-error")) - stop(error.prefix,"error in ",sQuote("rmvnorm"),call.=FALSE) - if (any(!is.finite(pvec))) - stop(error.prefix,"extreme particle depletion",call.=FALSE) - params[estind,] <- m[estind,]+t(pvec) - - if (transform) - tparams <- partrans(object,params,dir="forward", - .getnativesymbolinfo=ptsi.for) - - ## sample current state vector x^(g)_(t+1) as per L&W AGM (4) - X <- rprocess( - object, - xstart=x[,k,drop=FALSE], - times=times[c(nt,nt+1)], - params=if (transform) { - tparams - } else { - params - }, - offset=1, - .getnativesymbolinfo=gnsi.rproc - ) - - ## evaluate likelihood of observation given X (from L&W AGM (4)) - numer <- dmeasure( - object, - y=object at data[,nt,drop=FALSE], - x=X, - times=times[nt+1], - params=if (transform) { - tparams - } else { - params - }, - .getnativesymbolinfo=gnsi.dmeas - ) - ## evaluate weights as per L&W AGM (5) - - weights <- numer/g - storeForEvidence2 <- log(mean(weights)) - - ## apply box constraints as per the priors - for (j in seq_len(Np)) { - ## the following seems problematic: will it tend to make the boundaries repellors - if (any((params[estind,j]upper))) { - weights[j] <- 0 - } - ## might this rejection method be preferable? - ## while (any((params[estind,j]upper))) { - ## ## rejection method - ## pvec <- try( - ## mvtnorm::rmvnorm( - ## n=1, - ## mean=rep(0,npars.est), - ## sigma=hsq*params.var, - ## method="eigen" - ## ), - ## silent=FALSE - ## ) - ## if (inherits(pvec,"try-error")) - ## stop(error.prefix,"error in ",sQuote("rmvnorm"),call.=FALSE) - ## if (any(!is.finite(pvec))) - ## stop(error.prefix,"extreme particle depletion",call.=FALSE) - ## params[estind,j] <- m[estind,j]+pvec[1,] - ## } - } - - x[,] <- X - - ## test for failure to filter - dim(weights) <- NULL - failures <- ((weights Author: kingaa Date: 2014-04-17 18:48:19 +0200 (Thu, 17 Apr 2014) New Revision: 924 Removed: branches/mif2/tests/pfilter.R branches/mif2/tests/pfilter.Rout.save Log: - missed this Deleted: branches/mif2/tests/pfilter.R =================================================================== --- branches/mif2/tests/pfilter.R 2014-04-17 16:47:05 UTC (rev 923) +++ branches/mif2/tests/pfilter.R 2014-04-17 16:48:19 UTC (rev 924) @@ -1,35 +0,0 @@ -library(mif2) - -pompExample(ou2) - -set.seed(9994847L) - -pdf(file="pfilter.pdf") - -pf <- pfilter(ou2,Np=1000,seed=343439L) -print(coef(ou2,c('x1.0','x2.0','alpha.1','alpha.4')),digits=4) -cat("particle filter log likelihood at truth\n") -print(pf$loglik,digits=4) - -pf <- replicate(n=10,pfilter(ou2,Np=function(k)if(k<10) 10000 else 500)) -pf.ll <- sapply(pf,logLik) -ll.est <- log(mean(exp(pf.ll-mean(pf.ll))))+mean(pf.ll) -ll.se <- sd(exp(pf.ll-mean(pf.ll)))/exp(ll.est-mean(pf.ll))/sqrt(length(pf)) -print(round(c(loglik=ll.est,loglik.se=ll.se),digits=2)) - -pompExample(euler.sir) -pf <- pfilter(euler.sir,Np=100,seed=394343L) -print(coef(pf)) -print(pf$loglik,digits=4) - -p <- coef(euler.sir) -euler.sir at params <- numeric(0) -p["iota"] <- 1 -pf <- pfilter(euler.sir,params=p,Np=100,seed=394343L,filter.mean=TRUE) -print(coef(pf)) -print(logLik(pf),digits=4) -plot(cond.loglik~time,data=as(pf,"data.frame"),type='l') -plot(ess~time,data=as(pf,"data.frame"),type='l') -plot(filter.mean.I~time,data=as(pf,"data.frame"),type='l') - -dev.off() Deleted: branches/mif2/tests/pfilter.Rout.save =================================================================== --- branches/mif2/tests/pfilter.Rout.save 2014-04-17 16:47:05 UTC (rev 923) +++ branches/mif2/tests/pfilter.Rout.save 2014-04-17 16:48:19 UTC (rev 924) @@ -1,82 +0,0 @@ - -R version 3.0.3 (2014-03-06) -- "Warm Puppy" -Copyright (C) 2014 The R Foundation for Statistical Computing -Platform: x86_64-unknown-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. - -> library(mif2) -Loading required package: mvtnorm -Loading required package: subplex -Loading required package: nloptr -Loading required package: deSolve -> -> pompExample(ou2) -newly created pomp object(s): - ou2 -> -> set.seed(9994847L) -> -> pdf(file="pfilter.pdf") -> -> pf <- pfilter(ou2,Np=1000,seed=343439L) -> print(coef(ou2,c('x1.0','x2.0','alpha.1','alpha.4')),digits=4) - x1.0 x2.0 alpha.1 alpha.4 - -3.0 4.0 0.8 0.9 -> cat("particle filter log likelihood at truth\n") -particle filter log likelihood at truth -> print(pf$loglik,digits=4) -[1] -476.6 -> -> pf <- replicate(n=10,pfilter(ou2,Np=function(k)if(k<10) 10000 else 500)) -> pf.ll <- sapply(pf,logLik) -> ll.est <- log(mean(exp(pf.ll-mean(pf.ll))))+mean(pf.ll) -> ll.se <- sd(exp(pf.ll-mean(pf.ll)))/exp(ll.est-mean(pf.ll))/sqrt(length(pf)) -> print(round(c(loglik=ll.est,loglik.se=ll.se),digits=2)) - loglik loglik.se - -479.61 0.46 -> -> pompExample(euler.sir) -newly created pomp object(s): - euler.sir -> pf <- pfilter(euler.sir,Np=100,seed=394343L) -> print(coef(pf)) - gamma mu iota beta1 beta2 beta3 beta.sd pop -2.60e+01 2.00e-02 1.00e-02 4.00e+02 4.80e+02 3.20e+02 1.00e-03 2.10e+06 - rho overdisp S.0 I.0 R.0 -6.00e-01 1.00e+00 6.50e-02 1.00e-03 9.35e-01 -> print(pf$loglik,digits=4) -[1] -947.4 -> -> p <- coef(euler.sir) -> euler.sir at params <- numeric(0) -> p["iota"] <- 1 -> pf <- pfilter(euler.sir,params=p,Np=100,seed=394343L,filter.mean=TRUE) -> print(coef(pf)) - gamma mu iota beta1 beta2 beta3 beta.sd pop -2.60e+01 2.00e-02 1.00e+00 4.00e+02 4.80e+02 3.20e+02 1.00e-03 2.10e+06 - rho overdisp S.0 I.0 R.0 -6.00e-01 1.00e+00 6.50e-02 1.00e-03 9.35e-01 -> print(logLik(pf),digits=4) -[1] -945.4 -> plot(cond.loglik~time,data=as(pf,"data.frame"),type='l') -> plot(ess~time,data=as(pf,"data.frame"),type='l') -> plot(filter.mean.I~time,data=as(pf,"data.frame"),type='l') -> -> dev.off() -null device - 1 -> -> proc.time() - user system elapsed - 8.652 0.076 8.902 From noreply at r-forge.r-project.org Thu Apr 17 19:12:34 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 17 Apr 2014 19:12:34 +0200 (CEST) Subject: [Pomp-commits] r925 - branches pkg pkg/mif2/man pkg/mif2/tests Message-ID: <20140417171234.7BBAF185158@r-forge.r-project.org> Author: kingaa Date: 2014-04-17 19:12:34 +0200 (Thu, 17 Apr 2014) New Revision: 925 Added: pkg/mif2/ Removed: branches/mif2/ Modified: pkg/mif2/man/mif2.Rd pkg/mif2/tests/ou2-mif2.R pkg/mif2/tests/ou2-mif2.Rout.save Log: - move 'mif2' to 'pkg' directory Modified: pkg/mif2/man/mif2.Rd =================================================================== --- branches/mif2/man/mif2.Rd 2014-04-17 16:48:19 UTC (rev 924) +++ pkg/mif2/man/mif2.Rd 2014-04-17 17:12:34 UTC (rev 925) @@ -43,6 +43,9 @@ and so on, while when \code{T=length(time(object,t0=TRUE))}, \code{Np(T)} is the number of particles to sample at the end of the time-series. } + \item{perturb.fn}{ + \code(perturb.fn(params,mifiter,timeno,\dots)) + } \item{tol}{ See the description under \code{\link{pfilter}}. } @@ -60,14 +63,6 @@ additional arguments that override the defaults. } } -\section{Re-running MIF Iterations}{ -} -\section{Continuing MIF Iterations}{ -} -\section{Using MIF to estimate initial-value parameters only}{ -} -\section{Details}{ -} \references{ E. L. Ionides, A. Bhadra, Y. Atchad{\\'e}, & A. A. King, Iterated filtering, Modified: pkg/mif2/tests/ou2-mif2.R =================================================================== --- branches/mif2/tests/ou2-mif2.R 2014-04-17 16:48:19 UTC (rev 924) +++ pkg/mif2/tests/ou2-mif2.R 2014-04-17 17:12:34 UTC (rev 925) @@ -47,8 +47,12 @@ compare.mif(list(mif1a,mif2a)) set.seed(64857673L) -mif1b <- mif(ou2,Nmif=50,start=guess1, - pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +mif1b <- mif( + ou2, + Nmif=50, + start=guess1, + pars=c('alpha.2','alpha.3'), + ivps=c('x1.0','x2.0'), rw.sd=c( x1.0=0.5,x2.0=0.5, alpha.2=0.1,alpha.3=0.1), @@ -62,8 +66,12 @@ ) mif1b <- continue(mif1b,Nmif=50) -mif2b <- mif(ou2,Nmif=50,start=guess1, - pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +mif2b <- mif( + ou2, + Nmif=50, + start=guess1, + pars=c('alpha.2','alpha.3'), + ivps=c('x1.0','x2.0'), rw.sd=c( x1.0=0.5,x2.0=0.5, alpha.2=0.1,alpha.3=0.1), @@ -79,8 +87,12 @@ ) mif2b <- continue(mif2b,Nmif=50) -mif2c <- mif(ou2,Nmif=50,start=guess1, - pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +mif2c <- mif( + ou2, + Nmif=50, + start=guess1, + pars=c('alpha.2','alpha.3'), + ivps=c('x1.0','x2.0'), rw.sd=c( x1.0=0.5,x2.0=0.5, alpha.2=0.1,alpha.3=0.1), @@ -95,10 +107,8 @@ mif2c <- continue(mif2c,Nmif=50) compare.mif(list(mif1b,mif2b)) - compare.mif(list(mif1a,mif1b)) compare.mif(list(mif2a,mif2b)) - compare.mif(list(mif1b,mif2c)) mif3a <- mif2( @@ -131,6 +141,4 @@ Np=1000 ) - - dev.off() Modified: pkg/mif2/tests/ou2-mif2.Rout.save =================================================================== --- branches/mif2/tests/ou2-mif2.Rout.save 2014-04-17 16:48:19 UTC (rev 924) +++ pkg/mif2/tests/ou2-mif2.Rout.save 2014-04-17 17:12:34 UTC (rev 925) @@ -1,5 +1,5 @@ -R version 3.0.3 (2014-03-06) -- "Warm Puppy" +R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) @@ -16,6 +16,7 @@ Type 'q()' to quit R. > library(mif2) +Loading required package: pomp Loading required package: mvtnorm Loading required package: subplex Loading required package: nloptr @@ -33,10 +34,13 @@ > guess2[c('x1.0','x2.0','alpha.2','alpha.3')] <- 1.2*guess1[c('x1.0','x2.0','alpha.2','alpha.3')] > > set.seed(64857673L) -> mif1a <- mif(ou2,Nmif=100,start=guess1, +> mif1a <- mif( ++ ou2, ++ Nmif=100, ++ start=guess1, + pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), + rw.sd=c( -+ x1.0=.5,x2.0=.5, ++ x1.0=0.5,x2.0=0.5, + alpha.2=0.1,alpha.3=0.1), + transform=F, + Np=1000, @@ -51,7 +55,7 @@ > mif2a <- mif(ou2,Nmif=100,start=guess1, + pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), + rw.sd=c( -+ x1.0=0.5,x2.0=.5, ++ x1.0=0.5,x2.0=0.5, + alpha.2=0.1,alpha.3=0.1), + transform=F, + Np=1000, @@ -67,10 +71,14 @@ > compare.mif(list(mif1a,mif2a)) > > set.seed(64857673L) -> mif1b <- mif(ou2,Nmif=50,start=guess1, -+ pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +> mif1b <- mif( ++ ou2, ++ Nmif=50, ++ start=guess1, ++ pars=c('alpha.2','alpha.3'), ++ ivps=c('x1.0','x2.0'), + rw.sd=c( -+ x1.0=.5,x2.0=.5, ++ x1.0=0.5,x2.0=0.5, + alpha.2=0.1,alpha.3=0.1), + transform=F, + Np=1000, @@ -82,10 +90,14 @@ + ) > mif1b <- continue(mif1b,Nmif=50) > -> mif2b <- mif(ou2,Nmif=50,start=guess1, -+ pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +> mif2b <- mif( ++ ou2, ++ Nmif=50, ++ start=guess1, ++ pars=c('alpha.2','alpha.3'), ++ ivps=c('x1.0','x2.0'), + rw.sd=c( -+ x1.0=0.5,x2.0=.5, ++ x1.0=0.5,x2.0=0.5, + alpha.2=0.1,alpha.3=0.1), + transform=F, + Np=1000, @@ -102,10 +114,14 @@ See '?mif' for instructions on specifying the cooling schedule. > mif2b <- continue(mif2b,Nmif=50) > -> mif2c <- mif(ou2,Nmif=50,start=guess1, -+ pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'), +> mif2c <- mif( ++ ou2, ++ Nmif=50, ++ start=guess1, ++ pars=c('alpha.2','alpha.3'), ++ ivps=c('x1.0','x2.0'), + rw.sd=c( -+ x1.0=0.5,x2.0=.5, ++ x1.0=0.5,x2.0=0.5, + alpha.2=0.1,alpha.3=0.1), + transform=F, + Np=1000, @@ -118,16 +134,44 @@ > mif2c <- continue(mif2c,Nmif=50) > > compare.mif(list(mif1b,mif2b)) -> > compare.mif(list(mif1a,mif1b)) > compare.mif(list(mif2a,mif2b)) -> > compare.mif(list(mif1b,mif2c)) > +> mif3a <- mif2( ++ ou2, ++ Nmif=50, ++ start=guess1, ++ perturb.fn=function(params,mifiter,timeno,...){ ++ pert <- params ++ ic.sd <- c(x1.0=0.5,x2.0=0.5) ++ par.sd <- c(alpha.2=0.1,alpha.3=0.1) ++ frac <- 0.05 ++ nT <- length(time(ou2)) ++ theta <- (1-frac)/frac/(50*nT-1) ++ sigma <- 1/(1+theta*((mifiter-1)*nT+timeno-1)) ++ if (timeno==1) { ++ pert[names(ic.sd)] <- rnorm( ++ n=length(ic.sd), ++ mean=pert[names(ic.sd)], ++ sd=ic.sd*sigma ++ ) ++ } ++ pert[names(par.sd)] <- rnorm( ++ n=length(par.sd), ++ mean=pert[names(par.sd)], ++ sd=par.sd*sigma ++ ) ++ pert ++ }, ++ transform=FALSE, ++ Np=1000 ++ ) +> > dev.off() null device 1 > > proc.time() user system elapsed - 50.335 0.068 50.772 +273.761 0.368 275.385 From noreply at r-forge.r-project.org Thu Apr 17 19:30:38 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 17 Apr 2014 19:30:38 +0200 (CEST) Subject: [Pomp-commits] r926 - in pkg/pomp: . inst/doc Message-ID: <20140417173038.AFD2F186F8E@r-forge.r-project.org> Author: kingaa Date: 2014-04-17 19:30:38 +0200 (Thu, 17 Apr 2014) New Revision: 926 Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/manual.pdf Log: - set BuildVignettes to false - update manual Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-17 17:12:34 UTC (rev 925) +++ pkg/pomp/DESCRIPTION 2014-04-17 17:30:38 UTC (rev 926) @@ -21,7 +21,7 @@ Depends: R(>= 2.15.1), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve License: GPL(>= 2) LazyData: true -BuildVignettes: true +BuildVignettes: false MailingList: Subscribe to pomp-announce at r-forge.r-project.org for announcements by going to http://lists.r-forge.r-project.org/mailman/listinfo/pomp-announce. Collate: aaa.R authors.R generics.R version.R eulermultinom.R plugins.R parmat.R logmeanexp.R slice-design.R Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Fri Apr 18 13:24:16 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 18 Apr 2014 13:24:16 +0200 (CEST) Subject: [Pomp-commits] r927 - in pkg/mif2: . man Message-ID: <20140418112416.E6268186BC9@r-forge.r-project.org> Author: kingaa Date: 2014-04-18 13:24:16 +0200 (Fri, 18 Apr 2014) New Revision: 927 Added: pkg/mif2/man/mif2-class.Rd pkg/mif2/man/mif2-methods.Rd Modified: pkg/mif2/DESCRIPTION pkg/mif2/man/mif2.Rd Log: - fix some documentation problems Modified: pkg/mif2/DESCRIPTION =================================================================== --- pkg/mif2/DESCRIPTION 2014-04-17 17:30:38 UTC (rev 926) +++ pkg/mif2/DESCRIPTION 2014-04-18 11:24:16 UTC (rev 927) @@ -1,8 +1,8 @@ Package: mif2 Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-1 -Date: 2014-04-17 +Version: 1.0-1 +Date: 2014-04-18 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")), Added: pkg/mif2/man/mif2-class.Rd =================================================================== --- pkg/mif2/man/mif2-class.Rd (rev 0) +++ pkg/mif2/man/mif2-class.Rd 2014-04-18 11:24:16 UTC (rev 927) @@ -0,0 +1,51 @@ +\name{mif2d.pomp-class} +\docType{class} +\alias{mif2d.pomp-class} +\keyword{internal} +\title{The "mif2d.pomp" class} +\description{ + The \code{mif2d.pomp} class holds a fitted model and is created by a call to \code{\link{mif2}}. + See \code{\link{mif2}} for usage. +} +\section{Objects from the Class}{ + Objects can be created by calls to the \code{\link{mif2}} method on a \code{\link{pomp}} or \code{\link[pomp]{pfilterd.pomp-class}} object. + Such a call uses the MIF2 algorithm to fit the model parameters. +} +\section{Slots}{ + A \code{mif2d.pomp} object is derived from a \code{pfilterd.pomp} object and therefore has all the slots of such an object. + The \code{mif2d.pomp} specific slots are described below. + \describe{ + \item{transform}{ + logical scalar; was the estimation done on the transformed scale? + } + \item{Nmif}{ + integer; number of MIF2 iterations that have been completed. + } + \item{perturb.fn}{ + function. + } + \item{conv.rec}{ + The \dQuote{convergence record}: a matrix containing a record of the parameter values, log likelihoods, and other pertinent information, with one row for each MIF2 iteration. + } + \item{pred.mean, pred.var, filter.mean, + eff.sample.size, cond.loglik, saved.states, saved.params, seed, + Np, tol, nfail, loglik, + data, times, t0, rprocess, dprocess, dmeasure, rmeasure, + skeleton.type, skeleton, initializer, states, params, + statenames, paramnames, covarnames, obsnames, tcovar, covar, + PACKAGE, userdata}{ + Inherited from the \code{pfilterd.pomp} class. + } + } +} +\section{Extends}{ + Class \code{pfilterd.pomp}, directly. + See \code{\link{pfilter}}. +} +\section{Methods}{ + See \code{\link{mif2}}, \link{mif2-methods}. +} +\author{Aaron A. King \email{kingaa at umich dot edu}} +\seealso{\code{\link[pomp]{mif}}, \link{mif2-methods}, \code{\link[pomp]{pomp}}, \link[pomp]{pomp-class}} +\keyword{models} +\keyword{ts} Added: pkg/mif2/man/mif2-methods.Rd =================================================================== --- pkg/mif2/man/mif2-methods.Rd (rev 0) +++ pkg/mif2/man/mif2-methods.Rd 2014-04-18 11:24:16 UTC (rev 927) @@ -0,0 +1,56 @@ +\name{mif2-methods} +\docType{methods} +\alias{mif2-methods} +\alias{logLik,mif2d.pomp-method} +\alias{logLik-mif2d.pomp} +\alias{conv.rec,mif2d.pomp-method} +\alias{conv.rec-mif2d.pomp} +\alias{plot-mif2d.pomp} +\alias{plot,mif2d.pomp-method} +\title{Methods of the "mif2d.class" class} +\description{Methods of the \code{mif2d.class} class.} +\usage{ +\S4method{logLik}{mif2d.pomp}(object, \dots) +\S4method{conv.rec}{mif2d.pomp}(object, pars, transform = FALSE, \dots) +\S4method{plot}{mif2d.pomp}(x, y = NULL, \dots) +} +\arguments{ + \item{object, x}{The \code{mif2d.pomp} object.} + \item{pars}{Names of parameters.} + \item{y}{Ignored.} + \item{transform}{ + optional logical; + should the parameter transformations be applied? + See \code{\link[=coef-pomp]{coef}} for details. + } + \item{\dots}{ + Further arguments (either ignored or passed to underlying functions). + } +} +\section{Methods}{ + \describe{ + \item{conv.rec}{ + \code{conv.rec(object, pars = NULL)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. + By default, all rows are returned. + } + \item{logLik}{ + Returns the value in the \code{loglik} slot. + } + \item{plot}{ + Plots a series of diagnostic plots. + } + } +} +\references{ + E. L. Ionides, C. Bret\\'o, & A. A. King, + Inference for nonlinear dynamical systems, + Proc. Natl. Acad. Sci. U.S.A., 103:18438--18443, 2006. + + A. A. King, E. L. Ionides, M. Pascual, and M. J. Bouma, + Inapparent infections and cholera dynamics, + Nature, 454:877--880, 2008. +} +\author{Aaron A. King \email{kingaa at umich dot edu}} +\seealso{\code{\link{mif}}, \code{\link{pomp}}, \code{\link{pomp-class}}, \code{\link{pfilter}}} +\keyword{models} +\keyword{ts} Modified: pkg/mif2/man/mif2.Rd =================================================================== --- pkg/mif2/man/mif2.Rd 2014-04-17 17:30:38 UTC (rev 926) +++ pkg/mif2/man/mif2.Rd 2014-04-18 11:24:16 UTC (rev 927) @@ -44,7 +44,7 @@ \code{Np(T)} is the number of particles to sample at the end of the time-series. } \item{perturb.fn}{ - \code(perturb.fn(params,mifiter,timeno,\dots)) + \code{perturb.fn(params,mifiter,timeno,\dots)} } \item{tol}{ See the description under \code{\link{pfilter}}. From noreply at r-forge.r-project.org Fri Apr 18 17:40:16 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 18 Apr 2014 17:40:16 +0200 (CEST) Subject: [Pomp-commits] r928 - in pkg/pomp: . R man Message-ID: <20140418154016.143D618131F@r-forge.r-project.org> Author: kingaa Date: 2014-04-18 17:40:15 +0200 (Fri, 18 Apr 2014) New Revision: 928 Modified: pkg/pomp/DESCRIPTION pkg/pomp/R/abc.R pkg/pomp/R/bsmc.R pkg/pomp/R/mif.R pkg/pomp/R/pfilter.R pkg/pomp/R/pmcmc.R pkg/pomp/R/pomp-class.R pkg/pomp/R/probe-match.R pkg/pomp/R/probe.R pkg/pomp/R/rprocess-pomp.R pkg/pomp/R/spect.R pkg/pomp/R/traj-match.R pkg/pomp/man/eulermultinom.Rd pkg/pomp/man/gompertz.Rd pkg/pomp/man/mif-class.Rd pkg/pomp/man/mif-methods.Rd pkg/pomp/man/pomp.Rd Log: - use 'slots' instead of 'representation' in class definitions ('setClass'). Note this has the effect of requiring R>=3.0.0. - improvements/corrections in the documentation Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/DESCRIPTION 2014-04-18 15:40:15 UTC (rev 928) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.50-1 -Date: 2014-04-17 +Date: 2014-04-18 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")), @@ -18,7 +18,7 @@ ) URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.15.1), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve +Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve License: GPL(>= 2) LazyData: true BuildVignettes: false Modified: pkg/pomp/R/abc.R =================================================================== --- pkg/pomp/R/abc.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/abc.R 2014-04-18 15:40:15 UTC (rev 928) @@ -2,7 +2,7 @@ setClass( 'abc', contains='pomp', - representation=representation( + slots=c( pars = 'character', transform = 'logical', Nabc = 'integer', Modified: pkg/pomp/R/bsmc.R =================================================================== --- pkg/pomp/R/bsmc.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/bsmc.R 2014-04-18 15:40:15 UTC (rev 928) @@ -14,7 +14,7 @@ setClass( "bsmcd.pomp", contains="pomp", - representation=representation( + slots=c( transform="logical", post="array", prior="array", Modified: pkg/pomp/R/mif.R =================================================================== --- pkg/pomp/R/mif.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/mif.R 2014-04-18 15:40:15 UTC (rev 928) @@ -4,7 +4,7 @@ setClass( 'mif', contains='pfilterd.pomp', - representation=representation( + slots=c( transform = "logical", ivps = 'character', pars = 'character', Modified: pkg/pomp/R/pfilter.R =================================================================== --- pkg/pomp/R/pfilter.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/pfilter.R 2014-04-18 15:40:15 UTC (rev 928) @@ -3,7 +3,7 @@ setClass( "pfilterd.pomp", contains="pomp", - representation=representation( + slots=c( pred.mean="array", pred.var="array", filter.mean="array", Modified: pkg/pomp/R/pmcmc.R =================================================================== --- pkg/pomp/R/pmcmc.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/pmcmc.R 2014-04-18 15:40:15 UTC (rev 928) @@ -2,14 +2,14 @@ setClass( 'pmcmc', contains='pfilterd.pomp', - representation( - pars = 'character', - transform = 'logical', - Nmcmc = 'integer', - random.walk.sd = 'numeric', - conv.rec = 'matrix', - log.prior = 'numeric' - ) + slots=c( + pars = 'character', + transform = 'logical', + Nmcmc = 'integer', + random.walk.sd = 'numeric', + conv.rec = 'matrix', + log.prior = 'numeric' + ) ) pmcmc.internal <- function (object, Nmcmc, Modified: pkg/pomp/R/pomp-class.R =================================================================== --- pkg/pomp/R/pomp-class.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/pomp-class.R 2014-04-18 15:40:15 UTC (rev 928) @@ -14,7 +14,7 @@ ## define the pomp class setClass( 'pomp', - representation=representation( + slots=c( data = 'array', times = 'numeric', t0 = 'numeric', @@ -69,7 +69,7 @@ has.trans=FALSE, par.trans=pomp.fun(), par.untrans=pomp.fun(), - PACKAGE="", + PACKAGE=character(0), userdata=list() ), validity=function (object) { Modified: pkg/pomp/R/probe-match.R =================================================================== --- pkg/pomp/R/probe-match.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/probe-match.R 2014-04-18 15:40:15 UTC (rev 928) @@ -1,7 +1,7 @@ setClass( "probe.matched.pomp", contains="probed.pomp", - representation=representation( + slots=c( transform="logical", est="character", fail.value="numeric", Modified: pkg/pomp/R/probe.R =================================================================== --- pkg/pomp/R/probe.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/probe.R 2014-04-18 15:40:15 UTC (rev 928) @@ -1,15 +1,15 @@ setClass( "probed.pomp", contains="pomp", - representation( - probes="list", - datvals="numeric", - simvals="array", - quantiles="numeric", - pvals="numeric", - synth.loglik="numeric", - seed="integer" - ) + slots=c( + probes="list", + datvals="numeric", + simvals="array", + quantiles="numeric", + pvals="numeric", + synth.loglik="numeric", + seed="integer" + ) ) probe.internal <- function (object, probes, params, nsim = 1, seed = NULL, ...) { Modified: pkg/pomp/R/rprocess-pomp.R =================================================================== --- pkg/pomp/R/rprocess-pomp.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/rprocess-pomp.R 2014-04-18 15:40:15 UTC (rev 928) @@ -3,7 +3,10 @@ rprocess.internal <- function (object, xstart, times, params, offset = 0, .getnativesymbolinfo = TRUE, ...) .Call(do_rprocess,object,xstart,times,params,offset,.getnativesymbolinfo) -setMethod("rprocess","pomp", - function (object, xstart, times, params, offset = 0, ...) - rprocess.internal(object=object,xstart=xstart,times=times,params=params,offset=offset,...) +setMethod( + "rprocess", + signature=signature(object="pomp"), + definition=function (object, xstart, times, params, offset = 0, ...) { + rprocess.internal(object=object,xstart=xstart,times=times,params=params,offset=offset,...) + } ) Modified: pkg/pomp/R/spect.R =================================================================== --- pkg/pomp/R/spect.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/spect.R 2014-04-18 15:40:15 UTC (rev 928) @@ -6,7 +6,7 @@ setClass( "spect.pomp", contains="pomp", - representation=representation( + slots=c( kernel.width="numeric", transform="function", freq="numeric", Modified: pkg/pomp/R/traj-match.R =================================================================== --- pkg/pomp/R/traj-match.R 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/R/traj-match.R 2014-04-18 15:40:15 UTC (rev 928) @@ -1,7 +1,7 @@ setClass( "traj.matched.pomp", contains="pomp", - representation=representation( + slots=c( transform="logical", est="character", evals="integer", Modified: pkg/pomp/man/eulermultinom.Rd =================================================================== --- pkg/pomp/man/eulermultinom.Rd 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/man/eulermultinom.Rd 2014-04-18 15:40:15 UTC (rev 928) @@ -38,7 +38,7 @@ \code{deulermultinom(x=x,size=N,rate=r,dt=dt)}. - Breto & Ionides discuss how an infinitesimally overdispersed death process can be constructed by compounding a binomial process with a Gamma white noise process. + Bret\'o & Ionides discuss how an infinitesimally overdispersed death process can be constructed by compounding a binomial process with a Gamma white noise process. The Euler approximation of the resulting process can be obtained as follows. Let the increments of the equidispersed process be given by @@ -49,15 +49,14 @@ That is, \eqn{\Delta W} has mean \eqn{\Delta t} and variance \eqn{\sigma^2 \Delta t}. The resulting process is overdispersed and converges (as \eqn{\Delta t} goes to zero) to a well-defined process. The following lines of \R code accomplish this: - - \code{dW <- rgammawn(sigma=sigma,dt=dt)} - - \code{dn <- reulermultinom(size=N,rate=r,dt=dW)} - + \preformatted{ + dW <- rgammawn(sigma=sigma,dt=dt) + dn <- reulermultinom(size=N,rate=r,dt=dW) + } or - - \code{dn <- reulermultinom(size=N,rate=r*dW/dt,dt=dt)}. - + \preformatted{ + dn <- reulermultinom(size=N,rate=r*dW/dt,dt=dt). + } He et al. use such overdispersed death processes in modeling measles. For all of the functions described here, direct access to the underlying C routines is available: @@ -86,7 +85,7 @@ print(dn <- reulermultinom(5,size=100,rate=c(a=1,b=2,c=3),dt=dW)) } \references{ - C. Bret\\'o & E. L. Ionides, + C. Bret\'o & E. L. Ionides, Compound Markov counting processes and their applications to modeling infinitesimally over-dispersed systems. Stoch. Proc. Appl., 121:2571--2591, 2011. Modified: pkg/pomp/man/gompertz.Rd =================================================================== --- pkg/pomp/man/gompertz.Rd 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/man/gompertz.Rd 2014-04-18 15:40:15 UTC (rev 928) @@ -18,6 +18,6 @@ coef(gompertz,transform=TRUE) } \seealso{ - \code{\link{pomp-class}} and the "intro_to_pomp" vignette. + the \dQuote{Introduction to \pkg{pomp}} vignette } \keyword{datasets} Modified: pkg/pomp/man/mif-class.Rd =================================================================== --- pkg/pomp/man/mif-class.Rd 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/man/mif-class.Rd 2014-04-18 15:40:15 UTC (rev 928) @@ -13,24 +13,23 @@ } \section{Slots}{ A \code{mif} object is derived from a \code{pfilterd.pomp} object and therefore has all the slots of such an object. - See \code{\link{pomp-class}} for details. - A full description of slots in a \code{mif} object follows. + A description of \code{mif}-specific slots follows. \describe{ \item{ivps}{ - A character vector containing the names of initial-value parameters (IVPs). + character; contains the names of initial-value parameters (IVPs). These are parameters which are to be estimated using fixed-lag smoothing. } \item{pars}{ - A character vector containing the names of parameters to be estimated using MIF. + character; contains the names of parameters to be estimated using MIF. } \item{transform}{ - A logical scalar; was the estimation done on the transformed scale? + logical scalar; was the estimation done on the transformed scale? } \item{Nmif}{ - Number of MIF iterations that have been completed. + integer; number of MIF iterations that have been completed. } \item{particles}{ - A function of prototype \code{particles(Np,center,sd,...)} that draws particles from a distribution centered on \code{center} and with width proportional to \code{sd}. + function of prototype \code{particles(Np,center,sd,...)} that draws particles from a distribution centered on \code{center} and with width proportional to \code{sd}. This function can be optionally specified by the user. } \item{var.factor}{ @@ -46,10 +45,10 @@ character; the mif update method. } \item{random.walk.sd}{ - A named vector containing the random-walk variance to be used for ordinary parameters. + named vector containing the random-walk variance to be used for ordinary parameters. } \item{conv.rec}{ - The \dQuote{convergence record}: a matrix containing a record of the parameter values, log likelihoods, and other pertinent information, with one row for each MIF iteration. + the \dQuote{convergence record}: a matrix containing a record of the parameter values, log likelihoods, and other pertinent information, with one row for each MIF iteration. } \item{pred.mean, pred.var, filter.mean, eff.sample.size, cond.loglik, saved.states, saved.params, seed, @@ -63,22 +62,13 @@ } } \section{Extends}{ - Class \code{pomp}, directly. - See \code{\link{pomp-class}}. + Class \code{pfilterd.pomp}, directly. + See \code{\link{pfilter}}. } \section{Methods}{ See \code{\link{mif}}, \link{mif-methods}, \link{particles-mif} } -\references{ - E. L. Ionides, C. Bret\\'o, & A. A. King, - Inference for nonlinear dynamical systems, - Proc. Natl. Acad. Sci. U.S.A., 103:18438--18443, 2006. - - A. A. King, E. L. Ionides, M. Pascual, and M. J. Bouma, - Inapparent infections and cholera dynamics, - Nature, 454:877--880, 2008. -} \author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\code{\link{mif}}, \link{mif-methods}, \code{\link{pomp}}, \link{pomp-class}} +\seealso{\code{\link{mif}}, \link{mif-methods}, \code{\link{pfilter}}, \code{\link{pomp}}, \link{pomp-class}} \keyword{models} \keyword{ts} Modified: pkg/pomp/man/mif-methods.Rd =================================================================== --- pkg/pomp/man/mif-methods.Rd 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/man/mif-methods.Rd 2014-04-18 15:40:15 UTC (rev 928) @@ -10,7 +10,7 @@ \alias{plot,mif-method} \alias{compare.mif} \title{Methods of the "mif" class} -\description{Methods of the "mif" class.} +\description{Methods of the \code{mif} class.} \usage{ \S4method{logLik}{mif}(object, \dots) \S4method{conv.rec}{mif}(object, pars, transform = FALSE, \dots) @@ -41,10 +41,6 @@ \item{logLik}{ Returns the value in the \code{loglik} slot. } - \item{mif}{ - Re-runs the MIF iterations. - See the documentation for \code{\link{mif}}. - } \item{compare.mif}{ Given a \code{mif} object or a list of \code{mif} objects, \code{compare.mif} produces a set of diagnostic plots. } @@ -52,29 +48,8 @@ Plots a series of diagnostic plots. When \code{x} is a \code{mif} object, \code{plot(x)} is equivalent to \code{compare.mif(list(x))}. } - \item{predvarplot}{ - \code{predvarplot(object, pars = NULL, mean = FALSE, \dots)} produces a plot of the scaled prediction variances for each parameter. - This can be used to diagnose a good value of the \code{mif} parameters \code{var.factor} and \code{ic.lag}. - If used in this way, one should run \code{mif} with \code{Nmif=1} first. - Additional arguments in \code{\dots} will be passed to the actual plotting function. - } - \item{print}{ - Prints a summary of the \code{mif} object. - } - \item{show}{ - Displays the \code{mif} object. - } } } -\references{ - E. L. Ionides, C. Bret\\'o, & A. A. King, - Inference for nonlinear dynamical systems, - Proc. Natl. Acad. Sci. U.S.A., 103:18438--18443, 2006. - - A. A. King, E. L. Ionides, M. Pascual, and M. J. Bouma, - Inapparent infections and cholera dynamics, - Nature, 454:877--880, 2008. -} \author{Aaron A. King \email{kingaa at umich dot edu}} \seealso{\code{\link{mif}}, \code{\link{pomp}}, \code{\link{pomp-class}}, \code{\link{pfilter}}} \keyword{models} Modified: pkg/pomp/man/pomp.Rd =================================================================== --- pkg/pomp/man/pomp.Rd 2014-04-18 11:24:16 UTC (rev 927) +++ pkg/pomp/man/pomp.Rd 2014-04-18 15:40:15 UTC (rev 928) @@ -10,7 +10,8 @@ \alias{pomp-pomp} \title{Partially-observed Markov process object.} \description{ - Create a new \code{pomp} object to hold a partially-observed Markov process model together with a uni- or multi-variate time series. + This function creates a \code{pomp} object, + encoding a partially-observed Markov process model together with a uni- or multi-variate time series. } \usage{ \S4method{pomp}{data.frame}(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure, @@ -41,18 +42,20 @@ \arguments{ \item{data, times}{ The time series data and times at which observations are made. - \code{data} can be specified as a vector, a matrix, a data-frame, or a \code{pomp} object.. + \code{data} can be specified as a vector, a matrix, a data-frame, or a \code{pomp} object. + If \code{data} is a numeric vector, \code{times} must be a numeric vector of the same length. + If \code{data} is a matrix, it should have dimensions \code{nobs} x \code{ntimes}, where \code{nobs} is the number of observed variables and \code{ntimes} is the number of times at which observations were made (i.e., each column is a distinct observation of the \code{nobs} variables). In this case, \code{times} must be given as a numeric vector (of length \code{ntimes}). - If \code{data} is a data-frame, \code{times} must name of the column of observation times. - Note that, in this case, \code{data} is a data-frame, it will be internally coerced to an array with storage-mode \sQuote{double}. + + If \code{data} is a data-frame, \code{times} must name the column of observation times. + Note that, in this case, \code{data} will be internally coerced to an array with storage-mode \sQuote{double}. Note that the \code{times} must be numeric and strictly increasing. } \item{t0}{ - The zero-time. - This must be no later than the time of the first observation, \code{times[1]}. - The stochastic dynamical system is initialized at time \code{t0}. + The zero-time: the stochastic dynamical system is initialized at time \code{t0}. + This must be no later than the time of the first observation, i.e., \code{t0 <= times[1]}. } \item{rprocess}{ optional function; a function of prototype \code{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process. @@ -84,15 +87,18 @@ } \item{measurement.model}{ optional; a formula or list of formulae, specifying the measurement model. - These formulae are parsed internally and used to generate \code{rmeasure} and \code{dmeasure} functions. + These formulae are parsed internally to generate \code{rmeasure} and \code{dmeasure} functions. If \code{measurement.model} is given it overrides any specification of \code{rmeasure} or \code{dmeasure}. See below for an example. - \strong{NB:} it will typically be possible to acclerate measurement model computations by writing \code{dmeasure} and/or \code{rmeasure} functions directly. + \strong{NB:} This is a convenience function, primarily designed to facilitate exploration; + it will typically be possible to acclerate measurement model computations by writing \code{dmeasure} and/or \code{rmeasure} functions directly. } \item{skeleton, skeleton.type, skelmap.delta.t}{ The function \code{skeleton} specifies the deterministic skeleton of the unobserved Markov process. - If we are dealing with a discrete-time Markov process, its deterministic skeleton is a map: indicate this by specifying \code{skeleton.type="map"}. - If we are dealing with a continuous-time Markov process, its deterministic skeleton is a vectorfield: indicate this by specifying \code{skeleton.type="vectorfield"}. + If we are dealing with a discrete-time Markov process, its deterministic skeleton is a map: + indicate this by specifying \code{skeleton.type="map"}. + If we are dealing with a continuous-time Markov process, its deterministic skeleton is a vectorfield: + indicate this by specifying \code{skeleton.type="vectorfield"}. The skeleton function can be specified in one of two ways: (1) as an \R function of prototype \code{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or @@ -104,6 +110,7 @@ } \item{initializer}{ optional function of prototype \code{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters. + By default (i.e., if it is unspecified when \code{pomp} is called), the initializer assumes any parameters in \code{params} the names of which end in \dQuote{\code{.0}} are initial values. These are simply copied over as initial conditions when \code{init.state} is called (see \code{\link{init.state-pomp}}). The names of the state variables are the same as the corresponding initial value parameters, but with the \dQuote{\code{.0}} dropped. @@ -122,25 +129,31 @@ } \item{params}{ optional named numeric vector of parameters. + This will be coerced internally to storage mode \code{double}. } \item{covar, tcovar}{ - An optional table of covariates: \code{covar} is the table (with one column per variable) and \code{tcovar} the corresponding times (one entry per row of \code{covar}). + An optional table of covariates: + \code{covar} is the table (one column per variable); + \code{tcovar} the corresponding times (one entry per row of \code{covar}). + \code{covar} can be specified as either a matrix or a data frame. In either case the columns are taken to be distinct covariates. If \code{covar} is a data frame, \code{tcovar} can be either the name or the index of the time variable. - If a covariate table is supplied, then the value of each of the covariates is interpolated as needed, i.e., whenever \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, or \code{init.state} is evaluated. + + If a covariate table is supplied, then the value of each of the covariates is interpolated as needed, i.e., whenever \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}, or \code{init.state} is evaluated. The resulting interpolated values are passed to the corresponding functions as a numeric vector named \code{covars}. } \item{obsnames, statenames, paramnames, covarnames}{ - Optional character vectors specifying the names of observables, state variables, parameters, or covariates, respectively. - These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}) are defined using native routines. + Optional character vectors specifying the names of observables, state variables, parameters, and covariates, respectively. + These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}) are defined using native routines. In that case, these name vectors are matched against the corresponding names and the indices of the names are passed to the native routines. - Using this facility allows one to write one or more of \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton} in native code in a way that does not depend on the order of states, parameters, and covariates at run time. - See the \dQuote{Advanced topics in pomp} vignette for more on this topic and examples. + These vectors should list the parameters in the order that the native code expects them. + Using this facility allows one to write one or more of the basic functions in native code in a way that does not depend on the order of states, parameters, and covariates at run time. + See the \dQuote{Advanced topics in pomp} vignette for more on this topic, including examples. } \item{zeronames}{ Optional character vector specifying the names of accumulator variables. - See the \dQuote{Advanced topics in pomp} vignette for a discussion of this. + See the \dQuote{Advanced topics in pomp} vignette for a discussion of accumulator variables. } \item{PACKAGE}{ An optional string giving the name of the dynamically loaded library in which any native routines are to be found. @@ -153,21 +166,19 @@ Note that it is the user's responsibility to make sure this holds. If \code{obj} is the constructed \code{pomp} object, and \code{coef(obj)} is non-empty, a simple check of this is - \code{x <- coef(obj,transform=TRUE)} - - \code{obj1 <- obj} - - \code{coef(obj1,transform=TRUE) <- x} - - \code{identical(coef(obj),coef(obj1))} - - \code{identical(coef(obj1,transform=TRUE),x)}. + \preformatted{ + x <- coef(obj,transform=TRUE) + obj1 <- obj + coef(obj1,transform=TRUE) <- x + identical(coef(obj),coef(obj1)) + identical(coef(obj1,transform=TRUE),x). + } By default, both functions are the identity transformation. See the \dQuote{introduction_to_pomp} vignette for an example. } \item{\dots}{ - Any additional arguments given to \code{pomp} will be stored in the \code{\link[=pomp-class]{pomp}} object and passed as arguments to each of the functions \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, and \code{initializer} whenever they are evaluated. + Any additional arguments given to \code{pomp} will be stored in the \code{\link[=pomp-class]{pomp}} object and passed as arguments to each of the basic functions whenever they are evaluated. } } \value{ @@ -177,26 +188,19 @@ } \details{ \strong{ - It is not typically necessary (or desirable, or even feasible) to define all of the functions \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, and \code{skeleton} in any given problem. + It is not typically necessary (or even feasible) to define all of the functions \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, and \code{skeleton} in any given problem. Each algorithm makes use of a different subset of these functions. } - In general, the specification of process-model codes \code{rprocess} and/or \code{dprocess} can be somewhat nontrivial: - for this reason, \code{\link{plugins}} have been developed to streamline this process for the user. + Specification of process-model codes \code{rprocess} and/or \code{dprocess} in most cases is facilitated by so-called \code{\link{plugins}} that have been developed to handle common use-cases. Currently, if one's process model evolves in discrete time or one is willing to make such an approximation (e.g., via an Euler approximation), then the \code{\link{euler.sim}}, \code{\link{discrete.time.sim}}, or \code{\link{onestep.sim}} plugin for \code{rprocess} and \code{\link{onestep.dens}} plugin for \code{dprocess} are available. For exact simulation of certain continuous-time Markov chains, an implementation of Gillespie's algorithm is available (see \code{\link{gillespie.sim}}). To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes. - It is anticipated that, in specific cases, it will be possible to obtain increased computational efficiency by writing custom versions of \code{rprocess} and/or \code{dprocess}. + In specific cases, it may be possible to obtain increased computational efficiency by writing custom versions of \code{rprocess} and/or \code{dprocess}. See the \dQuote{Advanced topics in pomp} vignette for a discussion of this. If such custom versions are desired, the following describes how each of these functions should be written in this case. \describe{ \item{\code{rprocess}}{ - In general, the specification of \code{rprocess} can be somewhat nontrivial: - for this reason, \code{\link{plugins}} have been developed to streamline this process for the user. - Currently, if one's process model evolves in discrete time or one is willing to make such an approximation (e.g., via an Euler approximation), then the \code{\link{euler.sim}} or \code{\link{onestep.sim}} plugin is available. - For exact simulation of certain continuous-time Markov chains, an implementation of Gillespie's algorithm is available (see \code{\link{gillespie.sim}}). - To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes. - If the plugins are not used \code{rprocess} must have at least the following arguments: \code{xstart}, \code{times}, \code{params}, and \code{\dots}. It can also take additional arguments. @@ -216,11 +220,6 @@ The rownames of \code{x} must correspond to those of \code{xstart}. } \item{\code{dprocess}}{ - In general, the specification of \code{dprocess} can be somewhat nontrivial: - for this reason, \code{\link{plugins}} have been developed to streamline this process for the user. - Currently, if one's process model evolves in discrete time or one is willing to make such an approximation (e.g., via an Euler approximation), then the \code{\link{onestep.dens}} plugin for \code{dprocess} is available. - To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes. - If the plugins are not used, \code{dprocess} must have at least the following arguments: \code{x}, \code{times}, \code{params}, \code{log}, and \code{\dots}. It may take additional arguments. @@ -245,8 +244,7 @@ } } - The measurement-model, deterministic skeleton, and initializer components are easily specified without the use of plugins. - The following is a guide to writing these components. + The following is a guide to writing the measurement-model, deterministic skeleton, and initializer components. \describe{ \item{\code{rmeasure}}{ if provided, must take at least the arguments \code{x}, \code{t}, \code{params}, and \code{\dots}. @@ -307,9 +305,9 @@ \section{Warning}{ Some error checking is done by \code{pomp}, but complete error checking is impossible. If the user-specified functions do not conform to the above specifications (see Details), then the results may be invalid. - In particular, if both \code{rmeasure} and \code{dmeasure} are specified, the user should verify that these two functions correspond to the same model and if \code{skeleton} is specified, the user is responsible for verifying that it corresponds to the true deterministic skeleton of the model. - Each \pkg{pomp}-package algorithm uses some subset of the five basic components (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}). - If an algorithm requires a component that was not given in the construction of the \code{pomp} object, an error is generated. + In particular, if both \code{rmeasure} and \code{dmeasure} are specified, the user should verify that these two functions correspond to the same probability distribution and if \code{skeleton} is specified, the user is responsible for verifying that it corresponds to the true deterministic skeleton of the model. + Each \pkg{pomp}-package algorithm uses some subset of the five basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}). + If an algorithm requires a component that has not been specified, an informative error will be generated. } \author{Aaron A. King \email{kingaa at umich dot edu}} \seealso{ From noreply at r-forge.r-project.org Fri Apr 18 17:41:12 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 18 Apr 2014 17:41:12 +0200 (CEST) Subject: [Pomp-commits] r929 - pkg/pomp/R Message-ID: <20140418154113.0C31A18418D@r-forge.r-project.org> Author: kingaa Date: 2014-04-18 17:41:12 +0200 (Fri, 18 Apr 2014) New Revision: 929 Modified: pkg/pomp/R/spect-match.R Log: - missed one Modified: pkg/pomp/R/spect-match.R =================================================================== --- pkg/pomp/R/spect-match.R 2014-04-18 15:40:15 UTC (rev 928) +++ pkg/pomp/R/spect-match.R 2014-04-18 15:41:12 UTC (rev 929) @@ -1,7 +1,7 @@ setClass( "spect.matched.pomp", contains="spect.pomp", - representation=representation( + slots=c( est="character", fail.value="numeric", weights="numeric", From noreply at r-forge.r-project.org Mon Apr 21 03:01:45 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 21 Apr 2014 03:01:45 +0200 (CEST) Subject: [Pomp-commits] r930 - in pkg/pomp: . R demo inst inst/doc inst/examples man src tests Message-ID: <20140421010145.4E425180FB0@r-forge.r-project.org> Author: kingaa Date: 2014-04-21 03:01:42 +0200 (Mon, 21 Apr 2014) New Revision: 930 Added: pkg/pomp/R/csnippet.R pkg/pomp/man/csnippet.Rd Removed: pkg/pomp/man/mif-class.Rd pkg/pomp/man/pomp-class.Rd Modified: pkg/pomp/DESCRIPTION pkg/pomp/NAMESPACE pkg/pomp/R/builder.R pkg/pomp/R/generics.R pkg/pomp/R/plugins.R pkg/pomp/R/pomp-class.R pkg/pomp/R/pomp-fun.R pkg/pomp/R/pomp.R pkg/pomp/demo/gompertz.R pkg/pomp/demo/sir.R pkg/pomp/inst/NEWS pkg/pomp/inst/NEWS.Rd pkg/pomp/inst/doc/manual.pdf pkg/pomp/inst/examples/blowflies.R pkg/pomp/man/builder.Rd pkg/pomp/man/mif.Rd pkg/pomp/man/pomp-fun.Rd pkg/pomp/man/pomp.Rd pkg/pomp/src/SSA_wrapper.c pkg/pomp/src/dmeasure.c pkg/pomp/src/dprior.c pkg/pomp/src/dprocess.c pkg/pomp/src/euler.c pkg/pomp/src/initstate.c pkg/pomp/src/partrans.c pkg/pomp/src/rmeasure.c pkg/pomp/src/rprior.c pkg/pomp/src/rprocess.c pkg/pomp/src/skeleton.c pkg/pomp/src/trajectory.c pkg/pomp/tests/pomppomp.R pkg/pomp/tests/pomppomp.Rout.save pkg/pomp/tests/sir.Rout.save Log: - add new 'Csnippet' class - rework 'pomp.fun' and plugins using S4 methods - add capacity for handling C snippets to basic functions & plugins - modify demo/sir.R and demo/gompertz.R to use new facilities - remove 'obsnames', 'paramnames', 'statenames', 'covarnames' from 'pomp' class: transfer these to 'pomp.fun' class - 'pomp.fun' is now a method - remove separate documentation of 'pomp' class and 'mif' class. - add support for compiled 'globals' to 'pomp' - add support for prior distributions to 'pompBuilder' - better commentary inside 'pomp' - remove redundant error checking inside 'pomp' (make use of S4-class validation mechanisms) - move linking operation inside 'pompCBuilder' - random 'name' generation inside 'pompCBuilder' when name isn't supplied Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/DESCRIPTION 2014-04-21 01:01:42 UTC (rev 930) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.50-1 -Date: 2014-04-18 +Date: 2014-04-20 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")), @@ -24,9 +24,10 @@ BuildVignettes: false MailingList: Subscribe to pomp-announce at r-forge.r-project.org for announcements by going to http://lists.r-forge.r-project.org/mailman/listinfo/pomp-announce. Collate: aaa.R authors.R generics.R version.R eulermultinom.R - plugins.R parmat.R logmeanexp.R slice-design.R + csnippet.R pomp-fun.R plugins.R + parmat.R logmeanexp.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R - pomp-fun.R pomp-class.R pomp.R pomp-methods.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 dprior-pomp.R rprior-pomp.R Modified: pkg/pomp/NAMESPACE =================================================================== --- pkg/pomp/NAMESPACE 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/NAMESPACE 2014-04-21 01:01:42 UTC (rev 930) @@ -47,7 +47,8 @@ traj.matched.pomp, probed.pomp,probe.matched.pomp, spect.pomp,spect.matched.pomp, - abc + abc, + Csnippet ) exportMethods( @@ -71,6 +72,7 @@ export( as.data.frame.pomp, as.data.frame.pfilterd.pomp, + Csnippet, reulermultinom, deulermultinom, rgammawn, Modified: pkg/pomp/R/builder.R =================================================================== --- pkg/pomp/R/builder.R 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/R/builder.R 2014-04-21 01:01:42 UTC (rev 930) @@ -1,31 +1,12 @@ -setClass( - "pompCode", - representation=representation( - type="character", - slot="character", - text="character", - fun="function" - ), - prototype=prototype( - type="ccode", - slot=character(0), - text=character(0), - fun=function(...)stop("function not specified") - ) - ) - - -CCode <- function (text, slot) { - new("pompCode",type="ccode",slot=as.character(slot)) -} - pompBuilder <- function (data, times, t0, name, statenames, paramnames, tcovar, covar, rmeasure, dmeasure, step.fn, step.fn.delta.t, skeleton, skeleton.type = c("map","vectorfield"), skelmap.delta.t = 1, parameter.transform, parameter.inv.transform, + rprior, dprior, globals, ..., link = TRUE, save = FALSE) { + if (!is.data.frame(data)) stop(sQuote("data")," must be a data-frame") obsnames <- names(data) obsnames <- setdiff(obsnames,times) @@ -39,6 +20,15 @@ covarnames <- character(0) } skeleton.type <- match.arg(skeleton.type) + + if (missing(statenames)) stop(sQuote("statenames")," must be supplied"); + if (missing(paramnames)) stop(sQuote("paramnames")," must be supplied"); + + mpt <- missing(parameter.transform) + mpit <- missing(parameter.inv.transform) + if (xor(mpt,mpit)) + stop("if you supply one transformation function, you must supply its inverse") + pompCBuilder( name=name, statenames=statenames, @@ -51,35 +41,34 @@ skeleton=skeleton, parameter.transform=parameter.transform, parameter.inv.transform=parameter.inv.transform, + rprior=rprior, + dprior=dprior, globals=globals, + link=link, save=save - ) - if (link) { - if (save) { - pompLink(name) - } else { - pompLink(file.path(tempdir(),name)) - } - } + ) -> name + pomp( - data=data,times=times,t0=t0, + data=data, + times=times, + t0=t0, rprocess=euler.sim( - step.fun=render("{%name%}_stepfn",name=name), + step.fun=render(fnames$step.fn,name=name), delta.t=step.fn.delta.t, PACKAGE=name ), - rmeasure=render("{%name%}_rmeasure",name=name), - dmeasure=render("{%name%}_dmeasure",name=name), - skeleton=render("{%name%}_skelfn",name=name), + rmeasure=render(fnames$rmeasure,name=name), + dmeasure=render(fnames$dmeasure,name=name), + skeleton=render(fnames$skeleton,name=name), skeleton.type=skeleton.type, skelmap.delta.t=skelmap.delta.t, - parameter.transform=render("{%name%}_par_trans",name=name), - parameter.inv.transform=render("{%name%}_par_untrans",name=name), + parameter.transform=render(fnames$parameter.transform,name=name), + parameter.inv.transform=render(fnames$parameter.inv.transform,name=name), + rprior=render(fnames$rprior,name=name), + dprior=render(fnames$dprior,name=name), PACKAGE=name, - obsnames=obsnames, statenames=statenames, paramnames=paramnames, - covarnames=covarnames, tcovar=tcovar, covar=covar, ... @@ -112,9 +101,23 @@ step.fn="\nvoid {%name%}_stepfn (double *__x, const double *__p, const int *__stateindex, const int *__parindex, const int *__covindex, int __covdim, const double *__covars, double t, double dt)\n{\n", skeleton="\nvoid {%name%}_skelfn (double *__f, double *__x, double *__p, int *__stateindex, int *__parindex, int *__covindex, int __ncovars, double *__covars, double t)\n{\n", parameter.transform="\nvoid {%name%}_par_trans (double *__pt, double *__p, int *__parindex)\n{\n", - parameter.inv.transform="\nvoid {%name%}_par_untrans (double *__pt, double *__p, int *__parindex)\n{\n" + parameter.inv.transform="\nvoid {%name%}_par_untrans (double *__pt, double *__p, int *__parindex)\n{\n", + rprior="\nvoid {%name%}_rprior (double *__p, int *__parindex)\n{\n", + dprior="\nvoid {%name%}_dprior (double *__lik, double *__p, int give_log, int *__parindex)\n{\n" ) + +fnames <- list( + rmeasure="{%name%}_rmeasure", + dmeasure= "{%name%}_dmeasure", + step.fn="{%name%}_stepfn", + skeleton="{%name%}_skelfn", + parameter.transform="{%name%}_par_trans", + parameter.inv.transform="{%name%}_par_untrans", + rprior="{%name%}_rprior", + dprior="{%name%}_dprior" + ) + decl <- list( periodic_bspline_basis_eval="\tvoid (*periodic_bspline_basis_eval)(double,double,int,int,double*);\nperiodic_bspline_basis_eval = (void (*)(double,double,int,int,double*)) R_GetCCallable(\"pomp\",\"periodic_bspline_basis_eval\");\n", get_pomp_userdata_int="\tconst int * (*get_pomp_userdata_int)(const char *);\nget_pomp_userdata_int = (const int *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_int\");\n", @@ -128,7 +131,9 @@ step.fn="\n}\n\n", skeleton="\n}\n\n", parameter.transform="\n}\n\n", - parameter.inv.transform="\n}\n\n" + parameter.inv.transform="\n}\n\n", + rprior="\n}\n\n", + dprior="\n}\n\n" ) utility.fns <- list() @@ -145,21 +150,24 @@ pompCBuilder <- function (name, statenames, paramnames, covarnames, obsnames, rmeasure, dmeasure, step.fn, skeleton, parameter.transform, parameter.inv.transform, - globals, save = FALSE) + rprior, dprior, globals, save = FALSE, link = TRUE) { - if (missing(name)) stop(sQuote("name")," must be supplied"); - if (missing(statenames)) stop(sQuote("statenames")," must be supplied"); - if (missing(paramnames)) stop(sQuote("paramnames")," must be supplied"); - if (missing(obsnames)) stop(sQuote("obsnames")," must be supplied"); - if (missing(covarnames)) stop(sQuote("covarnames")," must be supplied"); + + if (missing(name)) + name <- paste0("pomp", + paste( + format( + as.hexmode(ceiling(runif(n=2,max=2^24))), + upper.case=TRUE + ), + collapse="" + ) + ) + + has.trans <- !(missing(parameter.transform)) + if (missing(globals)) globals <- "" - mpt <- missing(parameter.transform) - mpit <- missing(parameter.inv.transform) - if (xor(mpt,mpit)) - stop("if you supply one transformation function, you must supply its inverse") - has.trans <- !mpt - name <- cleanForC(name) statenames <- cleanForC(statenames) paramnames <- cleanForC(paramnames) @@ -190,12 +198,12 @@ for (v in seq_along(paramnames)) { cat(file=out,render(define$var,variable=paramnames[v],ptr='__p',ilist='__parindex',index=v-1)) } + for (v in seq_along(statenames)) { + cat(file=out,render(define$var,variable=statenames[v],ptr='__x',ilist='__stateindex',index=v-1)) + } for (v in seq_along(covarnames)) { cat(file=out,render(define$var,variable=covarnames[v],ptr='__covars',ilist='__covindex',index=v-1)) } - for (v in seq_along(statenames)) { - cat(file=out,render(define$var,variable=statenames[v],ptr='__x',ilist='__stateindex',index=v-1)) - } for (v in seq_along(obsnames)) { cat(file=out,render(define$var,variable=obsnames[v],ptr='__y',ilist='__obsindex',index=v-1)) } @@ -238,16 +246,24 @@ cat(file=out,callable.decl(skeleton)) cat(file=out,skeleton,footer$skeleton) + ## rprior function + if (missing(rprior)) rprior <- missing.fun("rprior") + cat(file=out,render(header$rprior,name=name),rprior,footer$rprior) + + ## dprior function + if (missing(dprior)) dprior <- missing.fun("dprior") + cat(file=out,render(header$dprior,name=name),dprior,footer$dprior) + ## undefine variables for (v in seq_along(paramnames)) { cat(file=out,render(undefine$var,variable=paramnames[v])) } + for (v in seq_along(statenames)) { + cat(file=out,render(undefine$var,variable=statenames[v])) + } for (v in seq_along(covarnames)) { cat(file=out,render(undefine$var,variable=covarnames[v])) } - for (v in seq_along(statenames)) { - cat(file=out,render(undefine$var,variable=statenames[v])) - } for (v in seq_along(obsnames)) { cat(file=out,render(undefine$var,variable=obsnames[v])) } @@ -274,7 +290,15 @@ cat("model codes written to",sQuote(modelfile), "\nlink to shared-object library",sQuote(solib),"\n") - invisible(NULL) + if (link) { + if (save) { + pompLink(name) + } else { + pompLink(file.path(tempdir(),name)) + } + } + + invisible(name) } cleanForC <- function (text) { Added: pkg/pomp/R/csnippet.R =================================================================== --- pkg/pomp/R/csnippet.R (rev 0) +++ pkg/pomp/R/csnippet.R 2014-04-21 01:01:42 UTC (rev 930) @@ -0,0 +1,18 @@ +## a class to hold snippets of C code + +setClass( + "Csnippet", + slots=c( + text="character" + ), + prototype=prototype( + text=character(0) + ) + ) + +Csnippet <- function (text) { + new( + "Csnippet", + text=as.character(text) + ) +} Modified: pkg/pomp/R/generics.R =================================================================== --- pkg/pomp/R/generics.R 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/R/generics.R 2014-04-21 01:01:42 UTC (rev 930) @@ -29,6 +29,10 @@ setGeneric("partrans",function(object,params,dir=c("forward","inverse"),...)standardGeneric("partrans")) setGeneric("logLik",function(object,...)standardGeneric("logLik")) +## internals +setGeneric("pomp.fun",function(f,...)standardGeneric("pomp.fun")) +setGeneric("plugin.handler",function(object,...)standardGeneric("plugin.handler")) + ## prediction mean setGeneric("pred.mean",function(object,...)standardGeneric("pred.mean")) ## prediction variance Modified: pkg/pomp/R/plugins.R =================================================================== --- pkg/pomp/R/plugins.R 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/R/plugins.R 2014-04-21 01:01:42 UTC (rev 930) @@ -1,172 +1,289 @@ +setClass( + "pompPlugin", + slots=c( + csnippet='logical', + slotname='character', + PACKAGE='character' + ), + prototype=prototype( + csnippet=FALSE, + slotname=character(0), + PACKAGE=character(0) + ) + ) + +setClass( + "onestepRprocessPlugin", + contains="pompPlugin", + slots=c( + step.fn="ANY" + ) + ) + +setClass( + "discreteRprocessPlugin", + contains="pompPlugin", + slots=c( + step.fn="ANY", + delta.t="numeric" + ) + ) + +setClass( + "eulerRprocessPlugin", + contains="pompPlugin", + slots=c( + step.fn="ANY", + delta.t="numeric" + ) + ) + +setClass( + "gillespieRprocessPlugin", + contains="pompPlugin", + slots=c( + rate.fn="ANY", + v="matrix", + d="matrix" + ) + ) + +setClass( + "onestepDprocessPlugin", + contains="pompPlugin", + slots=c( + dens.fn="ANY" + ) + ) + onestep.sim <- function (step.fun, PACKAGE) { - efun <- pomp.fun( - f=step.fun, - PACKAGE=PACKAGE, - proto=quote(step.fun(x,t,params,delta.t,...)) - ) - function (xstart, times, params, ..., - statenames = character(0), - paramnames = character(0), - covarnames = character(0), - zeronames = character(0), - tcovar, covar, - .getnativesymbolinfo = TRUE) { - .Call( - euler_model_simulator, - func=efun, - xstart=xstart, - times=times, - params=params, - dt=0, - method=1L, - statenames=statenames, - paramnames=paramnames, - covarnames=covarnames, - zeronames=zeronames, - tcovar=tcovar, - covar=covar, - args=pairlist(...), - gnsi=.getnativesymbolinfo - ) - } + if (missing(PACKAGE)) PACKAGE <- character(0) + new("onestepRprocessPlugin", + step.fn=step.fun, + slotname="step.fn", + PACKAGE=PACKAGE) } discrete.time.sim <- function (step.fun, delta.t = 1, PACKAGE) { - efun <- pomp.fun( - f=step.fun, - PACKAGE=PACKAGE, - proto=quote(step.fun(x,t,params,...)) - ) - function (xstart, times, params, ..., - statenames = character(0), - paramnames = character(0), - covarnames = character(0), - zeronames = character(0), - tcovar, covar, - .getnativesymbolinfo = TRUE) { - .Call( - euler_model_simulator, - func=efun, - xstart=xstart, - times=times, - params=params, - dt=delta.t, - method=2L, - statenames=statenames, - paramnames=paramnames, - covarnames=covarnames, - zeronames=zeronames, - tcovar=tcovar, - covar=covar, - args=pairlist(...), - gnsi=.getnativesymbolinfo - ) - } + if (missing(PACKAGE)) PACKAGE <- character(0) + new("discreteRprocessPlugin", + step.fn=step.fun,delta.t=delta.t, + slotname="step.fn", + csnippet=is(step.fun,"Csnippet"), + PACKAGE=PACKAGE) } euler.sim <- function (step.fun, delta.t, PACKAGE) { - efun <- pomp.fun( - f=step.fun, - PACKAGE=PACKAGE, - proto=quote(step.fun(x,t,params,delta.t,...)) - ) - function (xstart, times, params, ..., - statenames = character(0), - paramnames = character(0), - covarnames = character(0), - zeronames = character(0), - tcovar, covar, - .getnativesymbolinfo = TRUE) { - .Call( - euler_model_simulator, - func=efun, - xstart=xstart, - times=times, - params=params, - dt=delta.t, - method=0L, - statenames=statenames, - paramnames=paramnames, - covarnames=covarnames, - zeronames=zeronames, - tcovar=tcovar, - covar=covar, - args=pairlist(...), - gnsi=.getnativesymbolinfo - ) - } + if (missing(PACKAGE)) PACKAGE <- character(0) + new("eulerRprocessPlugin", + step.fn=step.fun,delta.t=delta.t, + slotname="step.fn", + csnippet=is(step.fun,"Csnippet"), + PACKAGE=PACKAGE) } +gillespie.sim <- function (rate.fun, v, d, PACKAGE) { + if (missing(PACKAGE)) PACKAGE <- character(0) + new("gillespieRprocessPlugin", + rate.fn=rate.fun,v=v,d=d, + slotname="rate.fn", + csnippet=is(rate.fun,"Csnippet"), + PACKAGE=PACKAGE) +} + onestep.dens <- function (dens.fun, PACKAGE) { - efun <- pomp.fun( - f=dens.fun, - PACKAGE=PACKAGE, - proto=quote(dens.fun(x1,x2,t1,t2,params,...)) - ) - function (x, times, params, ..., - statenames = character(0), - paramnames = character(0), - covarnames = character(0), - tcovar, covar, log = FALSE, - .getnativesymbolinfo = TRUE) { - .Call( - euler_model_density, - func=efun, - x=x, - times=times, - params=params, - statenames=statenames, - paramnames=paramnames, - covarnames=covarnames, - tcovar=tcovar, - covar=covar, - log=log, - args=pairlist(...), - gnsi=.getnativesymbolinfo - ) - } + if (missing(PACKAGE)) PACKAGE <- character(0) + new("onestepDprocessPlugin", + dens.fn=dens.fun, + slotname="dens.fn", + csnippet=is(dens.fun,"Csnippet"), + PACKAGE=PACKAGE) } -gillespie.sim <- function (rate.fun, v, d, PACKAGE) { - if (!(is.matrix(d)&&is.matrix(v))) { - stop(sQuote("v")," and ",sQuote("d")," must be matrices") - } - nvar <- nrow(v) - nevent <- ncol(v) - if ((nvar!=nrow(d))||(nevent!=ncol(d))) - stop(sQuote("v")," and ",sQuote("d")," must agree in dimension") +setMethod( + "plugin.handler", + signature=signature(object='function'), + definition=function (object, ...) { + object + } + ) - efun <- pomp.fun( - f=rate.fun, - PACKAGE=PACKAGE, - proto=quote(rate.fun(j,x,t,params,...)) - ) - function (xstart, times, params, - statenames = character(0), - paramnames = character(0), - covarnames = character(0), - zeronames = character(0), - tcovar, covar, - .getnativesymbolinfo = TRUE, - ...) { - .Call( - SSA_simulator, - func=efun, - mflag=0L, ## Gillespie's algorithm - xstart=xstart, - times=times, - params=params, - e=rep(0,nvar), - vmatrix=v, - dmatrix=d, - tcovar=tcovar, - covar=covar, - statenames=statenames, - paramnames=paramnames, - covarnames=covarnames, - zeronames=zeronames, - args=pairlist(...), - gnsi=.getnativesymbolinfo +setMethod( + "plugin.handler", + signature=signature(object='ANY'), + definition=function (object, ...) { + stop("plugin has an invalid form") + } ) - } -} + +setMethod( + "plugin.handler", + signature=signature(object='onestepRprocessPlugin'), + definition=function (object, ...) { + efun <- pomp.fun( + f=object at step.fn, + PACKAGE=object at PACKAGE, + proto=quote(step.fun(x,t,params,delta.t,...)), + slotname=object at slotname, + ... + ) + function (xstart, times, params, ..., + zeronames = character(0), + tcovar, covar, + .getnativesymbolinfo = TRUE) { + .Call( + euler_model_simulator, + func=efun, + xstart=xstart, + times=times, + params=params, + dt=0, + method=1L, + zeronames=zeronames, + tcovar=tcovar, + covar=covar, + args=pairlist(...), + gnsi=.getnativesymbolinfo + ) + } + } + ) + +setMethod( + "plugin.handler", + signature=signature(object='discreteRprocessPlugin'), + definition=function (object, ...) { + efun <- pomp.fun( + f=object at step.fn, + PACKAGE=object at PACKAGE, + proto=quote(step.fun(x,t,params,...)), + slotname=object at slotname, + ... + ) + function (xstart, times, params, ..., + zeronames = character(0), + tcovar, covar, + .getnativesymbolinfo = TRUE) { + .Call( + euler_model_simulator, + func=efun, + xstart=xstart, + times=times, + params=params, + dt=object at delta.t, + method=2L, + zeronames=zeronames, + tcovar=tcovar, + covar=covar, + args=pairlist(...), + gnsi=.getnativesymbolinfo + ) + } + } + ) + +setMethod( + "plugin.handler", + signature=signature(object='eulerRprocessPlugin'), + definition=function (object, ...) { + efun <- pomp.fun( + f=object at step.fn, + PACKAGE=object at PACKAGE, + proto=quote(step.fun(x,t,params,delta.t,...)), + slotname=object at slotname, + ... + ) + function (xstart, times, params, ..., + zeronames = character(0), + tcovar, covar, + .getnativesymbolinfo = TRUE) { + .Call( + euler_model_simulator, + func=efun, + xstart=xstart, + times=times, + params=params, + dt=object at delta.t, + method=0L, + zeronames=zeronames, + tcovar=tcovar, + covar=covar, + args=pairlist(...), + gnsi=.getnativesymbolinfo + ) + } + } + ) + +setMethod( + "plugin.handler", + signature=signature(object='gillespieRprocessPlugin'), + definition=function (object, ...) { + if (!(is.matrix(object at d)&&is.matrix(object at v))) { + stop(sQuote("v")," and ",sQuote("d")," must be matrices") + } + nvar <- nrow(object at v) + nevent <- ncol(object at v) + if ((nvar!=nrow(object at d))||(nevent!=ncol(object at d))) + stop(sQuote("v")," and ",sQuote("d")," must agree in dimension") + efun <- pomp.fun( + f=object at rate.fn, + PACKAGE=object at PACKAGE, + proto=quote(rate.fun(j,x,t,params,...)), + slotname=object at slotname, + ... + ) + function (xstart, times, params, + zeronames = character(0), + tcovar, covar, + .getnativesymbolinfo = TRUE, + ...) { + .Call( + SSA_simulator, + func=efun, + mflag=0L, ## Gillespie's algorithm + xstart=xstart, + times=times, + params=params, + e=rep(0,nvar), + vmatrix=object at v, + dmatrix=object at d, + tcovar=tcovar, + covar=covar, + zeronames=zeronames, + args=pairlist(...), + gnsi=.getnativesymbolinfo + ) + } + } + ) + +setMethod( + "plugin.handler", + signature=signature(object='onestepDprocessPlugin'), + definition=function (object, ...) { + efun <- pomp.fun( + f=object at dens.fn, + PACKAGE=object at PACKAGE, + proto=quote(dens.fun(x1,x2,t1,t2,params,...)), + slotname=object at slotname, + ... + ) + function (x, times, params, ..., + tcovar, covar, log = FALSE, + .getnativesymbolinfo = TRUE) { + .Call( + euler_model_density, + func=efun, + x=x, + times=times, + params=params, + tcovar=tcovar, + covar=covar, + log=log, + args=pairlist(...), + gnsi=.getnativesymbolinfo + ) + } + } + ) Modified: pkg/pomp/R/pomp-class.R =================================================================== --- pkg/pomp/R/pomp-class.R 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/R/pomp-class.R 2014-04-21 01:01:42 UTC (rev 930) @@ -6,9 +6,7 @@ if (length(ivpnames)<1) stop("default initializer error: no parameter names ending in ", sQuote(".0")," found: see ",sQuote("pomp")," documentation") - x <- params[ivpnames] - names(x) <- sub("\\.0$","",ivpnames) - x + setNames(params[ivpnames],sub("\\.0$","",ivpnames)) } ## define the pomp class @@ -32,15 +30,10 @@ params = 'numeric', covar = 'matrix', tcovar = 'numeric', - obsnames = 'character', - statenames = 'character', - paramnames = 'character', - covarnames = 'character', zeronames = 'character', has.trans = 'logical', par.trans = 'pomp.fun', par.untrans = 'pomp.fun', - PACKAGE = 'character', userdata = 'list' ), prototype=prototype( @@ -61,15 +54,10 @@ params=numeric(0), covar=array(data=numeric(0),dim=c(0,0)), tcovar=numeric(0), - obsnames=character(0), - statenames=character(0), - paramnames=character(0), - covarnames=character(0), zeronames=character(0), has.trans=FALSE, par.trans=pomp.fun(), par.untrans=pomp.fun(), - PACKAGE=character(0), userdata=list() ), validity=function (object) { @@ -78,8 +66,6 @@ retval <- append(retval,paste(sQuote("data"),"is a required argument")) if (length(object at times)<1) retval <- append(retval,paste(sQuote("times"),"is a required argument")) - if (length(object at t0)<1) - retval <- append(retval,paste(sQuote("t0"),"is a required argument")) if (!is.numeric(object at params) || (length(object at params)>0 && is.null(names(object at params)))) retval <- append(retval,paste(sQuote("params"),"must be a named numeric vector")) if (ncol(object at data)!=length(object at times)) @@ -89,7 +75,8 @@ if (length(object at t0)>1) retval <- append(retval,paste(sQuote("t0"),"must be a single number")) if (object at t0 > object at times[1]) - retval <- append(retval,paste("the zero-time",sQuote("t0"),"must occur no later than the first observation")) + retval <- append(retval,paste("the zero-time",sQuote("t0"), + "must occur no later than the first observation")) if (object at skelmap.delta.t <= 0) retval <- append(retval,paste(sQuote("skelmap.delta.t"),"must be positive")) if (!all(c('xstart','times','params','...')%in%names(formals(object at rprocess)))) @@ -124,15 +111,6 @@ "should match the number of rows of",sQuote("covar") ) ) - } else if (!all(object at covarnames%in%colnames(object at covar))) { - missing <- object at covarnames[!(object at covarnames%in%colnames(object at covar))] - retval <- append( - retval, - paste( - "covariate(s)",paste(missing,collapse=","), - "are not found among the columns of",sQuote("covar") - ) - ) } if (!is.numeric(object at tcovar)) retval <- append( Modified: pkg/pomp/R/pomp-fun.R =================================================================== --- pkg/pomp/R/pomp-fun.R 2014-04-18 15:41:12 UTC (rev 929) +++ pkg/pomp/R/pomp-fun.R 2014-04-21 01:01:42 UTC (rev 930) @@ -1,55 +1,118 @@ -## a class for functions that may be defined in R or using native routines +## a class for functions that may be defined in R, +## using pre-written native routines, or C snippets + setClass( 'pomp.fun', - representation( - R.fun = 'function', - native.fun = 'character', - PACKAGE = 'character', - mode = 'integer', - address = 'externalptr' - ), + slots=c( + R.fun = 'function', + native.fun = 'character', + PACKAGE = 'character', + mode = 'integer', + address = 'externalptr', + obsnames = 'character', + statenames = 'character', + paramnames = 'character', + covarnames = 'character' + ), prototype=prototype( - R.fun=function(...)stop("unreachable error: please report this bug!"), + R.fun=function (...) { + stop("unreachable error: please report this bug!") + }, native.fun=character(0), - PACKAGE="", - mode=-1L ## undefined + PACKAGE=character(0), + mode=-1L, ## undefined behavior + obsnames = character(0), + statenames = character(0), + paramnames = character(0), + covarnames = character(0) ) ) -## constructor -pomp.fun <- function (f = NULL, PACKAGE, proto = NULL) { - if (missing(PACKAGE)) PACKAGE <- "" - if (!is.null(proto)) { - if (!is.call(proto)) - stop(sQuote("proto")," must be an unevaluated call") - prototype <- as.character(proto) - fname <- prototype[1] - args <- prototype[-1] - if (is.function(f)&&(!all(args%in%names(formals(f))))) - stop(sQuote(fname)," must be a function of prototype ",deparse(proto),call.=FALSE) - } - if (is(f,"pomp.fun")) { - retval <- f - } else if (is.function(f)) { - retval <- new( - "pomp.fun", - R.fun=f, - mode=1L - ) - } else if (is.character(f)) { - retval <- new( - "pomp.fun", - native.fun=f, - PACKAGE=PACKAGE, - mode=2L - ) - } else { - retval <- new("pomp.fun") - } - retval -} +setMethod( + "pomp.fun", + signature=signature(f="missing"), + definition=function (f, ...) { + new("pomp.fun") + } + ) setMethod( + "pomp.fun", + signature=signature(f="NULL"), + definition=function (f, ...) { + new("pomp.fun") + } + ) + +setMethod( + "pomp.fun", [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 930 From noreply at r-forge.r-project.org Mon Apr 21 14:12:29 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 21 Apr 2014 14:12:29 +0200 (CEST) Subject: [Pomp-commits] r932 - in pkg/pomp: . inst/doc Message-ID: <20140421121229.4CC3D1812D4@r-forge.r-project.org> Author: kingaa Date: 2014-04-21 14:12:28 +0200 (Mon, 21 Apr 2014) New Revision: 932 Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/manual.pdf Log: Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-21 12:04:46 UTC (rev 931) +++ pkg/pomp/DESCRIPTION 2014-04-21 12:12:28 UTC (rev 932) @@ -21,7 +21,7 @@ Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve License: GPL(>= 2) LazyData: true -BuildVignettes: false +BuildVignettes: true MailingList: Subscribe to pomp-announce at r-forge.r-project.org for announcements by going to http://lists.r-forge.r-project.org/mailman/listinfo/pomp-announce. Collate: aaa.R authors.R generics.R version.R eulermultinom.R csnippet.R pomp-fun.R plugins.R Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Tue Apr 22 18:13:13 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 22 Apr 2014 18:13:13 +0200 (CEST) Subject: [Pomp-commits] r933 - pkg/pomp/inst Message-ID: <20140422161313.763EE1852C8@r-forge.r-project.org> Author: kingaa Date: 2014-04-22 18:13:13 +0200 (Tue, 22 Apr 2014) New Revision: 933 Modified: pkg/pomp/inst/TODO Log: - update TODO list Modified: pkg/pomp/inst/TODO =================================================================== --- pkg/pomp/inst/TODO 2014-04-21 12:12:28 UTC (rev 932) +++ pkg/pomp/inst/TODO 2014-04-22 16:13:13 UTC (rev 933) @@ -1,16 +1,16 @@ -* userdata access from C functions +TO-DO LIST -* pompBuilder function for automatic pomp construction +* update intro and advanced_topics documents to use Csnippets +* for plugins, remove intermediate R function call + +* write pompCBuilder support for 'onestep.dens' and 'gillespie.sim' plugins. + * effects of replacing 'sample.int' with systematic resampling inside 'bsmc' -* sorting vs no-sorting systematic resampling algorithm? - * parameter transformations: put 'transform' option into each estimation routine (spect.match) -* unit tests for above - * unit tests for 'sannbox' * Improve 'pmcmc' to take advantage of all particles. @@ -23,7 +23,7 @@ using R expressions rather than functions.... * Write 'plot' and 'print' methods for 'pfilterd.pomp' objects. - This would display effective sample size, conditional log likelihood, filter means, prediction variances, prediction means? + Would this display effective sample size, conditional log likelihood, filter means, prediction variances, prediction means? * Add plugin for adaptive tau leaping algorithm. From noreply at r-forge.r-project.org Wed Apr 23 21:33:19 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 23 Apr 2014 21:33:19 +0200 (CEST) Subject: [Pomp-commits] r934 - in www: content vignettes Message-ID: <20140423193319.8B031187532@r-forge.r-project.org> Author: kingaa Date: 2014-04-23 21:33:18 +0200 (Wed, 23 Apr 2014) New Revision: 934 Added: www/vignettes/gompertz-performance.rda Removed: www/vignettes/complex-sir-def.rda www/vignettes/sim-sim.rda www/vignettes/sir-pomp-def.rda Modified: www/content/NEWS.html www/vignettes/Makefile www/vignettes/advanced_topics_in_pomp.R www/vignettes/advanced_topics_in_pomp.Rnw www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/bsmc-ricker-flat-prior.rda www/vignettes/bsmc-ricker-normal-prior.rda www/vignettes/gompertz-multi-mif.rda www/vignettes/gompertz-pfilter-guess.rda www/vignettes/gompertz-trajmatch.rda www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/plugin-C-code.rda www/vignettes/plugin-R-code.rda www/vignettes/pomp.pdf www/vignettes/vectorized-C-code.rda www/vignettes/vectorized-R-code.rda Log: - update the vignettes to go with version 0.50-1 of 'pomp' Modified: www/content/NEWS.html =================================================================== --- www/content/NEWS.html 2014-04-22 16:13:13 UTC (rev 933) +++ www/content/NEWS.html 2014-04-23 19:33:18 UTC (rev 934) @@ -1,58 +1,75 @@ -R: News for Package 'pomp' +R: News for package 'pomp'
NEWSR Documentation
-

News for Package 'pomp'

+

News for package ‘pomp’

-

Changes in pomp version 0.49-1

+

Changes in pomp version 0.50-1

    -
  • A new method, 'probe.match.objfun', constructs objective functions suitable for use in optimizers. +

  • pomp can now take snippets of C code directly as definitions of the various basic functions. +This is accomplished through the use of a new "Csnippet" function. +See the ‘sir’ demo for a demonstration.

  • -
  • 'pomp' now depends on 'nloptr', which provides a suite of optimization algorithms. +

  • It is now possible to specify global variables and typedefs using the globals argument to pompBuilder and pomp. +See the ‘sir’ demo for a demonstration. +Thanks to Carl Pearson for the suggestion. +

    +
+ + + +

Changes in pomp version 0.49-1

+ + +
    +
  • A new method, probe.match.objfun, constructs objective functions suitable for use in optimizers. +

    +
  • +
  • pomp now depends on nloptr, which provides a suite of optimization algorithms. This package can now be used in various methods for optimization of an objective function.

  • -
  • New inline C functions 'to_log_barycentric' and 'from_log_barycentric' are provided in 'pomp.h' to facilitate log-barycentric transformations. +

  • New inline C functions to_log_barycentric and from_log_barycentric are provided in ‘pomp.h’ to facilitate log-barycentric transformations. These have proven very useful in dealing with parameters constrained to sum to one (e.g., initial conditions of compartmental models).

  • -
  • Bug fix in 'periodic.bspline.basis'. +

  • Bug fix in periodic.bspline.basis.

  • -
  • Package vignettes are no longer available via 'vignette()' but can be reached from the help index. +

  • Package vignettes are no longer available via vignette() but can be reached from the help index.

-

Changes in pomp version 0.48-3

+

Changes in pomp version 0.48-3

    -
  • Correct a bug in 'abc' to do with parameter transformation. +

  • Correct a bug in abc to do with parameter transformation.

-

Changes in pomp version 0.48-1

+

Changes in pomp version 0.48-1

    -
  • Create new 'dprior' and 'rprior' slots for 'pomp' objects. -These will be used by the Bayesian methods (currently 'abc', 'bsmc', and 'pmcmc'). -The 'hyperparams' argument to these methods has been removed; +

  • Create new dprior and rprior slots for pomp objects. +These will be used by the Bayesian methods (currently abc, bsmc, and pmcmc). +The hyperparams argument to these methods has been removed; hyperparameters are now treated just as any others.

  • -
  • 'bsmc' can now be called so that the particles are drawn from the prior distribution (as set by the 'rpior' slot). +

  • bsmc can now be called so that the particles are drawn from the prior distribution (as set by the rprior slot).

  • Some of the longer tests will only be run if an environment variable is set. @@ -61,91 +78,91 @@ -

    Changes in pomp version 0.47-4

    +

    Changes in pomp version 0.47-4

      -
    • Revisit 'dacca' bug. Set negative compartments to zero along with compartments immediately downstream. +

    • Revisit dacca bug. Set negative compartments to zero along with compartments immediately downstream.

    -

    Changes in pomp version 0.47-3

    +

    Changes in pomp version 0.47-3

      -
    • Fix bug that arises only very occasionally in the 'dacca' cholera example. +

    • Fix bug that arises only very occasionally in the dacca cholera example.

    • -
    • Modify 'dacca' model so that rare positivity violations are punished in a different way. +

    • Modify dacca model so that rare positivity violations are punished in a different way. This modifies the formal model slightly.

    -

    Changes in pomp version 0.47-2

    +

    Changes in pomp version 0.47-2

      -
    • By default, 'pompBuilder' now creates all files in the temporary directory. +

    • By default, pompBuilder now creates all files in the temporary directory.

    -

    Changes in pomp version 0.47-1

    +

    Changes in pomp version 0.47-1

      -
    • 'abc' implements Approximate Bayesian Computation for pomp models. +

    • abc implements Approximate Bayesian Computation for pomp models.

    -

    Changes in pomp version 0.46-1

    +

    Changes in pomp version 0.46-1

      -
    • 'pompExample' now has an optional argument, 'envir', determining which environment the pomp object will be loaded into. +

    • pompExample now has an optional argument, envir, determining which environment the pomp object will be loaded into.

    • -
    • 'logmeanexp' now has an optional argument, 'se', allowing for computation of an approximate standard error. +

    • logmeanexp now has an optional argument, se, allowing for computation of an approximate standard error.

    -

    Changes in pomp version 0.45-8

    +

    Changes in pomp version 0.45-8

      -
    • bug fix in 'gompertz' example. +

    • bug fix in gompertz example.

    -

    Changes in pomp version 0.45-7

    +

    Changes in pomp version 0.45-7

      -
    • bug fix in 'pmcmc': Metropolis-Hastings ratio was incorrect except for flat priors! +

    • bug fix in pmcmc: Metropolis-Hastings ratio was incorrect except for flat priors!

    -

    Changes in pomp version 0.45-6

    +

    Changes in pomp version 0.45-6

      -
    • a fix so that 'pompBuilder' will find 'pomp.h' header file on Windows machines. Thanks to Dave Hayman for finding the problem. +

    • a fix so that pompBuilder will find ‘pomp.h’ header file on Windows machines. Thanks to Dave Hayman for finding the problem.

    • -
    • new 'logmeanexp' function. +

    • new logmeanexp function.

    • some reorganization of the source package structure. @@ -154,74 +171,74 @@ -

      Changes in pomp version 0.45-4

      +

      Changes in pomp version 0.45-4

        -
      • changes in the way 'reulermultinom', 'deulermultinom', 'dot_product' are exported to other packages. Rather than just being exported as linkables, these are now also defined as static inline functions in the 'pomp.h' header. +

      • changes in the way reulermultinom, deulermultinom, dot_product are exported to other packages. Rather than just being exported as linkables, these are now also defined as static inline functions in the ‘pomp.h’ header.

      -

      Changes in pomp version 0.45-3

      +

      Changes in pomp version 0.45-3

        -
      • fix bug with 'continue' and method 'mif2' +

      • Fix bug with continue and method "mif2".

      -

      Changes in pomp version 0.45-2

      +

      Changes in pomp version 0.45-2

        -
      • new method to coerce 'pfilterd.pomp' objects to data-frames. +

      • new method to coerce pfilterd.pomp objects to data-frames.

      -

      Changes in pomp version 0.45-1

      +

      Changes in pomp version 0.45-1

        -
      • 'profileDesign' can now handle variables of mixed type. +

      • profileDesign can now handle variables of mixed type.

      -

      Changes in pomp version 0.44-1

      +

      Changes in pomp version 0.44-1

        -
      • New 'mif2' option for 'mif'. +

      • New "mif2" option for mif.

      • -
      • The default behavior for 'mif' and 'pfilter' with respect to filtering failures has been changed. -Before, the default behavior has been to stop with an error on the first filtering failure ('max.fail=0'). -Now, the default is 'max.fail=Inf', i.e., an error is never triggered. +

      • The default behavior for mif and pfilter with respect to filtering failures has been changed. +Before, the default behavior has been to stop with an error on the first filtering failure (max.fail=0). +Now, the default is max.fail=Inf, i.e., an error is never triggered.

      • The implementation of MIF cooling schedules has been changed to make it more general. -The cooling schedule is now specified by a 'type' and a 'fraction'. -Currently, supported 'cooling.type's include 'geometric' (the old behavior) and 'hyperbolic', i.e., a 1/(1+n) schedule. -The 'cooling.fraction' argument specifies the cooling at 50 iterations. -That is, if s is the intensity of the random-walk perturbation to parameters at the first iteration ('rw.sd'), then the intensity at iteration 50 is s*cooling.fraction. +The cooling schedule is now specified by a type and a fraction. +Currently, supported cooling.types include geometric (the old behavior) and hyperbolic, i.e., a 1/(1+n) schedule. +The cooling.fraction argument specifies the cooling at 50 iterations. +That is, if s is the intensity of the random-walk perturbation to parameters at the first iteration (rw.sd), then the intensity at iteration 50 is s*cooling.fraction.

      • -
      • Remove all data()-loadable pomp objects. -To load the prebuilt example pomp objects from previous versions, use the new 'pompExample' function. -E.g., instead of 'data(euler.sir)', do 'pompExample("euler.sir")'. +

      • Remove all data()-loadable pomp objects. +To load the prebuilt example pomp objects from previous versions, use the new pompExample function. +E.g., instead of data(euler.sir), do pompExample("euler.sir").

      -

      Changes in pomp version 0.43-4

      +

      Changes in pomp version 0.43-4

        @@ -231,69 +248,69 @@ -

        Changes in pomp version 0.43-3

        +

        Changes in pomp version 0.43-3

          -
        • Fix bug in 'pompBuilder' on mac. +

        • Fix bug in pompBuilder on mac.

        • -
        • Fix bug in 'dmeasure' when log=TRUE. Bug located by R. Reiner. +

        • Fix bug in dmeasure when log=TRUE. Bug located by R. Reiner.

        • -
        • Add 'eff.sample.size' and 'cond.logLik' methods for 'pfilterd.pomp' objects. +

        • Add eff.sample.size and cond.logLik methods for pfilterd.pomp objects.

        -

        Changes in pomp version 0.43-1

        +

        Changes in pomp version 0.43-1

          -
        • Modify 'traj.match.objfun' to allow arbitrary parameters to be passed to the ODE integrator. +

        • Modify traj.match.objfun to allow arbitrary parameters to be passed to the ODE integrator.

        • -
        • Add 'params' argument to 'pomp' so that parameters can be specified at the time the pomp object is created. +

        • Add params argument to pomp so that parameters can be specified at the time the pomp object is created.

        -

        Changes in pomp version 0.42-6

        +

        Changes in pomp version 0.42-6

          -
        • Improve error checking in 'pomp'. +

        • Improve error checking in pomp.

        • -
        • Add support for covariates to 'pompBuilder'. +

        • Add support for covariates to pompBuilder.

        • Add native parameter transformation routines to the demos.

        • -
        • Change the warning behavior in 'lookup_table' so that warnings are not generated unless true extrapolation is performed (i.e., eliminate the warnings at the boundary). +

        • Change the warning behavior in lookup_table so that warnings are not generated unless true extrapolation is performed (i.e., eliminate the warnings at the boundary).

        • -
        • Some small modifications to the 'pomp.h' header file. +

        • Some small modifications to the ‘pomp.h’ header file.

        -

        Changes in pomp version 0.42-4

        +

        Changes in pomp version 0.42-4

          -
        • When 'trajectory' calls 'ode', there is a need to preserve information across calls to the vectorfield-evaluating function. +

        • When trajectory calls ode, there is a need to preserve information across calls to the vectorfield-evaluating function. The code has been modified to do this in a cleaner way.

        -

        Changes in pomp version 0.42-2

        +

        Changes in pomp version 0.42-2

          @@ -304,92 +321,92 @@ -

          Changes in pomp version 0.42-1

          +

          Changes in pomp version 0.42-1

            -
          • An EXPERIMENTAL facility for constructing pomp objects out of native C routines is now included (pompBuilder). +

          • An EXPERIMENTAL facility for constructing pomp objects out of native C routines is now included (pompBuilder). This facility is being actively developed and future changes may not be backward compatible.

          • -
          • A new facility allowing access to the 'userdata' slot of a pomp object from compiled 'rprocess', 'rmeasure', 'dprocess', 'dmeasure', 'skeleton', and 'partrans' codes is now available. -Calls to the new C routines 'get_pomp_userdata', 'get_pomp_userdata_int', and 'get_pomp_userdata_double' allow retrieval of these elements. +

          • A new facility allowing access to the userdata slot of a pomp object from compiled rprocess, rmeasure, dprocess, dmeasure, skeleton, and partrans codes is now available. +Calls to the new C routines get_pomp_userdata, get_pomp_userdata_int, and get_pomp_userdata_double allow retrieval of these elements.

          • -
          • Some of the data()-loadable examples have been reworked to make use of the above facility. +

          • Some of the data()-loadable examples have been reworked to make use of the above facility. The parameterization of these examples has changed. -These changes are not backward compatible: codes that depend on the data()-loadable examples may be broken. +These changes are not backward compatible: codes that depend on the data()-loadable examples may be broken.

          -

          Changes in pomp version 0.41-8

          +

          Changes in pomp version 0.41-8

            -
          • A demonstration of 'pompBuilder' has been put into the 'advanced topics' vignette. +

          • A demonstration of pompBuilder has been put into the “advanced topics” vignette.

          -

          Changes in pomp version 0.41-7

          +

          Changes in pomp version 0.41-7

            -
          • A bug in the 'blowflies' example has been fixed. +

          • A bug in the blowflies example has been fixed. Thanks to Greg Minshall for discovering it.

          -

          Changes in pomp version 0.41-6

          +

          Changes in pomp version 0.41-6

            -
          • The 'gompertz' example parameter transformations have been changed. +

          • The gompertz example parameter transformations have been changed. No longer are the names of the parameter vector changed in the transformation. This change is not backward-compatible, but only codes using this example are affected.

          • -
          • The 'euler.sir' and 'gillespie.sir' examples have been changed. -The transmission rate beta(t) is now the arithmetic sum of the seasonality basis functions. +

          • The euler.sir and gillespie.sir examples have been changed. +The transmission rate β(t) is now the arithmetic sum of the seasonality basis functions. Before, it was the geometric sum. -R0 is now given by the arithmetic average of the beta parameters divided by (gamma+mu). +R_0 is now given by the arithmetic average of the β parameters divided by γ+μ. This change is not backward-compatible, but only codes using these examples are affected.

          -

          Changes in pomp version 0.41-5

          +

          Changes in pomp version 0.41-5

            -
          • An experimental facility for constructing pomp objects with native C routines is now included. +

          • An experimental facility for constructing pomp objects with native C routines is now included.

          -

          Changes in pomp version 0.41-4

          +

          Changes in pomp version 0.41-4

            -
          • The 'blowflies', 'euler.sir', 'gillespie.sir', 'bbs', and 'ricker' data()-loadable examples have been changed to make the parameterization simpler and more natural. +

          • The blowflies, euler.sir, gillespie.sir, bbs, and ricker data()-loadable examples have been changed to make the parameterization simpler and more natural. This change is not backward-compatible, but only codes using this example are affected.

          -

          Changes in pomp version 0.41-3

          +

          Changes in pomp version 0.41-3

            -
          • In 'trajectory', all vectorfield and map evaluation is now done in C for speed. +

          • In trajectory, all vectorfield and map evaluation is now done in C for speed. For continuous-time dynamical systems, this gives an approximately 4-fold speedup.

          • @@ -399,163 +416,163 @@ -

            Changes in pomp version 0.41-2

            +

            Changes in pomp version 0.41-2

              -
            • A segfault bug in 'bbs' example has been fixed. +

            • A segfault bug in bbs example has been fixed.

            • -
            • The posterior medians (not means) are now stored in the 'params' slot of the 'bsmcd.pomp' object. +

            • The posterior medians (not means) are now stored in the params slot of the bsmcd.pomp object.

            -

            Changes in pomp version 0.41-1

            +

            Changes in pomp version 0.41-1

              -
            • New arguments in 'mif', 'nlf', 'bsmc', 'pmcmc', 'probe-match', and 'traj-match' allow the estimation to be done on a transformed parameter space. -When 'transform=TRUE' in these commands ('transform.params=TRUE' for 'nlf'), estimation is performed on the transformed parameter space. -This is described and demonstrated in the 'intro_to_pomp' vignette. +

            • New arguments in mif, nlf, bsmc, pmcmc, probe-match, and traj-match allow the estimation to be done on a transformed parameter space. +When transform=TRUE in these commands (transform.params=TRUE for nlf), estimation is performed on the transformed parameter space. +This is described and demonstrated in the “intro_to_pomp” vignette.

            • -
            • The data()-loadable examples have been re-implemented to make use of the above-mentioned facility. -Note that this new functionality makes it unnecessary to "un-transform" model parameters within the user-specified 'rprocess', 'dprocess', 'rmeasure', 'dmeasure', 'skeleton', and 'initializer' codes. -This change is not backward-compatible, but only codes using these data()-loadable example are affected. +

            • The data()-loadable examples have been re-implemented to make use of the above-mentioned facility. +Note that this new functionality makes it unnecessary to "un-transform" model parameters within the user-specified rprocess, dprocess, rmeasure, dmeasure, skeleton, and initializer codes. +This change is not backward-compatible, but only codes using these data()-loadable example are affected.

            • -
            • The Bayesian sequential Monte Carlo command 'bsmc' now returns not a list but an object of class 'bsmcd.pomp'. -An experimental 'plot' method for objects of this class now exists. -Also, the parameter posterior means are now stored in the 'params' slot of the 'bsmcd.pomp' object: -access them with the 'coef' command as usual. +

            • The Bayesian sequential Monte Carlo command bsmc now returns not a list but an object of class bsmcd.pomp. +An experimental plot method for objects of this class now exists. +Also, the parameter posterior means are now stored in the params slot of the bsmcd.pomp object: +access them with the coef command as usual.

            • A new example, using data from an influenza outbreak in a British boarding school and an SIR model, has been included. -Do 'data(bbs)' to load it. +Do data(bbs) to load it.

            -

            Changes in pomp version 0.40-9

            +

            Changes in pomp version 0.40-9

              -
            • Setting the new argument 'as.data.frame' to 'TRUE' in 'simulate' and 'trajectory' causes the results to be returned as a data-frame. +

            • Setting the new argument as.data.frame to TRUE in simulate and trajectory causes the results to be returned as a data-frame.

            -

            Changes in pomp version 0.40-8

            +

            Changes in pomp version 0.40-8

              -
            • A new method 'partrans' allows transformation of vectors or matrices of parameters. +

            • A new method partrans allows transformation of vectors or matrices of parameters. The parameter transformations have been pushed into C for speed. It is possible to specify native parameter transformation routines in addition to C functions, but this last facility has not yet been extensively tested. -A new slot 'has.trans' has been introduced into the 'pomp' class, and the types of slots 'par.trans' and 'par.untrans' have changed. +A new slot has.trans has been introduced into the pomp class, and the types of slots par.trans and par.untrans have changed.

            -

            Changes in pomp version 0.40-7

            +

            Changes in pomp version 0.40-7

              -
            • 'parmat' now gracefully handles the case when 'params' is already a matrix. +

            • parmat now gracefully handles the case when params is already a matrix.

            • -
            • Error in the documentation of 'pfilter' repaired. +

            • Error in the documentation of pfilter repaired. Thanks to Alex Smith for pointing this out.

            • -
            • Improvements in the documentation of the Nicholson blowflies data 'data(blowflies)'. +

            • Improvements in the documentation of the Nicholson blowflies data data(blowflies).

            -

            Changes in pomp version 0.40-6

            +

            Changes in pomp version 0.40-6

              -
            • When a pomp object is updated using 'pomp', the 'params' slot will now be copied over (appropriately transformed). +

            • When a pomp object is updated using pomp, the params slot will now be copied over (appropriately transformed). Before, it was simply dropped.

            • -
            • The 'gillespie.sir' example has been changed to make the reporting rate equal to 'rho'. +

            • The gillespie.sir example has been changed to make the reporting rate equal to rho. Before, it was fixed at 10%.

            • -
            • A new error-trap has been put into 'probe' and 'probe.match' for the case nsim < nprobes. +

            • A new error-trap has been put into probe and probe.match for the case nsim < nprobes. Thanks to Dani Jonas for finding this error.

            -

            Changes in pomp version 0.40-5

            +

            Changes in pomp version 0.40-5

            • More informative error messages when dimension of state space or data space disagree internally.

            • -
            • The 'weighted' argument to 'mif' and 'continue' is now deprecated in favor of a new argument 'method'. -The old 'weighted=T' corresponds to 'method="mif"' while the old 'weighted=F' corresponds to 'method="unweighted"'. +

            • The weighted argument to mif and continue is now deprecated in favor of a new argument method. +The old weighted=TRUE corresponds to method="mif" while the old weighted=FALSE corresponds to method="unweighted".

            -

            Changes in pomp version 0.40-4

            +

            Changes in pomp version 0.40-4

              -
            • New functions 'traj.match.objfun' and 'probe.match.objfun' have been added. -These functions construct functions of one argument suitable for use as objective functions in 'optim'-like optimizers (iincluding 'subplex' and 'sannbox'). +

            • New functions traj.match.objfun and probe.match.objfun have been added. +These functions construct functions of one argument suitable for use as objective functions in optim-like optimizers (iincluding subplex and sannbox). Minimizing these functions solves the trajectory-matching problem and probe-matching problem, respectively. -This allows the user much greater flexibility in choice of optimization algorithm than is afforded by 'traj.match' and 'probe.match'. +This allows the user much greater flexibility in choice of optimization algorithm than is afforded by traj.match and probe.match.

            • -
            • The 'sannbox' optimizer, which performs simulated annealing with box constraints, is now exported and available for general use. +

            • The sannbox optimizer, which performs simulated annealing with box constraints, is now exported and available for general use.

            -

            Changes in pomp version 0.40-3

            +

            Changes in pomp version 0.40-3

              -
            • The 'bsmc' method has been improved, due to the contributions of Pierre Jacob. -Specifically, 'bsmc' no longer reports a log-likelihood (which it never actually computed anyway) but a log-evidence. +

            • The bsmc method has been improved, due to the contributions of Pierre Jacob. +Specifically, bsmc no longer reports a log-likelihood (which it never actually computed anyway) but a log-evidence. The latter computation was supplied by Pierre Jacob.

            • -
            • A new helper function, 'exp2geom_rate_correction' has been added to the 'pomp.h' file. -This function computes the rate r such that if N ~ geometric(prob=1-exp(-r*dt)) and T ~ exponential(rate=R), then E[N*dt] = E[T]. +

            • A new helper function, exp2geom_rate_correction has been added to the ‘pomp.h’ file. +This function computes the rate r such that if N \sim geometric(prob=1-\exp(-r dt)) and T \sim exponential(rate=R), then E[N dt] = E[T]. This is useful in approximating a continuous-time death process by a discrete time (Euler) process. -In particular, in such a case, T is the waiting time to death in the former and N*dt is the waiting time to death in the latter. -An Euler binomial or multinomial process with rate r=exp2geom_rate_correction(R,dt) will have the same mean waiting time as the exponential process with rate R. +In particular, in such a case, T is the waiting time to death in the former and N*dt is the waiting time to death in the latter. +An Euler binomial or multinomial process with rate r=exp2geom_rate_correction(R,dt) will have the same mean waiting time as the exponential process with rate R. Thanks to Sebastien Ballesteros for suggesting this.

            • -
            • A new helper function, 'rgammawn' has been added, with both R and C interfaces. +

            • A new helper function, rgammawn has been added, with both R and C interfaces. This function draws an increment of a Gamma white-noise process with a given intensity. -Specifically, dw=rgammwn(sigma,dt) is Gamma distributed with mean dt and variance sigma^2*dt. -In this case, mu*dw/dt is suitable for use as a random rate in an Euler-multinomial process. +Specifically, dw=rgammwn(sigma,dt) is Gamma distributed with mean dt and variance sigma^2*dt. +In this case, mu*dw/dt is suitable for use as a random rate in an Euler-multinomial process. Thanks to Sebastien Ballesteros for suggesting this.

            -

            Changes in pomp version 0.40-2

            +

            Changes in pomp version 0.40-2

              @@ -566,111 +583,111 @@ -

              Changes in pomp version 0.40-1

              +

              Changes in pomp version 0.40-1

              • It is now possible for discrete-time determistic skeletons to have a general step-size. Before, the stepsize was always forced to be 1. -The new argument 'skelmap.delta.t' in 'pomp' (default value 1) sets this step-size. -NB: in implementing this feature, a new slot has been added to the basic 'pomp' class. -'pomp' objects created with versions <0.40-1 will not therefore work with this version and must be re-created. +The new argument skelmap.delta.t in pomp (default value 1) sets this step-size. +NB: in implementing this feature, a new slot has been added to the basic pomp class. +pomp objects created with versions <0.40-1 will not therefore work with this version and must be re-created.

              • -
              • The deterministic skeleton trajectory functions now look for variables named in 'zeronames' and treat these variables as accumulators. -This brings the behavior of the deterministic skeleton functions into line with 'rprocess'. -A new section of the "advanced topics" vignette discusses accumulator variables and 'zeronames'. +

              • The deterministic skeleton trajectory functions now look for variables named in zeronames and treat these variables as accumulators. +This brings the behavior of the deterministic skeleton functions into line with rprocess. +A new section of the “advanced topics” vignette discusses accumulator variables and zeronames.

              • Include the user manual PDF among the vignettes.

              • -
              • The new function 'parmat' creates a suitable matrix of parameters in one line. +

              • The new function parmat creates a suitable matrix of parameters in one line.

              -

              Changes in pomp version 0.39-5

              [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 934 From noreply at r-forge.r-project.org Wed Apr 23 21:44:39 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 23 Apr 2014 21:44:39 +0200 (CEST) Subject: [Pomp-commits] r935 - www/vignettes Message-ID: <20140423194439.A798B18713B@r-forge.r-project.org> Author: kingaa Date: 2014-04-23 21:44:39 +0200 (Wed, 23 Apr 2014) New Revision: 935 Modified: www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.pdf Log: - minor fix Modified: www/vignettes/intro_to_pomp.R =================================================================== --- www/vignettes/intro_to_pomp.R 2014-04-23 19:33:18 UTC (rev 934) +++ www/vignettes/intro_to_pomp.R 2014-04-23 19:44:39 UTC (rev 935) @@ -66,8 +66,7 @@ ## time=1:100, ## Y=NA ## ), -## times=1, -## ## times="time", +## times="time", ## rprocess=discrete.time.sim( ## step.fun=gompertz.proc.sim, ## delta.t=1 @@ -235,7 +234,6 @@ ## ----kalman-likelihood-correction,echo=F--------------------------------- -#loglik.kalman <- kf$loglik-sum(log(obs(gompertz))) loglik.kalman <- kf$loglik Modified: www/vignettes/intro_to_pomp.Rnw =================================================================== --- www/vignettes/intro_to_pomp.Rnw 2014-04-23 19:33:18 UTC (rev 934) +++ www/vignettes/intro_to_pomp.Rnw 2014-04-23 19:44:39 UTC (rev 935) @@ -277,8 +277,7 @@ time=1:100, Y=NA ), - times=1, -## times="time", + times="time", rprocess=discrete.time.sim( step.fun=gompertz.proc.sim, delta.t=1 @@ -483,7 +482,6 @@ @ <>= -#loglik.kalman <- kf$loglik-sum(log(obs(gompertz))) loglik.kalman <- kf$loglik @ Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Wed Apr 23 21:56:17 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 23 Apr 2014 21:56:17 +0200 (CEST) Subject: [Pomp-commits] r936 - in pkg/pomp: . inst/doc tests Message-ID: <20140423195617.E40761873C7@r-forge.r-project.org> Author: kingaa Date: 2014-04-23 21:56:17 +0200 (Wed, 23 Apr 2014) New Revision: 936 Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/advanced_topics_in_pomp.pdf pkg/pomp/inst/doc/intro_to_pomp.pdf pkg/pomp/inst/doc/manual.pdf pkg/pomp/tests/ou2-nlf.R pkg/pomp/tests/ou2-nlf.Rout.save Log: - update vignettes - try to fix strange ou2-nlf test results Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-23 19:44:39 UTC (rev 935) +++ pkg/pomp/DESCRIPTION 2014-04-23 19:56:17 UTC (rev 936) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-1 -Date: 2014-04-20 +Version: 0.50-2 +Date: 2014-04-23 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")), @@ -19,9 +19,11 @@ URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve +Suggests: knitr License: GPL(>= 2) LazyData: true BuildVignettes: true +VignetteBuilder: knitr MailingList: Subscribe to pomp-announce at r-forge.r-project.org for announcements by going to http://lists.r-forge.r-project.org/mailman/listinfo/pomp-announce. Collate: aaa.R authors.R generics.R version.R eulermultinom.R csnippet.R pomp-fun.R plugins.R Modified: pkg/pomp/inst/doc/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/inst/doc/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/tests/ou2-nlf.R =================================================================== --- pkg/pomp/tests/ou2-nlf.R 2014-04-23 19:44:39 UTC (rev 935) +++ pkg/pomp/tests/ou2-nlf.R 2014-04-23 19:56:17 UTC (rev 936) @@ -15,6 +15,7 @@ nconverge=100, nasymp=2000, trace=1, + method="Nelder-Mead", verbose=TRUE, eval.only=TRUE, seed=426094906L, @@ -30,9 +31,9 @@ lags=c(4,6), nconverge=100, nasymp=2000, - method="Nelder-Mead", maxit=500, trace=1, + method="Nelder-Mead", verbose=TRUE, seed=426094906L, lql.frac = 0.025 @@ -45,9 +46,9 @@ lags=c(4,6), nconverge=100, nasymp=2000, - method="Nelder-Mead", maxit=500, trace=1, + method="Nelder-Mead", verbose=TRUE, eval.only=TRUE, seed=426094906L, @@ -62,9 +63,9 @@ lags=c(4,6), nconverge=100, nasymp=2000, - method="Nelder-Mead", maxit=500, trace=1, + method="Nelder-Mead", verbose=TRUE, seed=426094906L, lql.frac = 0.025 Modified: pkg/pomp/tests/ou2-nlf.Rout.save =================================================================== --- pkg/pomp/tests/ou2-nlf.Rout.save 2014-04-23 19:44:39 UTC (rev 935) +++ pkg/pomp/tests/ou2-nlf.Rout.save 2014-04-23 19:56:17 UTC (rev 936) @@ -38,6 +38,7 @@ + nconverge=100, + nasymp=2000, + trace=1, ++ method="Nelder-Mead", + verbose=TRUE, + eval.only=TRUE, + seed=426094906L, @@ -54,9 +55,9 @@ + lags=c(4,6), + nconverge=100, + nasymp=2000, -+ method="Nelder-Mead", + maxit=500, + trace=1, ++ method="Nelder-Mead", + verbose=TRUE, + seed=426094906L, + lql.frac = 0.025 @@ -125,9 +126,9 @@ + lags=c(4,6), + nconverge=100, + nasymp=2000, -+ method="Nelder-Mead", + maxit=500, + trace=1, ++ method="Nelder-Mead", + verbose=TRUE, + eval.only=TRUE, + seed=426094906L, @@ -142,9 +143,9 @@ + lags=c(4,6), + nconverge=100, + nasymp=2000, -+ method="Nelder-Mead", + maxit=500, + trace=1, ++ method="Nelder-Mead", + verbose=TRUE, + seed=426094906L, + lql.frac = 0.025 @@ -235,4 +236,4 @@ > > proc.time() user system elapsed - 6.836 0.060 6.942 + 8.723 0.075 8.798 From noreply at r-forge.r-project.org Thu Apr 24 00:24:36 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Apr 2014 00:24:36 +0200 (CEST) Subject: [Pomp-commits] r937 - www/vignettes Message-ID: <20140423222437.23AF6186D8F@r-forge.r-project.org> Author: kingaa Date: 2014-04-24 00:24:34 +0200 (Thu, 24 Apr 2014) New Revision: 937 Modified: www/vignettes/advanced_topics_in_pomp.R www/vignettes/advanced_topics_in_pomp.Rnw www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/pomp.pdf Log: - small fix Modified: www/vignettes/advanced_topics_in_pomp.R =================================================================== --- www/vignettes/advanced_topics_in_pomp.R 2014-04-23 19:56:17 UTC (rev 936) +++ www/vignettes/advanced_topics_in_pomp.R 2014-04-23 22:24:34 UTC (rev 937) @@ -256,27 +256,8 @@ } -## ----sir-sim,eval=F------------------------------------------------------ -## -## coef(sir) <- c( -## gamma=26,mu=0.02,iota=0.01, -## beta1=400,beta2=480,beta3=320, -## beta.sd=0.001, -## popsize=2.1e6, -## rho=0.6,theta=10, -## S.0=26/400,I.0=0.001,R.0=1 -## ) -## -## sir <- simulate(sir,seed=3493885L) -## traj <- trajectory(sir,hmax=1/52) -## +## ----sir-sim,eval=T------------------------------------------------------ -## ----sir-sim-eval,echo=F,eval=T------------------------------------------ -binary.file <- "sim-sim.rda" -if (file.exists(binary.file)) { - load(binary.file) -} else { - coef(sir) <- c( gamma=26,mu=0.02,iota=0.01, beta1=400,beta2=480,beta3=320, @@ -289,8 +270,6 @@ sir <- simulate(sir,seed=3493885L) traj <- trajectory(sir,hmax=1/52) - save(sir,traj,file=binary.file,compress='xz') -} ## ----sir-plot,fig=T,echo=F----------------------------------------------- Modified: www/vignettes/advanced_topics_in_pomp.Rnw =================================================================== --- www/vignettes/advanced_topics_in_pomp.Rnw 2014-04-23 19:56:17 UTC (rev 936) +++ www/vignettes/advanced_topics_in_pomp.Rnw 2014-04-23 22:24:34 UTC (rev 937) @@ -329,7 +329,7 @@ @ Let's specify some parameters, simulate, and compute a deterministic trajectory: -<>= +<>= coef(sir) <- c( gamma=26,mu=0.02,iota=0.01, @@ -343,14 +343,6 @@ sir <- simulate(sir,seed=3493885L) traj <- trajectory(sir,hmax=1/52) -<>= -binary.file <- "sim-sim.rda" -if (file.exists(binary.file)) { - load(binary.file) -} else { -<> - save(sir,traj,file=binary.file,compress='xz') -} @ \begin{figure} Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Thu Apr 24 17:08:55 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Apr 2014 17:08:55 +0200 (CEST) Subject: [Pomp-commits] r938 - www/vignettes Message-ID: <20140424150855.D45F0187666@r-forge.r-project.org> Author: kingaa Date: 2014-04-24 17:08:55 +0200 (Thu, 24 Apr 2014) New Revision: 938 Modified: www/vignettes/advanced_topics_in_pomp.Rnw www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/gompertz-performance.rda www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.pdf Log: - fix some small errors Modified: www/vignettes/advanced_topics_in_pomp.Rnw =================================================================== --- www/vignettes/advanced_topics_in_pomp.Rnw 2014-04-23 22:24:34 UTC (rev 937) +++ www/vignettes/advanced_topics_in_pomp.Rnw 2014-04-24 15:08:55 UTC (rev 938) @@ -1,8 +1,9 @@ -\documentclass[10pt,reqno,final]{amsart} +\documentclass[10pt,reqno,final,pdftex]{amsart} %\VignetteIndexEntry{Advanced topics in pomp} %\VignetteEngine{knitr::knitr} \usepackage{times} \usepackage[utf8]{inputenc} +\usepackage{graphicx} \usepackage[round]{natbib} \usepackage{paralist} \usepackage{float} Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/gompertz-performance.rda =================================================================== (Binary files differ) Modified: www/vignettes/intro_to_pomp.R =================================================================== --- www/vignettes/intro_to_pomp.R 2014-04-23 22:24:34 UTC (rev 937) +++ www/vignettes/intro_to_pomp.R 2014-04-24 15:08:55 UTC (rev 938) @@ -315,7 +315,7 @@ ## toc <- Sys.time() ## g2sim <- toc-tic ## -## all.equal(sim1,sim2) +## stopifnot(all.equal(sim1,sim2)) ## ## tic <- Sys.time() ## pf1 <- pfilter(gompertz,Np=10000,seed=5676868L) @@ -327,11 +327,11 @@ ## toc <- Sys.time() ## g2pf <- toc-tic ## -## all.equal(logLik(pf1),logLik(pf2)) +## stopifnot(all.equal(logLik(pf1),logLik(pf2))) ## -## ----gompertz-perform-eval,eval=T,echo=F,results='hide'------------------ +## ----gompertz-perform-eval,eval=T,echo=F--------------------------------- binary.file <- "gompertz-performance.rda" if (file.exists(binary.file)) { load(binary.file) @@ -348,7 +348,7 @@ toc <- Sys.time() g2sim <- toc-tic -all.equal(sim1,sim2) +stopifnot(all.equal(sim1,sim2)) tic <- Sys.time() pf1 <- pfilter(gompertz,Np=10000,seed=5676868L) @@ -360,7 +360,7 @@ toc <- Sys.time() g2pf <- toc-tic -all.equal(logLik(pf1),logLik(pf2)) +stopifnot(all.equal(logLik(pf1),logLik(pf2))) save(g1sim,g2sim,g1pf,g2pf,file=binary.file,compress='xz') } Modified: www/vignettes/intro_to_pomp.Rnw =================================================================== --- www/vignettes/intro_to_pomp.Rnw 2014-04-23 22:24:34 UTC (rev 937) +++ www/vignettes/intro_to_pomp.Rnw 2014-04-24 15:08:55 UTC (rev 938) @@ -1,8 +1,9 @@ -\documentclass[10pt,reqno,final]{amsart} +\documentclass[10pt,reqno,final,pdftex]{amsart} %\VignetteIndexEntry{Introduction to pomp} %\VignetteEngine{knitr::knitr} \usepackage{times} \usepackage[utf8]{inputenc} +\usepackage{graphicx} \usepackage[round]{natbib} \usepackage{paralist} \usepackage{float} @@ -598,7 +599,7 @@ toc <- Sys.time() g2sim <- toc-tic -all.equal(sim1,sim2) +stopifnot(all.equal(sim1,sim2)) tic <- Sys.time() pf1 <- pfilter(gompertz,Np=10000,seed=5676868L) @@ -610,10 +611,10 @@ toc <- Sys.time() g2pf <- toc-tic -all.equal(logLik(pf1),logLik(pf2)) +stopifnot(all.equal(logLik(pf1),logLik(pf2))) @ -<>= +<>= binary.file <- "gompertz-performance.rda" if (file.exists(binary.file)) { load(binary.file) Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Thu Apr 24 23:13:09 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Apr 2014 23:13:09 +0200 (CEST) Subject: [Pomp-commits] r939 - www/vignettes Message-ID: <20140424211309.9BA0D184EAB@r-forge.r-project.org> Author: kingaa Date: 2014-04-24 23:13:09 +0200 (Thu, 24 Apr 2014) New Revision: 939 Modified: www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/gompertz-performance.rda www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.pdf Log: - more tweaks Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/gompertz-performance.rda =================================================================== (Binary files differ) Modified: www/vignettes/intro_to_pomp.R =================================================================== --- www/vignettes/intro_to_pomp.R 2014-04-24 15:08:55 UTC (rev 938) +++ www/vignettes/intro_to_pomp.R 2014-04-24 21:13:09 UTC (rev 939) @@ -291,7 +291,7 @@ rprocess=discrete.time.sim( step.fun=Csnippet(' double S = exp(-r*dt); - double eps = (sigma > 0.0) ? exp(rnorm(0,sigma)) : 1.0; + double eps = rlnorm(0,sigma); X = pow(K,(1-S))*pow(X,S)*eps; '), delta.t=1 Modified: www/vignettes/intro_to_pomp.Rnw =================================================================== --- www/vignettes/intro_to_pomp.Rnw 2014-04-24 15:08:55 UTC (rev 938) +++ www/vignettes/intro_to_pomp.Rnw 2014-04-24 21:13:09 UTC (rev 939) @@ -550,7 +550,7 @@ There are two ways to accomplish this. Since version 0.50, one can define the components of a POMP model using snippets of C code. This is quite straightforward and easy to do in most cases. -Alternatively, since its earliest versions, \pkg{pomp} has provided a more flexible, but more complicated interface allowing a user to write the basic functions in C or FORTRAN, compile them into a shared-object library using \code{R CMD SHLIB}, dynamically link them into an \R\ session, and construct \code{pomp} objects that call them. +Alternatively, since its earliest versions, \pkg{pomp} has provided a more flexible, but more complicated, interface allowing a user to write the basic functions in C or FORTRAN, compile them into a shared-object library using \code{R CMD SHLIB}, dynamically link them into an \R\ session, and construct \code{pomp} objects that call them. Users desiring to follow the latter approach are directed to the ``Advanced topics'' document, included with the package and at \texttt{http://pomp.r-forge.r-project.org} and to the package source code for the POMP model examples included with the package. Here, we'll demonstrate the method using snippets. @@ -570,7 +570,7 @@ rprocess=discrete.time.sim( step.fun=Csnippet(' double S = exp(-r*dt); - double eps = (sigma > 0.0) ? exp(rnorm(0,sigma)) : 1.0; + double eps = rlnorm(0,sigma); X = pow(K,(1-S))*pow(X,S)*eps; '), delta.t=1 Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Wed Apr 30 15:28:10 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 30 Apr 2014 15:28:10 +0200 (CEST) Subject: [Pomp-commits] r940 - in pkg/mif2: . R Message-ID: <20140430132810.47FD218715E@r-forge.r-project.org> Author: kingaa Date: 2014-04-30 15:28:09 +0200 (Wed, 30 Apr 2014) New Revision: 940 Removed: pkg/mif2/R/version.R Modified: pkg/mif2/DESCRIPTION Log: - drop unnecessary 'version' function Modified: pkg/mif2/DESCRIPTION =================================================================== --- pkg/mif2/DESCRIPTION 2014-04-24 21:13:09 UTC (rev 939) +++ pkg/mif2/DESCRIPTION 2014-04-30 13:28:09 UTC (rev 940) @@ -1,8 +1,8 @@ Package: mif2 Type: Package Title: Statistical inference for partially observed Markov processes -Version: 1.0-1 -Date: 2014-04-18 +Version: 1.0-2 +Date: 2014-04-30 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")), @@ -14,4 +14,4 @@ License: GPL(>= 2) LazyData: true BuildVignettes: true -Collate: aaa.R generics.R version.R mif2.R mif2-methods.R +Collate: aaa.R generics.R mif2.R mif2-methods.R Deleted: pkg/mif2/R/version.R =================================================================== --- pkg/mif2/R/version.R 2014-04-24 21:13:09 UTC (rev 939) +++ pkg/mif2/R/version.R 2014-04-30 13:28:09 UTC (rev 940) @@ -1,14 +0,0 @@ -version <- function (at.least = NULL) { - version <- library(help=mif2)$info[[1]] - version <- strsplit(version[pmatch("Version",version)]," ")[[1]] - version <- version[nchar(version)>0][2] - splv <- as.numeric(strsplit(version,"[-.]")[[1]]) - if (is.null(at.least)) { - list(major=splv[1],minor=splv[2],rev=splv[3],version.string=version) - } else { - minv <- as.numeric(strsplit(as.character(at.least),"[-.]")[[1]]) - (splv[1]>minv[1]) || - (splv[1]==minv[1]) && (splv[2]>minv[2]) || - (splv[1]==minv[1]) && (splv[2]==minv[2]) && (splv[3]>=minv[3]) - } -} From noreply at r-forge.r-project.org Wed Apr 30 15:28:27 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 30 Apr 2014 15:28:27 +0200 (CEST) Subject: [Pomp-commits] r941 - in pkg/pompExamples: . R Message-ID: <20140430132828.01CBC18715F@r-forge.r-project.org> Author: kingaa Date: 2014-04-30 15:28:27 +0200 (Wed, 30 Apr 2014) New Revision: 941 Removed: pkg/pompExamples/R/version.R Modified: pkg/pompExamples/DESCRIPTION Log: - drop unnecessary 'version' function Modified: pkg/pompExamples/DESCRIPTION =================================================================== --- pkg/pompExamples/DESCRIPTION 2014-04-30 13:28:09 UTC (rev 940) +++ pkg/pompExamples/DESCRIPTION 2014-04-30 13:28:27 UTC (rev 941) @@ -1,8 +1,8 @@ Package: pompExamples Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.23-1 -Date: 2014-01-14 +Version: 0.23-2 +Date: 2014-04-30 Maintainer: Aaron A. King Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"), email="kingaa at umich.edu"), @@ -21,4 +21,4 @@ License: GPL (>= 2) LazyData: false BuildVignettes: true -Collate: version.R budmoth.R pertussis.R +Collate: budmoth.R pertussis.R Deleted: pkg/pompExamples/R/version.R =================================================================== --- pkg/pompExamples/R/version.R 2014-04-30 13:28:09 UTC (rev 940) +++ pkg/pompExamples/R/version.R 2014-04-30 13:28:27 UTC (rev 941) @@ -1,15 +0,0 @@ -version <- function (at.least = NULL) { - version <- library(help=pompExamples)$info[[1]] - version <- strsplit(version[pmatch("Version",version)]," ")[[1]] - version <- version[nchar(version)>0][2] - splv <- as.numeric(strsplit(version,"[-.]")[[1]]) - if (is.null(at.least)) { - list(major=splv[1],minor=splv[2],rev=splv[3],version.string=version) - } else { - minv <- as.numeric(strsplit(as.character(at.least),"[-.]")[[1]]) - (splv[1]>minv[1]) || - (splv[1]==minv[1]) && (splv[2]>minv[2]) || - (splv[1]==minv[1]) && (splv[2]==minv[2]) && (splv[3]>=minv[3]) - } -} - From noreply at r-forge.r-project.org Wed Apr 30 15:28:48 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 30 Apr 2014 15:28:48 +0200 (CEST) Subject: [Pomp-commits] r942 - in pkg/pomp: . R inst/doc Message-ID: <20140430132848.44FD0187163@r-forge.r-project.org> Author: kingaa Date: 2014-04-30 15:28:47 +0200 (Wed, 30 Apr 2014) New Revision: 942 Removed: pkg/pomp/R/version.R Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/manual.pdf Log: - drop unnecessary 'version' function Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-04-30 13:28:27 UTC (rev 941) +++ pkg/pomp/DESCRIPTION 2014-04-30 13:28:47 UTC (rev 942) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-2 -Date: 2014-04-23 +Version: 0.50-3 +Date: 2014-04-30 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")), @@ -25,7 +25,7 @@ BuildVignettes: true VignetteBuilder: knitr MailingList: Subscribe to pomp-announce at r-forge.r-project.org for announcements by going to http://lists.r-forge.r-project.org/mailman/listinfo/pomp-announce. -Collate: aaa.R authors.R generics.R version.R eulermultinom.R +Collate: aaa.R authors.R generics.R eulermultinom.R csnippet.R pomp-fun.R plugins.R parmat.R logmeanexp.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R Deleted: pkg/pomp/R/version.R =================================================================== --- pkg/pomp/R/version.R 2014-04-30 13:28:27 UTC (rev 941) +++ pkg/pomp/R/version.R 2014-04-30 13:28:47 UTC (rev 942) @@ -1,15 +0,0 @@ -version <- function (at.least = NULL) { - version <- library(help=pomp)$info[[1]] - version <- strsplit(version[pmatch("Version",version)]," ")[[1]] - version <- version[nchar(version)>0][2] - splv <- as.numeric(strsplit(version,"[-.]")[[1]]) - if (is.null(at.least)) { - list(major=splv[1],minor=splv[2],rev=splv[3],version.string=version) - } else { - minv <- as.numeric(strsplit(as.character(at.least),"[-.]")[[1]]) - (splv[1]>minv[1]) || - (splv[1]==minv[1]) && (splv[2]>minv[2]) || - (splv[1]==minv[1]) && (splv[2]==minv[2]) && (splv[3]>=minv[3]) - } -} - Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ)