Skip to content

Commit

Permalink
add ibpf documentation example
Browse files Browse the repository at this point in the history
  • Loading branch information
ionides committed Aug 7, 2024
1 parent 15c3711 commit 0332b11
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
26 changes: 26 additions & 0 deletions R/ibpf.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@
##' each unit.
##' @param spat_regression fraction of each extended parameter regressed toward the unit mean. Not required when all parameters are unit-specific.
##'
##' @examples
##' # Complete examples are provided in the package tests
##' \dontrun{
##' # Create a simulation of a Brownian motion, for an extended model with
##' # unit-specific parameters for all estimated, even if the parameter
##' # takes the same shared value for each unit.
##' U <- 4
##' b2 <- bm2(U=U,N=5,unit_specific_names="rho")
##'
##' # Run ibpf with two blocks of two units each. estimating rho as a
##' # shared parameter with all other parameters being fixed.
##' b2_ibpf <- ibpf(b2,
##' sharedParNames="rho",
##' unitParNames=NULL,
##' Nbpf=5,
##' spat_regression=0.1,
##' Np=50,
##' rw.sd=do.call(rw_sd,setNames(rep(list(0.01),times=U),paste0("rho",1:U))),
##' cooling.fraction.50=0.5,
##' block_size=2
##' )
##'
##' # Get a likelihood estimate
##' logLik(b2_ibpf)
##' }
##'
##' @return
##' Upon successful completion, \code{ibpf} returns an object of class
##' \sQuote{ibpfd_spatPomp}.
Expand Down
27 changes: 27 additions & 0 deletions man/ibpf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0332b11

Please sign in to comment.