Skip to content

Commit

Permalink
Merge branch 'nullmodel-tweaks'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jari Oksanen committed Aug 23, 2016
2 parents 7c15671 + e4ccc54 commit fe46be7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
7 changes: 3 additions & 4 deletions man/nullmodel.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ object without sampling (effective for sequential algorithms).
\usage{
nullmodel(x, method)
\method{print}{nullmodel}(x, ...)
\method{simulate}{nullmodel}(object, nsim = 1,
seed = NULL, burnin = 0, thin = 1, ...)
\method{update}{nullmodel}(object, nsim = 1,
seed = NULL, ...)
\method{simulate}{nullmodel}(object, nsim = 1, seed = NULL,
burnin = 0, thin = 1, ...)
\method{update}{nullmodel}(object, nsim = 1, seed = NULL, ...)
\method{print}{simmat}(x, ...)
smbind(object, ..., MARGIN, strict = TRUE)
}
Expand Down
16 changes: 16 additions & 0 deletions man/oecosimu.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,22 @@ foo <- function(x, n, nr, nc, ...) {
cf <- commsim("myshuffle", foo, isSeq = FALSE, binary = FALSE,
mode = "double")
oecosimu(dune, meandist, cf)

## Use pre-built null model
nm <- simulate(nullmodel(sipoo, "curveball"), 99)
oecosimu(nm, nestedchecker)
## Several chains of a sequential model -- this can be generalized
## for parallel processing (see ?smbind)
nm <- replicate(5, simulate(nullmodel(sipoo, "swap"), 99,
thin=10, burnin=100), simplify = FALSE)
## nm is now a list of nullmodels: use smbind to combine these into one
## nullmodel with several chains
nm <- smbind(nm, MARGIN = 3)
nm
oecosimu(nm, nestedchecker)
## After this you can use as.mcmc() and tools in the coda package to
## analyse the chains (these will show that thin, burnin and nsimul are
## all too low for real analysis).
}
\keyword{ multivariate }
\keyword{ datagen }
Expand Down

0 comments on commit fe46be7

Please sign in to comment.