├── .Rbuildignore
├── .github
├── .gitignore
└── workflows
│ └── ci.yaml
├── .gitignore
├── .zenodo.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUES
├── LICENSE
├── README.md
├── UserManual
├── .gitignore
├── NimbleUserManual.pdf
├── NimbleUserManual_files
│ └── figure-html
│ │ ├── linearRegressionGraph-1.png
│ │ ├── mcmcPump-1.png
│ │ ├── mcmcPump-2.png
│ │ ├── mcmcPump2-1.png
│ │ ├── mcmcPump2-2.png
│ │ └── plotPump-1.png
├── README
├── cha-AD.html
├── cha-RCfunctions.html
├── cha-algos-provided.html
├── cha-bnp.html
├── cha-building-models.html
├── cha-data-structures.html
├── cha-installing-nimble.html
├── cha-lightning-intro.html
├── cha-mcmc.html
├── cha-more-introduction.html
├── cha-progr-with-models.html
├── cha-spatial.html
├── cha-user-defined.html
├── cha-using-models.html
├── cha-welcome-nimble.html
├── cha-writing-models.html
├── nimble-icon.png
├── overview.html
├── references.html
├── search_index.json
└── src
│ ├── .auctex-auto
│ └── UserManualRefs.el
│ ├── ADreferences.bib
│ ├── Makefile
│ ├── UserManualRefs.bib
│ ├── _bookdown.yml
│ ├── _output.yml
│ ├── chapter_AD.Rmd
│ ├── chapter_BNP.Rmd
│ ├── chapter_BuildingModels.Rmd
│ ├── chapter_DataStructures.Rmd
│ ├── chapter_InstallingNimble.Rmd
│ ├── chapter_LightningIntroduction.Rmd
│ ├── chapter_MCMC.Rmd
│ ├── chapter_MoreIntroduction.Rmd
│ ├── chapter_OtherAlgorithms.Rmd
│ ├── chapter_ProgrammingOverview.Rmd
│ ├── chapter_RCfunctions.Rmd
│ ├── chapter_Spatial.Rmd
│ ├── chapter_UserDefined.Rmd
│ ├── chapter_UsingModels.Rmd
│ ├── chapter_WelcomeToNimble.Rmd
│ ├── chapter_WritingModels.Rmd
│ ├── chapter_WritingNimbleFunctions.Rmd
│ ├── chunks
│ ├── introExample_chunks.R
│ ├── programmingWithModels_chunks.R
│ ├── usingBugsModels_chunks.R
│ └── writingModels_chunks.R
│ ├── index.Rmd
│ ├── latex2Rmd.R
│ ├── refs.Rmd
│ ├── tables
│ ├── BNPconjugacyTable.md
│ ├── BNPconjugacyTable2.md
│ ├── conjugacyTable.md
│ ├── coreRtableLong.md
│ ├── densityAliasesTable.md
│ ├── densityTableLong.md
│ ├── eigenSvdTableMatrixAsNimList.md
│ ├── eigenSvdTableMatrixElements.md
│ ├── functionTableLong.md
│ ├── functionTableMatrixLong.md
│ ├── linksTable.md
│ └── parameterizationTableLong.md
│ └── title.tex
├── appveyor.yml
├── install_requirements.R
├── install_revDeps.R
├── notes
├── ModelsAndSamplers.tex
├── bnp_ModelsAndSamplers.pdf
└── bnp_ModelsAndSamplers.tex
├── packages
├── .clang-format
├── .gitignore
├── AD-full-tests
│ ├── test-ADdists-full.R
│ └── test-ADmodels-full.R
├── GPL_header.txt
├── Laplace-examples
│ ├── glmm-Pois-NB
│ │ └── glmmPoisNB.R
│ ├── glmm-binom
│ │ └── glmmbiom.R
│ ├── lmm
│ │ ├── lmm.cpp
│ │ ├── lmmNimble.R
│ │ └── lmmTMB.R
│ ├── pump
│ │ ├── pumpNimble.R
│ │ ├── pumpTMB.R
│ │ └── pumpTMB.cpp
│ ├── spatial
│ │ ├── spatial.cpp
│ │ ├── spatialNimble.R
│ │ ├── spatialTMB.R
│ │ └── spatial_data.R
│ └── state-space
│ │ ├── thetalog.cpp
│ │ ├── thetalog.dat
│ │ ├── thetalogNimble.R
│ │ └── thetalogTMB.R
├── Makefile
├── MyMakevars_template
├── RELEASE_INSTRUCTIONS
├── TOFIX
├── benchmark.R
├── generateStaticCode.R
├── nimble
│ ├── .Rbuildignore
│ ├── DESCRIPTION
│ ├── INSTALL
│ ├── LICENSE
│ ├── NAMESPACE
│ ├── NOT_IN_TARBALL
│ ├── R
│ │ ├── .gitignore
│ │ ├── BNP_distributions.R
│ │ ├── BNP_samplers.R
│ │ ├── BUGS_BUGSdecl.R
│ │ ├── BUGS_contexts.R
│ │ ├── BUGS_getDependencies.R
│ │ ├── BUGS_graphNodeMaps.R
│ │ ├── BUGS_macros.R
│ │ ├── BUGS_mathCompatibility.R
│ │ ├── BUGS_model.R
│ │ ├── BUGS_modelDef.R
│ │ ├── BUGS_nimbleGraph.R
│ │ ├── BUGS_readBUGS.R
│ │ ├── BUGS_testBUGS.R
│ │ ├── BUGS_utils.R
│ │ ├── CAR.R
│ │ ├── Laplace.R
│ │ ├── MCEM_build.R
│ │ ├── MCMC_RJ.R
│ │ ├── MCMC_WAIC.R
│ │ ├── MCMC_autoBlock.R
│ │ ├── MCMC_build.R
│ │ ├── MCMC_configuration.R
│ │ ├── MCMC_conjugacy.R
│ │ ├── MCMC_run.R
│ │ ├── MCMC_samplers.R
│ │ ├── MCMC_utils.R
│ │ ├── NF_utils.R
│ │ ├── QuadratureGrids.R
│ │ ├── RCfunction_compile.R
│ │ ├── RCfunction_core.R
│ │ ├── all_utils.R
│ │ ├── config.R.in
│ │ ├── cppDefs_ADtools.R
│ │ ├── cppDefs_BUGSmodel.R
│ │ ├── cppDefs_RCfunction.R
│ │ ├── cppDefs_core.R
│ │ ├── cppDefs_cppProject.R
│ │ ├── cppDefs_modelValues.R
│ │ ├── cppDefs_namedObjects.R
│ │ ├── cppDefs_nimbleFunction.R
│ │ ├── cppDefs_nimbleList.R
│ │ ├── cppDefs_outputCppFromRparseTree.R
│ │ ├── cppDefs_utils.R
│ │ ├── cppDefs_variables.R
│ │ ├── cppInterfaces_modelValues.R
│ │ ├── cppInterfaces_models.R
│ │ ├── cppInterfaces_nimbleFunctions.R
│ │ ├── cppInterfaces_otherTypes.R
│ │ ├── cppInterfaces_utils.R
│ │ ├── crossValidation.R
│ │ ├── distributions_implementations.R
│ │ ├── distributions_inputList.R
│ │ ├── distributions_processInputList.R
│ │ ├── externalCalls.R
│ │ ├── genCpp_RparseTree2exprClasses.R
│ │ ├── genCpp_addDebugMarks.R
│ │ ├── genCpp_buildIntermediates.R
│ │ ├── genCpp_eigenization.R
│ │ ├── genCpp_exprClass.R
│ │ ├── genCpp_generateCpp.R
│ │ ├── genCpp_initSizes.R
│ │ ├── genCpp_insertAssertions.R
│ │ ├── genCpp_liftMaps.R
│ │ ├── genCpp_maps.R
│ │ ├── genCpp_operatorLists.R
│ │ ├── genCpp_processSpecificCalls.R
│ │ ├── genCpp_sizeProcessing.R
│ │ ├── genCpp_toEigenize.R
│ │ ├── initializeModel.R
│ │ ├── makevars.R
│ │ ├── miscFunctions.R
│ │ ├── nimble-package.r
│ │ ├── nimbleFunction_Rderivs.R
│ │ ├── nimbleFunction_Rexecution.R
│ │ ├── nimbleFunction_compile.R
│ │ ├── nimbleFunction_core.R
│ │ ├── nimbleFunction_keywordProcessing.R
│ │ ├── nimbleFunction_nodeFunction.R
│ │ ├── nimbleFunction_nodeFunctionNew.R
│ │ ├── nimbleFunction_util.R
│ │ ├── nimbleList_core.R
│ │ ├── nimbleProject.R
│ │ ├── options.R
│ │ ├── parameterTransform.R
│ │ ├── registration.R
│ │ ├── setNimbleInternalFunctions.R
│ │ ├── types_modelValues.R
│ │ ├── types_modelValuesAccessor.R
│ │ ├── types_modelVariableAccessor.R
│ │ ├── types_nimbleFunctionList.R
│ │ ├── types_nodeFxnVector.R
│ │ ├── types_numericLists.R
│ │ ├── types_symbolTable.R
│ │ ├── types_util.R
│ │ └── zzz.R
│ ├── README.md
│ ├── cleanup
│ ├── cleanup.win
│ ├── configure
│ ├── configure.ac
│ ├── configure.win
│ ├── inst
│ │ ├── CITATION
│ │ ├── COPYRIGHTS
│ │ ├── CppCode
│ │ │ ├── .gitignore
│ │ │ ├── EigenTypedefs.cpp
│ │ │ ├── GNUmakefile
│ │ │ ├── GNUmakefile_customizeMakeconf
│ │ │ ├── Makevars.in
│ │ │ ├── ModelClassUtils.cpp
│ │ │ ├── NamedObjects.cpp
│ │ │ ├── RcppNimbleUtils.cpp
│ │ │ ├── RcppUtils.cpp
│ │ │ ├── Utils.cpp
│ │ │ ├── accessorClasses.cpp
│ │ │ ├── customizeMakeconf.R
│ │ │ ├── dists.cpp
│ │ │ ├── dllFinalizer.cpp
│ │ │ ├── eigenUsingClasses.cpp
│ │ │ ├── nimDerivs_atomic_backsolve.cpp
│ │ │ ├── nimDerivs_atomic_cache.cpp
│ │ │ ├── nimDerivs_atomic_cholesky.cpp
│ │ │ ├── nimDerivs_atomic_classes.cpp
│ │ │ ├── nimDerivs_atomic_classes_temp.cpp
│ │ │ ├── nimDerivs_atomic_dyn_ind.cpp
│ │ │ ├── nimDerivs_atomic_forwardsolve.cpp
│ │ │ ├── nimDerivs_atomic_log_pow_int.cpp
│ │ │ ├── nimDerivs_atomic_matinverse.cpp
│ │ │ ├── nimDerivs_atomic_matmult.cpp
│ │ │ ├── nimDerivs_atomic_pow_int.cpp
│ │ │ ├── nimDerivs_atomic_probit.cpp
│ │ │ ├── nimDerivs_atomic_solve_base.cpp
│ │ │ ├── nimDerivs_atomic_solve_generic.cpp
│ │ │ ├── nimDerivs_atomic_zround.cpp
│ │ │ ├── nimDists.cpp
│ │ │ ├── nimIntegrate.cpp
│ │ │ ├── nimOptim.cpp
│ │ │ ├── nimbleCppAD.cpp
│ │ │ ├── nimbleGraph.cpp
│ │ │ ├── nodeFun.cpp
│ │ │ ├── predefinedNimbleLists.cpp
│ │ │ ├── removeCustomizedMakeconf.R
│ │ │ └── smartPtrs.cpp
│ │ ├── NEWS.md
│ │ ├── classic-bugs
│ │ │ ├── LICENSE
│ │ │ ├── R
│ │ │ │ ├── Rcheck.R
│ │ │ │ ├── bench.R
│ │ │ │ └── check.R
│ │ │ ├── ReadMe
│ │ │ ├── other
│ │ │ │ └── dipper
│ │ │ │ │ ├── dipper-data.R
│ │ │ │ │ └── dipper.bug
│ │ │ ├── vol1
│ │ │ │ ├── blocker
│ │ │ │ │ ├── ReadMe
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── bench-test3.R
│ │ │ │ │ ├── blocker-data.R
│ │ │ │ │ ├── blocker-init.R
│ │ │ │ │ ├── blocker.bug
│ │ │ │ │ ├── blockert-init.R
│ │ │ │ │ ├── blockert.bug
│ │ │ │ │ ├── blockht-data.R
│ │ │ │ │ ├── blockht.bug
│ │ │ │ │ ├── notest2.cmd
│ │ │ │ │ ├── notest3.cmd
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── bones
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bones-data.R
│ │ │ │ │ ├── bones-init.R
│ │ │ │ │ ├── bones.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── dyes
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── dyes-data.R
│ │ │ │ │ ├── dyes-init.R
│ │ │ │ │ ├── dyes.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── epil
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── epil-data.R
│ │ │ │ │ ├── epil-inits.R
│ │ │ │ │ ├── epil2.bug
│ │ │ │ │ ├── epil3.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ ├── test2.R
│ │ │ │ │ └── test2.cmd
│ │ │ │ ├── equiv
│ │ │ │ │ ├── ReadMe
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── equiv-data.R
│ │ │ │ │ ├── equiv-init.R
│ │ │ │ │ ├── equiv.bug
│ │ │ │ │ ├── equivmiss-data.R
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ └── test2.cmd
│ │ │ │ ├── inhaler
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── inhaler-data.R
│ │ │ │ │ ├── inhaler-inits.R
│ │ │ │ │ ├── inhaler.bug
│ │ │ │ │ ├── inhaler.cmd
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── kidney
│ │ │ │ │ ├── ReadMe
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── kidney-data.R
│ │ │ │ │ ├── kidney-init.R
│ │ │ │ │ ├── kidney.bug
│ │ │ │ │ └── notest1.cmd
│ │ │ │ ├── leuk
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── leuk-data.R
│ │ │ │ │ ├── leuk-init.R
│ │ │ │ │ ├── leuk-poisson.bug
│ │ │ │ │ ├── leuk-s.dat
│ │ │ │ │ ├── leuk.bug
│ │ │ │ │ ├── leuk.in
│ │ │ │ │ ├── leukfr-s.dat
│ │ │ │ │ ├── leukfr.bug
│ │ │ │ │ ├── leukfr.dat
│ │ │ │ │ ├── leukfr.in
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── line
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── line-data.R
│ │ │ │ │ ├── line-inits.R
│ │ │ │ │ ├── line.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── litters
│ │ │ │ │ ├── ReadMe
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── litters-data.R
│ │ │ │ │ ├── litters-init.R
│ │ │ │ │ ├── litters.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── lsat
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── lsat-data.R
│ │ │ │ │ ├── lsat-init.R
│ │ │ │ │ ├── lsat.bug
│ │ │ │ │ ├── lsat.dat
│ │ │ │ │ ├── lsat2-init.R
│ │ │ │ │ ├── lsat2.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ ├── test2.R
│ │ │ │ │ └── test2.cmd
│ │ │ │ ├── mice
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── mice-data.R
│ │ │ │ │ ├── mice-init.R
│ │ │ │ │ ├── mice.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── oxford
│ │ │ │ │ ├── ReadMe
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── oxford-data.R
│ │ │ │ │ ├── oxford-init.R
│ │ │ │ │ ├── oxford.bug
│ │ │ │ │ ├── oxford.dat
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── pump
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── pump-data.R
│ │ │ │ │ ├── pump-init.R
│ │ │ │ │ ├── pump.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ └── test1.cmd
│ │ │ │ ├── rats
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── rats-data.R
│ │ │ │ │ ├── rats-init.R
│ │ │ │ │ ├── rats.bug
│ │ │ │ │ ├── ratsmiss-data.R
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ └── test2.cmd
│ │ │ │ ├── salm
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── salm-data.R
│ │ │ │ │ ├── salm-init.R
│ │ │ │ │ ├── salm-pareto.bug
│ │ │ │ │ ├── salm.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ ├── test2.R
│ │ │ │ │ └── test2.cmd
│ │ │ │ └── seeds
│ │ │ │ │ ├── bench-test1.R
│ │ │ │ │ ├── bench-test2.R
│ │ │ │ │ ├── bench-test3.R
│ │ │ │ │ ├── bench-test4.R
│ │ │ │ │ ├── bench-test5.R
│ │ │ │ │ ├── seeds-data.R
│ │ │ │ │ ├── seeds-init.R
│ │ │ │ │ ├── seeds.bug
│ │ │ │ │ ├── seedspar.bug
│ │ │ │ │ ├── seedssig.bug
│ │ │ │ │ ├── seedsuni.bug
│ │ │ │ │ ├── seedszro.bug
│ │ │ │ │ ├── test1.R
│ │ │ │ │ ├── test1.cmd
│ │ │ │ │ ├── test2.R
│ │ │ │ │ ├── test2.cmd
│ │ │ │ │ ├── test3.R
│ │ │ │ │ ├── test3.cmd
│ │ │ │ │ ├── test4.R
│ │ │ │ │ ├── test4.cmd
│ │ │ │ │ ├── test5.R
│ │ │ │ │ └── test5.cmd
│ │ │ └── vol2
│ │ │ │ ├── air
│ │ │ │ ├── ReadMe
│ │ │ │ ├── air-data.R
│ │ │ │ ├── air-inits.R
│ │ │ │ ├── air.bug
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench.R
│ │ │ │ └── notest1.cmd
│ │ │ │ ├── alli
│ │ │ │ ├── alli-data.R
│ │ │ │ ├── alli-inits.R
│ │ │ │ ├── alli.bug
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── asia
│ │ │ │ ├── asia-data.R
│ │ │ │ ├── asia.bug
│ │ │ │ ├── asia2-data.R
│ │ │ │ ├── asia2.bug
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ └── test2.cmd
│ │ │ │ ├── beetles
│ │ │ │ ├── beetles-cloglog.bug
│ │ │ │ ├── beetles-data.R
│ │ │ │ ├── beetles-inits.R
│ │ │ │ ├── beetles-logit.bug
│ │ │ │ ├── beetles-probit.bug
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── bench-test3.R
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ ├── test2.cmd
│ │ │ │ ├── test3.R
│ │ │ │ └── test3.cmd
│ │ │ │ ├── biops
│ │ │ │ ├── ReadMe
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── biops-data.R
│ │ │ │ ├── biops-inits.R
│ │ │ │ ├── biops.bug
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── birats
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── bench-test3.R
│ │ │ │ ├── bench-test4.R
│ │ │ │ ├── birats-data.R
│ │ │ │ ├── birats-inits.R
│ │ │ │ ├── birats1.bug
│ │ │ │ ├── birats2.bug
│ │ │ │ ├── birats3.bug
│ │ │ │ ├── birats4.bug
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ ├── test2.cmd
│ │ │ │ ├── test3.R
│ │ │ │ ├── test3.cmd
│ │ │ │ ├── test4.R
│ │ │ │ └── test4.cmd
│ │ │ │ ├── cervix
│ │ │ │ ├── ReadMe
│ │ │ │ ├── cervix-data.R
│ │ │ │ ├── cervix-inits.R
│ │ │ │ ├── cervix.bug
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── dugongs
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── dugongs-data.R
│ │ │ │ ├── dugongs-inits.R
│ │ │ │ ├── dugongs.bug
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── eyes
│ │ │ │ ├── ReadMe
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── eyes-data.R
│ │ │ │ ├── eyes-inits.R
│ │ │ │ ├── eyes.bug
│ │ │ │ ├── eyes.dat
│ │ │ │ ├── eyes2.bug
│ │ │ │ ├── notest2.cmd
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── hearts
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── hearts-data.R
│ │ │ │ ├── hearts-inits.R
│ │ │ │ ├── hearts.bug
│ │ │ │ ├── hearts.dat
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── ice
│ │ │ │ ├── ReadMe
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench.R
│ │ │ │ ├── ice-data.R
│ │ │ │ ├── ice-inits.R
│ │ │ │ ├── icear.bug
│ │ │ │ └── test1.cmd
│ │ │ │ ├── jaw
│ │ │ │ ├── ReadMe
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── bench-test3.R
│ │ │ │ ├── jaw-constant.bug
│ │ │ │ ├── jaw-data.R
│ │ │ │ ├── jaw-inits.R
│ │ │ │ ├── jaw-linear.bug
│ │ │ │ ├── jaw-quadratic.bug
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ ├── test2.cmd
│ │ │ │ ├── test3.R
│ │ │ │ └── test3.cmd
│ │ │ │ ├── orange
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── mvotree-data.R
│ │ │ │ ├── mvotree-inits.R
│ │ │ │ ├── mvotree.bug
│ │ │ │ ├── orange-data.R
│ │ │ │ ├── orange-inits.R
│ │ │ │ ├── otree.bug
│ │ │ │ ├── otree.dat
│ │ │ │ ├── otree.in
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ └── test2.cmd
│ │ │ │ ├── pigs
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── pigs-data.R
│ │ │ │ ├── pigs-inits.R
│ │ │ │ ├── pigs.bug
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ ├── schools
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── schools-data.R
│ │ │ │ ├── schools-inits.R
│ │ │ │ ├── schools.bug
│ │ │ │ ├── schools.dat
│ │ │ │ ├── test.bug
│ │ │ │ ├── test1.R
│ │ │ │ └── test1.cmd
│ │ │ │ └── stagnant
│ │ │ │ ├── ReadMe
│ │ │ │ ├── bench-test1.R
│ │ │ │ ├── bench-test2.R
│ │ │ │ ├── notest3.cmd
│ │ │ │ ├── notest4.cmd
│ │ │ │ ├── stagnant-data.R
│ │ │ │ ├── stagnant-inits1.R
│ │ │ │ ├── stagnant-inits2.R
│ │ │ │ ├── stagnant-inits3.R
│ │ │ │ ├── stagnant-inits4.R
│ │ │ │ ├── stagnant.bug
│ │ │ │ ├── stagnant2.bug
│ │ │ │ ├── test1.R
│ │ │ │ ├── test1.cmd
│ │ │ │ ├── test2.R
│ │ │ │ └── test2.cmd
│ │ ├── include
│ │ │ ├── Eigen
│ │ │ │ ├── Cholesky
│ │ │ │ ├── CholmodSupport
│ │ │ │ ├── Core
│ │ │ │ ├── Dense
│ │ │ │ ├── Eigen
│ │ │ │ ├── Eigenvalues
│ │ │ │ ├── Geometry
│ │ │ │ ├── Householder
│ │ │ │ ├── IterativeLinearSolvers
│ │ │ │ ├── Jacobi
│ │ │ │ ├── KLUSupport
│ │ │ │ ├── LU
│ │ │ │ ├── MetisSupport
│ │ │ │ ├── OrderingMethods
│ │ │ │ ├── PaStiXSupport
│ │ │ │ ├── PardisoSupport
│ │ │ │ ├── QR
│ │ │ │ ├── QtAlignedMalloc
│ │ │ │ ├── SPQRSupport
│ │ │ │ ├── SVD
│ │ │ │ ├── Sparse
│ │ │ │ ├── SparseCholesky
│ │ │ │ ├── SparseCore
│ │ │ │ ├── SparseLU
│ │ │ │ ├── SparseQR
│ │ │ │ ├── StdDeque
│ │ │ │ ├── StdList
│ │ │ │ ├── StdVector
│ │ │ │ ├── SuperLUSupport
│ │ │ │ ├── UmfPackSupport
│ │ │ │ └── src
│ │ │ │ │ ├── Cholesky
│ │ │ │ │ ├── LDLT.h
│ │ │ │ │ ├── LLT.h
│ │ │ │ │ └── LLT_LAPACKE.h
│ │ │ │ │ ├── CholmodSupport
│ │ │ │ │ └── CholmodSupport.h
│ │ │ │ │ ├── Core
│ │ │ │ │ ├── ArithmeticSequence.h
│ │ │ │ │ ├── Array.h
│ │ │ │ │ ├── ArrayBase.h
│ │ │ │ │ ├── ArrayWrapper.h
│ │ │ │ │ ├── Assign.h
│ │ │ │ │ ├── AssignEvaluator.h
│ │ │ │ │ ├── Assign_MKL.h
│ │ │ │ │ ├── BandMatrix.h
│ │ │ │ │ ├── Block.h
│ │ │ │ │ ├── BooleanRedux.h
│ │ │ │ │ ├── CommaInitializer.h
│ │ │ │ │ ├── ConditionEstimator.h
│ │ │ │ │ ├── CoreEvaluators.h
│ │ │ │ │ ├── CoreIterators.h
│ │ │ │ │ ├── CwiseBinaryOp.h
│ │ │ │ │ ├── CwiseNullaryOp.h
│ │ │ │ │ ├── CwiseTernaryOp.h
│ │ │ │ │ ├── CwiseUnaryOp.h
│ │ │ │ │ ├── CwiseUnaryView.h
│ │ │ │ │ ├── DenseBase.h
│ │ │ │ │ ├── DenseCoeffsBase.h
│ │ │ │ │ ├── DenseStorage.h
│ │ │ │ │ ├── Diagonal.h
│ │ │ │ │ ├── DiagonalMatrix.h
│ │ │ │ │ ├── DiagonalProduct.h
│ │ │ │ │ ├── Dot.h
│ │ │ │ │ ├── EigenBase.h
│ │ │ │ │ ├── ForceAlignedAccess.h
│ │ │ │ │ ├── Fuzzy.h
│ │ │ │ │ ├── GeneralProduct.h
│ │ │ │ │ ├── GenericPacketMath.h
│ │ │ │ │ ├── GlobalFunctions.h
│ │ │ │ │ ├── IO.h
│ │ │ │ │ ├── IndexedView.h
│ │ │ │ │ ├── Inverse.h
│ │ │ │ │ ├── Map.h
│ │ │ │ │ ├── MapBase.h
│ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ ├── MathFunctionsImpl.h
│ │ │ │ │ ├── Matrix.h
│ │ │ │ │ ├── MatrixBase.h
│ │ │ │ │ ├── NestByValue.h
│ │ │ │ │ ├── NoAlias.h
│ │ │ │ │ ├── NumTraits.h
│ │ │ │ │ ├── PartialReduxEvaluator.h
│ │ │ │ │ ├── PermutationMatrix.h
│ │ │ │ │ ├── PlainObjectBase.h
│ │ │ │ │ ├── Product.h
│ │ │ │ │ ├── ProductEvaluators.h
│ │ │ │ │ ├── Random.h
│ │ │ │ │ ├── Redux.h
│ │ │ │ │ ├── Ref.h
│ │ │ │ │ ├── Replicate.h
│ │ │ │ │ ├── Reshaped.h
│ │ │ │ │ ├── ReturnByValue.h
│ │ │ │ │ ├── Reverse.h
│ │ │ │ │ ├── Select.h
│ │ │ │ │ ├── SelfAdjointView.h
│ │ │ │ │ ├── SelfCwiseBinaryOp.h
│ │ │ │ │ ├── Solve.h
│ │ │ │ │ ├── SolveTriangular.h
│ │ │ │ │ ├── SolverBase.h
│ │ │ │ │ ├── StableNorm.h
│ │ │ │ │ ├── StlIterators.h
│ │ │ │ │ ├── Stride.h
│ │ │ │ │ ├── Swap.h
│ │ │ │ │ ├── Transpose.h
│ │ │ │ │ ├── Transpositions.h
│ │ │ │ │ ├── TriangularMatrix.h
│ │ │ │ │ ├── VectorBlock.h
│ │ │ │ │ ├── VectorwiseOp.h
│ │ │ │ │ ├── Visitor.h
│ │ │ │ │ ├── arch
│ │ │ │ │ │ ├── AVX
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── AVX512
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── AltiVec
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── MatrixProduct.h
│ │ │ │ │ │ │ ├── MatrixProductCommon.h
│ │ │ │ │ │ │ ├── MatrixProductMMA.h
│ │ │ │ │ │ │ └── PacketMath.h
│ │ │ │ │ │ ├── CUDA
│ │ │ │ │ │ │ └── Complex.h
│ │ │ │ │ │ ├── Default
│ │ │ │ │ │ │ ├── BFloat16.h
│ │ │ │ │ │ │ ├── ConjHelper.h
│ │ │ │ │ │ │ ├── GenericPacketMathFunctions.h
│ │ │ │ │ │ │ ├── GenericPacketMathFunctionsFwd.h
│ │ │ │ │ │ │ ├── Half.h
│ │ │ │ │ │ │ ├── Settings.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── GPU
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── HIP
│ │ │ │ │ │ │ └── hcc
│ │ │ │ │ │ │ │ └── math_constants.h
│ │ │ │ │ │ ├── MSA
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ └── PacketMath.h
│ │ │ │ │ │ ├── NEON
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── GeneralBlockPanelKernel.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── SSE
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── SVE
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ ├── SYCL
│ │ │ │ │ │ │ ├── InteropHeaders.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ ├── PacketMath.h
│ │ │ │ │ │ │ ├── SyclMemoryModel.h
│ │ │ │ │ │ │ └── TypeCasting.h
│ │ │ │ │ │ └── ZVector
│ │ │ │ │ │ │ ├── Complex.h
│ │ │ │ │ │ │ ├── MathFunctions.h
│ │ │ │ │ │ │ └── PacketMath.h
│ │ │ │ │ ├── functors
│ │ │ │ │ │ ├── AssignmentFunctors.h
│ │ │ │ │ │ ├── BinaryFunctors.h
│ │ │ │ │ │ ├── NullaryFunctors.h
│ │ │ │ │ │ ├── StlFunctors.h
│ │ │ │ │ │ ├── TernaryFunctors.h
│ │ │ │ │ │ └── UnaryFunctors.h
│ │ │ │ │ ├── products
│ │ │ │ │ │ ├── GeneralBlockPanelKernel.h
│ │ │ │ │ │ ├── GeneralMatrixMatrix.h
│ │ │ │ │ │ ├── GeneralMatrixMatrixTriangular.h
│ │ │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h
│ │ │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h
│ │ │ │ │ │ ├── GeneralMatrixVector.h
│ │ │ │ │ │ ├── GeneralMatrixVector_BLAS.h
│ │ │ │ │ │ ├── Parallelizer.h
│ │ │ │ │ │ ├── SelfadjointMatrixMatrix.h
│ │ │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h
│ │ │ │ │ │ ├── SelfadjointMatrixVector.h
│ │ │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h
│ │ │ │ │ │ ├── SelfadjointProduct.h
│ │ │ │ │ │ ├── SelfadjointRank2Update.h
│ │ │ │ │ │ ├── TriangularMatrixMatrix.h
│ │ │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h
│ │ │ │ │ │ ├── TriangularMatrixVector.h
│ │ │ │ │ │ ├── TriangularMatrixVector_BLAS.h
│ │ │ │ │ │ ├── TriangularSolverMatrix.h
│ │ │ │ │ │ ├── TriangularSolverMatrix_BLAS.h
│ │ │ │ │ │ └── TriangularSolverVector.h
│ │ │ │ │ └── util
│ │ │ │ │ │ ├── BlasUtil.h
│ │ │ │ │ │ ├── ConfigureVectorization.h
│ │ │ │ │ │ ├── Constants.h
│ │ │ │ │ │ ├── DisableStupidWarnings.h
│ │ │ │ │ │ ├── ForwardDeclarations.h
│ │ │ │ │ │ ├── IndexedViewHelper.h
│ │ │ │ │ │ ├── IntegralConstant.h
│ │ │ │ │ │ ├── MKL_support.h
│ │ │ │ │ │ ├── Macros.h
│ │ │ │ │ │ ├── Memory.h
│ │ │ │ │ │ ├── Meta.h
│ │ │ │ │ │ ├── NonMPL2.h
│ │ │ │ │ │ ├── ReenableStupidWarnings.h
│ │ │ │ │ │ ├── ReshapedHelper.h
│ │ │ │ │ │ ├── StaticAssert.h
│ │ │ │ │ │ ├── SymbolicIndex.h
│ │ │ │ │ │ └── XprHelper.h
│ │ │ │ │ ├── Eigenvalues
│ │ │ │ │ ├── ComplexEigenSolver.h
│ │ │ │ │ ├── ComplexSchur.h
│ │ │ │ │ ├── ComplexSchur_LAPACKE.h
│ │ │ │ │ ├── EigenSolver.h
│ │ │ │ │ ├── GeneralizedEigenSolver.h
│ │ │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h
│ │ │ │ │ ├── HessenbergDecomposition.h
│ │ │ │ │ ├── MatrixBaseEigenvalues.h
│ │ │ │ │ ├── RealQZ.h
│ │ │ │ │ ├── RealSchur.h
│ │ │ │ │ ├── RealSchur_LAPACKE.h
│ │ │ │ │ ├── SelfAdjointEigenSolver.h
│ │ │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h
│ │ │ │ │ └── Tridiagonalization.h
│ │ │ │ │ ├── Geometry
│ │ │ │ │ ├── AlignedBox.h
│ │ │ │ │ ├── AngleAxis.h
│ │ │ │ │ ├── EulerAngles.h
│ │ │ │ │ ├── Homogeneous.h
│ │ │ │ │ ├── Hyperplane.h
│ │ │ │ │ ├── OrthoMethods.h
│ │ │ │ │ ├── ParametrizedLine.h
│ │ │ │ │ ├── Quaternion.h
│ │ │ │ │ ├── Rotation2D.h
│ │ │ │ │ ├── RotationBase.h
│ │ │ │ │ ├── Scaling.h
│ │ │ │ │ ├── Transform.h
│ │ │ │ │ ├── Translation.h
│ │ │ │ │ ├── Umeyama.h
│ │ │ │ │ └── arch
│ │ │ │ │ │ └── Geometry_SIMD.h
│ │ │ │ │ ├── Householder
│ │ │ │ │ ├── BlockHouseholder.h
│ │ │ │ │ ├── Householder.h
│ │ │ │ │ └── HouseholderSequence.h
│ │ │ │ │ ├── IterativeLinearSolvers
│ │ │ │ │ ├── BasicPreconditioners.h
│ │ │ │ │ ├── BiCGSTAB.h
│ │ │ │ │ ├── ConjugateGradient.h
│ │ │ │ │ ├── IncompleteCholesky.h
│ │ │ │ │ ├── IncompleteLUT.h
│ │ │ │ │ ├── IterativeSolverBase.h
│ │ │ │ │ ├── LeastSquareConjugateGradient.h
│ │ │ │ │ └── SolveWithGuess.h
│ │ │ │ │ ├── Jacobi
│ │ │ │ │ └── Jacobi.h
│ │ │ │ │ ├── KLUSupport
│ │ │ │ │ └── KLUSupport.h
│ │ │ │ │ ├── LU
│ │ │ │ │ ├── Determinant.h
│ │ │ │ │ ├── FullPivLU.h
│ │ │ │ │ ├── InverseImpl.h
│ │ │ │ │ ├── PartialPivLU.h
│ │ │ │ │ ├── PartialPivLU_LAPACKE.h
│ │ │ │ │ └── arch
│ │ │ │ │ │ └── InverseSize4.h
│ │ │ │ │ ├── MetisSupport
│ │ │ │ │ └── MetisSupport.h
│ │ │ │ │ ├── OrderingMethods
│ │ │ │ │ ├── Amd.h
│ │ │ │ │ ├── Eigen_Colamd.h
│ │ │ │ │ └── Ordering.h
│ │ │ │ │ ├── PaStiXSupport
│ │ │ │ │ └── PaStiXSupport.h
│ │ │ │ │ ├── PardisoSupport
│ │ │ │ │ └── PardisoSupport.h
│ │ │ │ │ ├── QR
│ │ │ │ │ ├── ColPivHouseholderQR.h
│ │ │ │ │ ├── ColPivHouseholderQR_LAPACKE.h
│ │ │ │ │ ├── CompleteOrthogonalDecomposition.h
│ │ │ │ │ ├── FullPivHouseholderQR.h
│ │ │ │ │ ├── HouseholderQR.h
│ │ │ │ │ └── HouseholderQR_LAPACKE.h
│ │ │ │ │ ├── SPQRSupport
│ │ │ │ │ └── SuiteSparseQRSupport.h
│ │ │ │ │ ├── SVD
│ │ │ │ │ ├── BDCSVD.h
│ │ │ │ │ ├── JacobiSVD.h
│ │ │ │ │ ├── JacobiSVD_LAPACKE.h
│ │ │ │ │ ├── SVDBase.h
│ │ │ │ │ └── UpperBidiagonalization.h
│ │ │ │ │ ├── SparseCholesky
│ │ │ │ │ ├── SimplicialCholesky.h
│ │ │ │ │ └── SimplicialCholesky_impl.h
│ │ │ │ │ ├── SparseCore
│ │ │ │ │ ├── AmbiVector.h
│ │ │ │ │ ├── CompressedStorage.h
│ │ │ │ │ ├── ConservativeSparseSparseProduct.h
│ │ │ │ │ ├── MappedSparseMatrix.h
│ │ │ │ │ ├── SparseAssign.h
│ │ │ │ │ ├── SparseBlock.h
│ │ │ │ │ ├── SparseColEtree.h
│ │ │ │ │ ├── SparseCompressedBase.h
│ │ │ │ │ ├── SparseCwiseBinaryOp.h
│ │ │ │ │ ├── SparseCwiseUnaryOp.h
│ │ │ │ │ ├── SparseDenseProduct.h
│ │ │ │ │ ├── SparseDiagonalProduct.h
│ │ │ │ │ ├── SparseDot.h
│ │ │ │ │ ├── SparseFuzzy.h
│ │ │ │ │ ├── SparseMap.h
│ │ │ │ │ ├── SparseMatrix.h
│ │ │ │ │ ├── SparseMatrixBase.h
│ │ │ │ │ ├── SparsePermutation.h
│ │ │ │ │ ├── SparseProduct.h
│ │ │ │ │ ├── SparseRedux.h
│ │ │ │ │ ├── SparseRef.h
│ │ │ │ │ ├── SparseSelfAdjointView.h
│ │ │ │ │ ├── SparseSolverBase.h
│ │ │ │ │ ├── SparseSparseProductWithPruning.h
│ │ │ │ │ ├── SparseTranspose.h
│ │ │ │ │ ├── SparseTriangularView.h
│ │ │ │ │ ├── SparseUtil.h
│ │ │ │ │ ├── SparseVector.h
│ │ │ │ │ ├── SparseView.h
│ │ │ │ │ └── TriangularSolver.h
│ │ │ │ │ ├── SparseLU
│ │ │ │ │ ├── SparseLU.h
│ │ │ │ │ ├── SparseLUImpl.h
│ │ │ │ │ ├── SparseLU_Memory.h
│ │ │ │ │ ├── SparseLU_Structs.h
│ │ │ │ │ ├── SparseLU_SupernodalMatrix.h
│ │ │ │ │ ├── SparseLU_Utils.h
│ │ │ │ │ ├── SparseLU_column_bmod.h
│ │ │ │ │ ├── SparseLU_column_dfs.h
│ │ │ │ │ ├── SparseLU_copy_to_ucol.h
│ │ │ │ │ ├── SparseLU_gemm_kernel.h
│ │ │ │ │ ├── SparseLU_heap_relax_snode.h
│ │ │ │ │ ├── SparseLU_kernel_bmod.h
│ │ │ │ │ ├── SparseLU_panel_bmod.h
│ │ │ │ │ ├── SparseLU_panel_dfs.h
│ │ │ │ │ ├── SparseLU_pivotL.h
│ │ │ │ │ ├── SparseLU_pruneL.h
│ │ │ │ │ └── SparseLU_relax_snode.h
│ │ │ │ │ ├── SparseQR
│ │ │ │ │ └── SparseQR.h
│ │ │ │ │ ├── StlSupport
│ │ │ │ │ ├── StdDeque.h
│ │ │ │ │ ├── StdList.h
│ │ │ │ │ ├── StdVector.h
│ │ │ │ │ └── details.h
│ │ │ │ │ ├── SuperLUSupport
│ │ │ │ │ └── SuperLUSupport.h
│ │ │ │ │ ├── UmfPackSupport
│ │ │ │ │ └── UmfPackSupport.h
│ │ │ │ │ ├── misc
│ │ │ │ │ ├── Image.h
│ │ │ │ │ ├── Kernel.h
│ │ │ │ │ ├── RealSvd2x2.h
│ │ │ │ │ ├── blas.h
│ │ │ │ │ ├── lapack.h
│ │ │ │ │ ├── lapacke.h
│ │ │ │ │ └── lapacke_mangling.h
│ │ │ │ │ └── plugins
│ │ │ │ │ ├── ArrayCwiseBinaryOps.h
│ │ │ │ │ ├── ArrayCwiseUnaryOps.h
│ │ │ │ │ ├── BlockMethods.h
│ │ │ │ │ ├── CommonCwiseBinaryOps.h
│ │ │ │ │ ├── CommonCwiseUnaryOps.h
│ │ │ │ │ ├── IndexedViewMethods.h
│ │ │ │ │ ├── MatrixCwiseBinaryOps.h
│ │ │ │ │ ├── MatrixCwiseUnaryOps.h
│ │ │ │ │ └── ReshapedMethods.h
│ │ │ ├── ad.hpp
│ │ │ ├── atomic_index.hpp
│ │ │ ├── cppad
│ │ │ │ ├── COPYING
│ │ │ │ ├── base_require.hpp
│ │ │ │ ├── configure.hpp
│ │ │ │ ├── core
│ │ │ │ │ ├── abort_recording.hpp
│ │ │ │ │ ├── abs.hpp
│ │ │ │ │ ├── abs_normal_fun.hpp
│ │ │ │ │ ├── ad.hpp
│ │ │ │ │ ├── ad_assign.hpp
│ │ │ │ │ ├── ad_binary.hpp
│ │ │ │ │ ├── ad_ctor.hpp
│ │ │ │ │ ├── ad_fun.hpp
│ │ │ │ │ ├── ad_fun.omh
│ │ │ │ │ ├── ad_io.hpp
│ │ │ │ │ ├── ad_to_string.hpp
│ │ │ │ │ ├── ad_type.hpp
│ │ │ │ │ ├── ad_valued.hpp
│ │ │ │ │ ├── add.hpp
│ │ │ │ │ ├── add_eq.hpp
│ │ │ │ │ ├── arithmetic.hpp
│ │ │ │ │ ├── atan2.hpp
│ │ │ │ │ ├── atomic
│ │ │ │ │ │ ├── atomic.omh
│ │ │ │ │ │ ├── four
│ │ │ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ │ │ ├── atomic.omh
│ │ │ │ │ │ │ ├── call.hpp
│ │ │ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ │ │ ├── devel
│ │ │ │ │ │ │ │ ├── devel.omh
│ │ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ │ └── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ │ └── reverse.hpp
│ │ │ │ │ │ ├── one
│ │ │ │ │ │ │ └── atomic.hpp
│ │ │ │ │ │ ├── three
│ │ │ │ │ │ │ ├── afun.hpp
│ │ │ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ │ │ ├── atomic.omh
│ │ │ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ │ └── reverse.hpp
│ │ │ │ │ │ └── two
│ │ │ │ │ │ │ ├── afun.hpp
│ │ │ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ │ │ ├── clear.hpp
│ │ │ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ │ │ ├── for_sparse_hes.hpp
│ │ │ │ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ │ ├── option.hpp
│ │ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ │ │ │ └── reverse.hpp
│ │ │ │ │ ├── azmul.hpp
│ │ │ │ │ ├── base2ad.hpp
│ │ │ │ │ ├── base_complex.hpp
│ │ │ │ │ ├── base_cond_exp.hpp
│ │ │ │ │ ├── base_double.hpp
│ │ │ │ │ ├── base_float.hpp
│ │ │ │ │ ├── base_hash.hpp
│ │ │ │ │ ├── base_limits.hpp
│ │ │ │ │ ├── base_std_math.hpp
│ │ │ │ │ ├── base_to_string.hpp
│ │ │ │ │ ├── bender_quad.hpp
│ │ │ │ │ ├── bool_fun.hpp
│ │ │ │ │ ├── bool_valued.hpp
│ │ │ │ │ ├── capacity_order.hpp
│ │ │ │ │ ├── check_for_nan.hpp
│ │ │ │ │ ├── chkpoint_one
│ │ │ │ │ │ ├── chkpoint_one.hpp
│ │ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ │ │ ├── reverse.hpp
│ │ │ │ │ │ ├── set_hes_sparse_bool.hpp
│ │ │ │ │ │ ├── set_hes_sparse_set.hpp
│ │ │ │ │ │ ├── set_jac_sparse_bool.hpp
│ │ │ │ │ │ └── set_jac_sparse_set.hpp
│ │ │ │ │ ├── chkpoint_two
│ │ │ │ │ │ ├── chk_fun.omh
│ │ │ │ │ │ ├── chkpoint_two.hpp
│ │ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ │ ├── dynamic.hpp
│ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ └── reverse.hpp
│ │ │ │ │ ├── compare.hpp
│ │ │ │ │ ├── compound_assign.hpp
│ │ │ │ │ ├── con_dyn_var.hpp
│ │ │ │ │ ├── cond_exp.hpp
│ │ │ │ │ ├── convert.hpp
│ │ │ │ │ ├── cppad_assert.hpp
│ │ │ │ │ ├── dependent.hpp
│ │ │ │ │ ├── discrete
│ │ │ │ │ │ ├── devel.omh
│ │ │ │ │ │ ├── discrete.hpp
│ │ │ │ │ │ └── user.omh
│ │ │ │ │ ├── div.hpp
│ │ │ │ │ ├── div_eq.hpp
│ │ │ │ │ ├── drivers.hpp
│ │ │ │ │ ├── epsilon.hpp
│ │ │ │ │ ├── equal_op_seq.hpp
│ │ │ │ │ ├── for_hes_sparsity.hpp
│ │ │ │ │ ├── for_jac_sparsity.hpp
│ │ │ │ │ ├── for_one.hpp
│ │ │ │ │ ├── for_sparse_hes.hpp
│ │ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ │ ├── for_two.hpp
│ │ │ │ │ ├── forward
│ │ │ │ │ │ ├── compare_change.omh
│ │ │ │ │ │ ├── devel.omh
│ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ ├── forward.omh
│ │ │ │ │ │ ├── forward_dir.omh
│ │ │ │ │ │ ├── forward_one.omh
│ │ │ │ │ │ ├── forward_order.omh
│ │ │ │ │ │ ├── forward_two.omh
│ │ │ │ │ │ ├── forward_zero.omh
│ │ │ │ │ │ └── size_order.omh
│ │ │ │ │ ├── fun_check.hpp
│ │ │ │ │ ├── fun_construct.hpp
│ │ │ │ │ ├── fun_eval.hpp
│ │ │ │ │ ├── fun_property.omh
│ │ │ │ │ ├── function_name.omh
│ │ │ │ │ ├── graph
│ │ │ │ │ │ ├── cpp_ad_graph.omh
│ │ │ │ │ │ ├── cpp_graph.hpp
│ │ │ │ │ │ ├── cpp_graph.omh
│ │ │ │ │ │ ├── from_graph.hpp
│ │ │ │ │ │ ├── from_json.hpp
│ │ │ │ │ │ ├── graph_op_enum.hpp
│ │ │ │ │ │ ├── json_ad_graph.omh
│ │ │ │ │ │ ├── json_graph_op.omh
│ │ │ │ │ │ ├── to_graph.hpp
│ │ │ │ │ │ └── to_json.hpp
│ │ │ │ │ ├── hash_code.hpp
│ │ │ │ │ ├── hessian.hpp
│ │ │ │ │ ├── identical.hpp
│ │ │ │ │ ├── independent
│ │ │ │ │ │ ├── devel.omh
│ │ │ │ │ │ ├── independent.hpp
│ │ │ │ │ │ └── user.omh
│ │ │ │ │ ├── integer.hpp
│ │ │ │ │ ├── jacobian.hpp
│ │ │ │ │ ├── lu_ratio.hpp
│ │ │ │ │ ├── mul.hpp
│ │ │ │ │ ├── mul_eq.hpp
│ │ │ │ │ ├── near_equal_ext.hpp
│ │ │ │ │ ├── new_dynamic.hpp
│ │ │ │ │ ├── nimble_ADbase_extensions.hpp
│ │ │ │ │ ├── nimble_ADbase_tape_link_extensions.hpp
│ │ │ │ │ ├── num_skip.hpp
│ │ │ │ │ ├── numeric_limits.hpp
│ │ │ │ │ ├── omp_max_thread.hpp
│ │ │ │ │ ├── opt_val_hes.hpp
│ │ │ │ │ ├── optimize.hpp
│ │ │ │ │ ├── ordered.hpp
│ │ │ │ │ ├── parallel_ad.hpp
│ │ │ │ │ ├── pow.hpp
│ │ │ │ │ ├── print_for.hpp
│ │ │ │ │ ├── rev_hes_sparsity.hpp
│ │ │ │ │ ├── rev_jac_sparsity.hpp
│ │ │ │ │ ├── rev_one.hpp
│ │ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ │ ├── rev_two.hpp
│ │ │ │ │ ├── reverse.hpp
│ │ │ │ │ ├── sign.hpp
│ │ │ │ │ ├── sparse.hpp
│ │ │ │ │ ├── sparse_hes.hpp
│ │ │ │ │ ├── sparse_hessian.hpp
│ │ │ │ │ ├── sparse_jac.hpp
│ │ │ │ │ ├── sparse_jacobian.hpp
│ │ │ │ │ ├── standard_math.hpp
│ │ │ │ │ ├── std_math_11.hpp
│ │ │ │ │ ├── sub.hpp
│ │ │ │ │ ├── sub_eq.hpp
│ │ │ │ │ ├── subgraph_jac_rev.hpp
│ │ │ │ │ ├── subgraph_reverse.hpp
│ │ │ │ │ ├── subgraph_sparsity.hpp
│ │ │ │ │ ├── tape_link.hpp
│ │ │ │ │ ├── test_vector.hpp
│ │ │ │ │ ├── testvector.hpp
│ │ │ │ │ ├── unary_minus.hpp
│ │ │ │ │ ├── unary_plus.hpp
│ │ │ │ │ ├── undef.hpp
│ │ │ │ │ ├── user_ad.hpp
│ │ │ │ │ ├── value.hpp
│ │ │ │ │ ├── var2par.hpp
│ │ │ │ │ ├── vec_ad
│ │ │ │ │ │ ├── user.omh
│ │ │ │ │ │ └── vec_ad.hpp
│ │ │ │ │ └── zdouble.hpp
│ │ │ │ ├── cppad.hpp
│ │ │ │ ├── epl-2.0.txt
│ │ │ │ ├── example
│ │ │ │ │ ├── atomic_four
│ │ │ │ │ │ ├── lin_ode
│ │ │ │ │ │ │ ├── base_lin_ode.hpp
│ │ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ │ ├── get.hpp
│ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ ├── implement.omh
│ │ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── lin_ode.hpp
│ │ │ │ │ │ │ ├── lin_ode.omh
│ │ │ │ │ │ │ ├── reverse.hpp
│ │ │ │ │ │ │ └── set.hpp
│ │ │ │ │ │ ├── mat_mul
│ │ │ │ │ │ │ ├── base_mat_mul.hpp
│ │ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ │ ├── forward.hpp
│ │ │ │ │ │ │ ├── get.hpp
│ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ ├── implement.omh
│ │ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── mat_mul.hpp
│ │ │ │ │ │ │ ├── mat_mul.omh
│ │ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ │ ├── reverse.hpp
│ │ │ │ │ │ │ └── set.hpp
│ │ │ │ │ │ └── vector
│ │ │ │ │ │ │ ├── add_op.hpp
│ │ │ │ │ │ │ ├── div_op.hpp
│ │ │ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ │ │ ├── forward_op.hpp
│ │ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ │ ├── implement.omh
│ │ │ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ │ │ ├── mul_op.hpp
│ │ │ │ │ │ │ ├── neg_op.hpp
│ │ │ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ │ │ ├── reverse_op.hpp
│ │ │ │ │ │ │ ├── sub_op.hpp
│ │ │ │ │ │ │ ├── vector.hpp
│ │ │ │ │ │ │ └── vector.omh
│ │ │ │ │ ├── atomic_three
│ │ │ │ │ │ └── mat_mul.hpp
│ │ │ │ │ ├── atomic_two
│ │ │ │ │ │ ├── eigen_cholesky.hpp
│ │ │ │ │ │ ├── eigen_mat_inv.hpp
│ │ │ │ │ │ └── eigen_mat_mul.hpp
│ │ │ │ │ ├── base_adolc.hpp
│ │ │ │ │ ├── code_gen_fun.hpp
│ │ │ │ │ ├── cppad_eigen.hpp
│ │ │ │ │ └── eigen_plugin.hpp
│ │ │ │ ├── ipopt
│ │ │ │ │ ├── solve.hpp
│ │ │ │ │ ├── solve_callback.hpp
│ │ │ │ │ └── solve_result.hpp
│ │ │ │ ├── local
│ │ │ │ │ ├── ad_tape.hpp
│ │ │ │ │ ├── atom_state.hpp
│ │ │ │ │ ├── atomic_index.hpp
│ │ │ │ │ ├── color_general.hpp
│ │ │ │ │ ├── color_symmetric.hpp
│ │ │ │ │ ├── cppad_colpack.hpp
│ │ │ │ │ ├── declare_ad.hpp
│ │ │ │ │ ├── define.hpp
│ │ │ │ │ ├── graph
│ │ │ │ │ │ ├── cpp_graph_itr.hpp
│ │ │ │ │ │ ├── cpp_graph_itr.omh
│ │ │ │ │ │ ├── cpp_graph_op.hpp
│ │ │ │ │ │ ├── dev_graph.omh
│ │ │ │ │ │ ├── json_lexer.hpp
│ │ │ │ │ │ ├── json_lexer.omh
│ │ │ │ │ │ ├── json_parser.hpp
│ │ │ │ │ │ └── json_writer.hpp
│ │ │ │ │ ├── hash_code.hpp
│ │ │ │ │ ├── independent.hpp
│ │ │ │ │ ├── is_pod.hpp
│ │ │ │ │ ├── is_pod.hpp.in
│ │ │ │ │ ├── nimble_atomic_index.hpp
│ │ │ │ │ ├── op.hpp
│ │ │ │ │ ├── op
│ │ │ │ │ │ ├── abs_op.hpp
│ │ │ │ │ │ ├── acos_op.hpp
│ │ │ │ │ │ ├── acosh_op.hpp
│ │ │ │ │ │ ├── add_op.hpp
│ │ │ │ │ │ ├── asin_op.hpp
│ │ │ │ │ │ ├── asinh_op.hpp
│ │ │ │ │ │ ├── atan_op.hpp
│ │ │ │ │ │ ├── atanh_op.hpp
│ │ │ │ │ │ ├── binary_op.omh
│ │ │ │ │ │ ├── comp_op.hpp
│ │ │ │ │ │ ├── cond_op.hpp
│ │ │ │ │ │ ├── cos_op.hpp
│ │ │ │ │ │ ├── cosh_op.hpp
│ │ │ │ │ │ ├── cskip_op.hpp
│ │ │ │ │ │ ├── csum_op.hpp
│ │ │ │ │ │ ├── discrete_op.hpp
│ │ │ │ │ │ ├── div_op.hpp
│ │ │ │ │ │ ├── erf_op.hpp
│ │ │ │ │ │ ├── exp_op.hpp
│ │ │ │ │ │ ├── expm1_op.hpp
│ │ │ │ │ │ ├── load_op.hpp
│ │ │ │ │ │ ├── log1p_op.hpp
│ │ │ │ │ │ ├── log_op.hpp
│ │ │ │ │ │ ├── mul_op.hpp
│ │ │ │ │ │ ├── neg_op.hpp
│ │ │ │ │ │ ├── parameter_op.hpp
│ │ │ │ │ │ ├── pow_op.hpp
│ │ │ │ │ │ ├── print_op.hpp
│ │ │ │ │ │ ├── prototype_op.hpp
│ │ │ │ │ │ ├── sign_op.hpp
│ │ │ │ │ │ ├── sin_op.hpp
│ │ │ │ │ │ ├── sinh_op.hpp
│ │ │ │ │ │ ├── sqrt_op.hpp
│ │ │ │ │ │ ├── store_op.hpp
│ │ │ │ │ │ ├── sub_op.hpp
│ │ │ │ │ │ ├── tan_op.hpp
│ │ │ │ │ │ ├── tanh_op.hpp
│ │ │ │ │ │ ├── unary_op.omh
│ │ │ │ │ │ └── zmul_op.hpp
│ │ │ │ │ ├── op_code_dyn.hpp
│ │ │ │ │ ├── op_code_var.hpp
│ │ │ │ │ ├── optimize
│ │ │ │ │ │ ├── cexp_info.hpp
│ │ │ │ │ │ ├── csum_op_info.hpp
│ │ │ │ │ │ ├── csum_stacks.hpp
│ │ │ │ │ │ ├── get_cexp_info.hpp
│ │ │ │ │ │ ├── get_dyn_previous.hpp
│ │ │ │ │ │ ├── get_op_previous.hpp
│ │ │ │ │ │ ├── get_op_usage.hpp
│ │ │ │ │ │ ├── get_par_usage.hpp
│ │ │ │ │ │ ├── hash_code.hpp
│ │ │ │ │ │ ├── match_op.hpp
│ │ │ │ │ │ ├── optimize_run.hpp
│ │ │ │ │ │ ├── record_csum.hpp
│ │ │ │ │ │ ├── record_pv.hpp
│ │ │ │ │ │ ├── record_vp.hpp
│ │ │ │ │ │ ├── record_vv.hpp
│ │ │ │ │ │ ├── size_pair.hpp
│ │ │ │ │ │ └── usage.hpp
│ │ │ │ │ ├── play
│ │ │ │ │ │ ├── addr_enum.hpp
│ │ │ │ │ │ ├── atom_op_info.hpp
│ │ │ │ │ │ ├── player.hpp
│ │ │ │ │ │ ├── random_iterator.hpp
│ │ │ │ │ │ ├── random_setup.hpp
│ │ │ │ │ │ ├── sequential_iterator.hpp
│ │ │ │ │ │ └── subgraph_iterator.hpp
│ │ │ │ │ ├── pod_vector.hpp
│ │ │ │ │ ├── record
│ │ │ │ │ │ ├── comp_op.hpp
│ │ │ │ │ │ ├── cond_exp.hpp
│ │ │ │ │ │ ├── put_dyn_atomic.hpp
│ │ │ │ │ │ ├── put_var_atomic.hpp
│ │ │ │ │ │ ├── put_var_vecad.hpp
│ │ │ │ │ │ ├── recorder.hpp
│ │ │ │ │ │ └── recorder.omh
│ │ │ │ │ ├── set_get_in_parallel.hpp
│ │ │ │ │ ├── sparse
│ │ │ │ │ │ ├── binary_op.hpp
│ │ │ │ │ │ ├── dev_sparse.omh
│ │ │ │ │ │ ├── internal.hpp
│ │ │ │ │ │ ├── list_setvec.hpp
│ │ │ │ │ │ ├── list_setvec.omh
│ │ │ │ │ │ ├── pack_setvec.hpp
│ │ │ │ │ │ ├── pack_setvec.omh
│ │ │ │ │ │ ├── setvector.omh
│ │ │ │ │ │ ├── svec_setvec.hpp
│ │ │ │ │ │ └── unary_op.hpp
│ │ │ │ │ ├── std_set.hpp
│ │ │ │ │ ├── subgraph
│ │ │ │ │ │ ├── arg_variable.hpp
│ │ │ │ │ │ ├── entire_call.hpp
│ │ │ │ │ │ ├── get_rev.hpp
│ │ │ │ │ │ ├── info.hpp
│ │ │ │ │ │ ├── init_rev.hpp
│ │ │ │ │ │ └── sparsity.hpp
│ │ │ │ │ ├── sweep
│ │ │ │ │ │ ├── call_atomic.hpp
│ │ │ │ │ │ ├── dev_sweep.omh
│ │ │ │ │ │ ├── dynamic.hpp
│ │ │ │ │ │ ├── for_hes.hpp
│ │ │ │ │ │ ├── for_jac.hpp
│ │ │ │ │ │ ├── forward0.hpp
│ │ │ │ │ │ ├── forward1.hpp
│ │ │ │ │ │ ├── forward2.hpp
│ │ │ │ │ │ ├── rev_hes.hpp
│ │ │ │ │ │ ├── rev_jac.hpp
│ │ │ │ │ │ └── reverse.hpp
│ │ │ │ │ └── utility
│ │ │ │ │ │ ├── cppad_vector_itr.hpp
│ │ │ │ │ │ └── vector_bool.hpp
│ │ │ │ ├── speed
│ │ │ │ │ ├── det_33.hpp
│ │ │ │ │ ├── det_by_lu.hpp
│ │ │ │ │ ├── det_by_minor.hpp
│ │ │ │ │ ├── det_grad_33.hpp
│ │ │ │ │ ├── det_of_minor.hpp
│ │ │ │ │ ├── mat_sum_sq.hpp
│ │ │ │ │ ├── ode_evaluate.hpp
│ │ │ │ │ ├── sparse_hes_fun.hpp
│ │ │ │ │ ├── sparse_jac_fun.hpp
│ │ │ │ │ └── uniform_01.hpp
│ │ │ │ ├── utility.hpp
│ │ │ │ ├── utility
│ │ │ │ │ ├── check_numeric_type.hpp
│ │ │ │ │ ├── check_simple_vector.hpp
│ │ │ │ │ ├── elapsed_seconds.hpp
│ │ │ │ │ ├── error_handler.hpp
│ │ │ │ │ ├── index_sort.hpp
│ │ │ │ │ ├── lu_factor.hpp
│ │ │ │ │ ├── lu_invert.hpp
│ │ │ │ │ ├── lu_solve.hpp
│ │ │ │ │ ├── memory_leak.hpp
│ │ │ │ │ ├── nan.hpp
│ │ │ │ │ ├── near_equal.hpp
│ │ │ │ │ ├── ode_err_control.hpp
│ │ │ │ │ ├── ode_gear.hpp
│ │ │ │ │ ├── ode_gear_control.hpp
│ │ │ │ │ ├── omh
│ │ │ │ │ │ ├── cppad_vector.omh
│ │ │ │ │ │ ├── dev_cppad_vector.omh
│ │ │ │ │ │ ├── dev_utility.omh
│ │ │ │ │ │ ├── dev_vector_bool.omh
│ │ │ │ │ │ └── utility.omh
│ │ │ │ │ ├── omp_alloc.hpp
│ │ │ │ │ ├── poly.hpp
│ │ │ │ │ ├── pow_int.hpp
│ │ │ │ │ ├── romberg_mul.hpp
│ │ │ │ │ ├── romberg_one.hpp
│ │ │ │ │ ├── rosen_34.hpp
│ │ │ │ │ ├── runge_45.hpp
│ │ │ │ │ ├── set_union.hpp
│ │ │ │ │ ├── sparse2eigen.hpp
│ │ │ │ │ ├── sparse_rc.hpp
│ │ │ │ │ ├── sparse_rcv.hpp
│ │ │ │ │ ├── speed_test.hpp
│ │ │ │ │ ├── test_boolofvoid.hpp
│ │ │ │ │ ├── thread_alloc.hpp
│ │ │ │ │ ├── time_test.hpp
│ │ │ │ │ ├── to_string.hpp
│ │ │ │ │ ├── track_new_del.hpp
│ │ │ │ │ ├── vector.hpp
│ │ │ │ │ └── vector_bool.hpp
│ │ │ │ └── wno_conversion.hpp
│ │ │ ├── cppad_notes_for_nimble.txt
│ │ │ ├── nimble
│ │ │ │ ├── EigenTypedefs.h
│ │ │ │ ├── Model.h
│ │ │ │ ├── ModelClassUtils.h
│ │ │ │ ├── NamedObjects.h
│ │ │ │ ├── NimArr.h
│ │ │ │ ├── NimArrBase.h
│ │ │ │ ├── RcppNimbleUtils.h
│ │ │ │ ├── RcppUtils.h
│ │ │ │ ├── Utils.h
│ │ │ │ ├── Values.h
│ │ │ │ ├── accessorClasses.h
│ │ │ │ ├── dists.h
│ │ │ │ ├── dllFinalizer.h
│ │ │ │ ├── dynamicRegistrations.h
│ │ │ │ ├── eigenUsingClasses.h
│ │ │ │ ├── nimDerivs_atomic_backsolve.h
│ │ │ │ ├── nimDerivs_atomic_cache.h
│ │ │ │ ├── nimDerivs_atomic_cholesky.h
│ │ │ │ ├── nimDerivs_atomic_classes.h
│ │ │ │ ├── nimDerivs_atomic_discrete.h
│ │ │ │ ├── nimDerivs_atomic_dyn_ind.h
│ │ │ │ ├── nimDerivs_atomic_forwardsolve.h
│ │ │ │ ├── nimDerivs_atomic_log_pow_int.h
│ │ │ │ ├── nimDerivs_atomic_matinverse.h
│ │ │ │ ├── nimDerivs_atomic_matmult.h
│ │ │ │ ├── nimDerivs_atomic_pow_int.h
│ │ │ │ ├── nimDerivs_atomic_probit.h
│ │ │ │ ├── nimDerivs_atomic_solve_base.h
│ │ │ │ ├── nimDerivs_atomic_zround.h
│ │ │ │ ├── nimDerivs_dists.h
│ │ │ │ ├── nimDerivs_vecmat_utils.h
│ │ │ │ ├── nimDists.h
│ │ │ │ ├── nimIntegrate.h
│ │ │ │ ├── nimOptim.h
│ │ │ │ ├── nimbleCppAD.h
│ │ │ │ ├── nimbleCppADbaseClass.cpp
│ │ │ │ ├── nimbleCppADbaseClass.h
│ │ │ │ ├── nimbleEigen.h
│ │ │ │ ├── nimbleEigenNimArr.h
│ │ │ │ ├── nimbleGraph.h
│ │ │ │ ├── nodeFun.h
│ │ │ │ ├── predefinedNimbleLists.h
│ │ │ │ └── smartPtrs.h
│ │ │ ├── nimble_ADbase_extensions.hpp
│ │ │ ├── nimble_ADbase_tape_link_extensions.hpp
│ │ │ ├── nimble_atomic_index.hpp
│ │ │ └── tape_link.hpp
│ │ └── make
│ │ │ ├── .gitignore
│ │ │ ├── Makevars.in
│ │ │ ├── Makevars.win.in
│ │ │ └── Makevars_lib.in
│ ├── man
│ │ ├── ADNimbleList.Rd
│ │ ├── ADbreak.Rd
│ │ ├── ADproxyModelClass-class.Rd
│ │ ├── BUGSdeclClass-class.Rd
│ │ ├── CAR-Normal.Rd
│ │ ├── CAR-Proper.Rd
│ │ ├── CAR_calcNumIslands.Rd
│ │ ├── Categorical.Rd
│ │ ├── ChineseRestaurantProcess.Rd
│ │ ├── CmodelBaseClass-class.Rd
│ │ ├── CnimbleFunctionBase-class.Rd
│ │ ├── Constraint.Rd
│ │ ├── Dirichlet.Rd
│ │ ├── Double-Exponential.Rd
│ │ ├── Exponential.Rd
│ │ ├── Interval.Rd
│ │ ├── Inverse-Gamma.Rd
│ │ ├── Inverse-Wishart.Rd
│ │ ├── LKJ.Rd
│ │ ├── MCMCconf-class.Rd
│ │ ├── Multinomial.Rd
│ │ ├── Multivariate-t.Rd
│ │ ├── MultivariateNormal.Rd
│ │ ├── Rmatrix2mvOneVar.Rd
│ │ ├── RmodelBaseClass-class.Rd
│ │ ├── StickBreakingFunction.Rd
│ │ ├── Wishart.Rd
│ │ ├── any_na.Rd
│ │ ├── as.carAdjacency.Rd
│ │ ├── as.carCM.Rd
│ │ ├── asRow.Rd
│ │ ├── autoBlock.Rd
│ │ ├── buildAGHQGrid.Rd
│ │ ├── buildAuxiliaryFilter.Rd
│ │ ├── buildBootstrapFilter.Rd
│ │ ├── buildEnsembleKF.Rd
│ │ ├── buildIteratedFilter2.Rd
│ │ ├── buildLiuWestFilter.Rd
│ │ ├── buildMCEM.Rd
│ │ ├── buildMCMC.Rd
│ │ ├── calculateWAIC.Rd
│ │ ├── carBounds.Rd
│ │ ├── carMaxBound.Rd
│ │ ├── carMinBound.Rd
│ │ ├── checkInterrupt.Rd
│ │ ├── clearCompiled.Rd
│ │ ├── codeBlockClass-class.Rd
│ │ ├── compileNimble.Rd
│ │ ├── configureMCMC.Rd
│ │ ├── configureRJ.Rd
│ │ ├── decide.Rd
│ │ ├── decideAndJump.Rd
│ │ ├── declare.Rd
│ │ ├── deregisterDistributions.Rd
│ │ ├── distributionInfo.Rd
│ │ ├── eigenNimbleList.Rd
│ │ ├── extractControlElement.Rd
│ │ ├── flat.Rd
│ │ ├── getBUGSexampleDir.Rd
│ │ ├── getBound.Rd
│ │ ├── getConditionallyIndependentSets.Rd
│ │ ├── getDefinition.Rd
│ │ ├── getMacroParameters.Rd
│ │ ├── getNimbleOption.Rd
│ │ ├── getParam.Rd
│ │ ├── getSamplesDPmeasure.Rd
│ │ ├── getsize.Rd
│ │ ├── identityMatrix.Rd
│ │ ├── initializeModel.Rd
│ │ ├── is.nf.Rd
│ │ ├── is.nl.Rd
│ │ ├── laplace.Rd
│ │ ├── makeBoundInfo.Rd
│ │ ├── makeModelDerivsInfo.Rd
│ │ ├── makeParamInfo.Rd
│ │ ├── modelBaseClass-class.Rd
│ │ ├── modelDefClass-class.Rd
│ │ ├── modelInitialization.Rd
│ │ ├── modelValues.Rd
│ │ ├── modelValuesBaseClass-class.Rd
│ │ ├── modelValuesConf.Rd
│ │ ├── nfMethod.Rd
│ │ ├── nfVar.Rd
│ │ ├── nimCat.Rd
│ │ ├── nimCopy.Rd
│ │ ├── nimDerivs.Rd
│ │ ├── nimDim.Rd
│ │ ├── nimEigen.Rd
│ │ ├── nimIntegrate.Rd
│ │ ├── nimMatrix.Rd
│ │ ├── nimNumeric.Rd
│ │ ├── nimOptim.Rd
│ │ ├── nimOptimDefaultControl.Rd
│ │ ├── nimOptimMethod.Rd
│ │ ├── nimPrint.Rd
│ │ ├── nimStop.Rd
│ │ ├── nimSvd.Rd
│ │ ├── nimble-R-functions.Rd
│ │ ├── nimble-internal.Rd
│ │ ├── nimble-math.Rd
│ │ ├── nimble-package.Rd
│ │ ├── nimbleCode.Rd
│ │ ├── nimbleExternalCall.Rd
│ │ ├── nimbleFunction.Rd
│ │ ├── nimbleFunctionBase-class.Rd
│ │ ├── nimbleFunctionList-class.Rd
│ │ ├── nimbleFunctionVirtual.Rd
│ │ ├── nimbleList.Rd
│ │ ├── nimbleMCMC.Rd
│ │ ├── nimbleModel.Rd
│ │ ├── nimbleOptions.Rd
│ │ ├── nimbleRcall.Rd
│ │ ├── nimbleType-class.Rd
│ │ ├── nodeFunctions.Rd
│ │ ├── optimControlNimbleList.Rd
│ │ ├── optimDefaultControl.Rd
│ │ ├── optimResultNimbleList.Rd
│ │ ├── parameterTransform.Rd
│ │ ├── pow_int.Rd
│ │ ├── printErrors.Rd
│ │ ├── rankSample.Rd
│ │ ├── readBUGSmodel.Rd
│ │ ├── registerDistributions.Rd
│ │ ├── resize.Rd
│ │ ├── run.time.Rd
│ │ ├── runCrossValidate.Rd
│ │ ├── runLaplace.Rd
│ │ ├── runMCMC.Rd
│ │ ├── samplers.Rd
│ │ ├── setAndCalculate.Rd
│ │ ├── setAndCalculateOne.Rd
│ │ ├── setSize.Rd
│ │ ├── setupMargNodes.Rd
│ │ ├── setupOutputs.Rd
│ │ ├── simNodes.Rd
│ │ ├── simNodesMV.Rd
│ │ ├── singleVarAccessClass-class.Rd
│ │ ├── summaryLaplace.Rd
│ │ ├── svdNimbleList.Rd
│ │ ├── t.Rd
│ │ ├── testBUGSmodel.Rd
│ │ ├── valueInCompiledNimbleFunction.Rd
│ │ ├── values.Rd
│ │ ├── waic.Rd
│ │ ├── waicDetailsNimbleList.Rd
│ │ ├── waicNimbleList.Rd
│ │ └── withNimbleOptions.Rd
│ ├── src
│ │ ├── .gitignore
│ │ ├── DO_NOT_PUT_CODE_HERE_DO_IN_INST_CPPCODE
│ │ ├── Makevars.in
│ │ ├── Makevars.win
│ │ └── nimble.cpp
│ └── tests
│ │ └── testthat
│ │ ├── AD_distribution_test_lists.R
│ │ ├── AD_knownFailures.R
│ │ ├── AD_math_test_lists.R
│ │ ├── AD_test_utils.R
│ │ ├── barkerTestLog_Correct.Rout
│ │ ├── bnp_monteCarloTest.Rmd
│ │ ├── distributionsTestLog_Correct.Rout
│ │ ├── dynamicIndexingTestLists.R
│ │ ├── dynamicIndexingTestLog_Correct.Rout
│ │ ├── graphStructureTestLog_Correct.Rout
│ │ ├── mathTestLists.R
│ │ ├── mcemTestLog_Correct.Rout
│ │ ├── mcmcTestLog_Correct.Rout
│ │ ├── sizeTestLog_Correct.Rout
│ │ ├── test-ADaghq.R
│ │ ├── test-ADbackSolve.R
│ │ ├── test-ADbasics.R
│ │ ├── test-ADchol.R
│ │ ├── test-ADdists.R
│ │ ├── test-ADdsl.R
│ │ ├── test-ADerrorTrapping.R
│ │ ├── test-ADforwardSolve.R
│ │ ├── test-ADfunctions.R
│ │ ├── test-ADlaplace.R
│ │ ├── test-ADmatInverse.R
│ │ ├── test-ADmatMult.R
│ │ ├── test-ADmatMult_model.R
│ │ ├── test-ADmodels-bigmv.R
│ │ ├── test-ADmodels.R
│ │ ├── test-ADoptim.R
│ │ ├── test-allocation.R
│ │ ├── test-benchmark-building-steps.R
│ │ ├── test-benchmarks.R
│ │ ├── test-bnp.R
│ │ ├── test-car.R
│ │ ├── test-checkDSL.R
│ │ ├── test-copy.R
│ │ ├── test-coreR.R
│ │ ├── test-crossVal.R
│ │ ├── test-declare.R
│ │ ├── test-distributions.R
│ │ ├── test-dsl_dists.R
│ │ ├── test-dynamicIndexing.R
│ │ ├── test-errors.R
│ │ ├── test-expandNodeNames.R
│ │ ├── test-externalCalls.R
│ │ ├── test-getBound.R
│ │ ├── test-getDependencies.R
│ │ ├── test-getDistributionInfo.R
│ │ ├── test-getParam.R
│ │ ├── test-graphStructure.R
│ │ ├── test-initializeModel.R
│ │ ├── test-integrate.R
│ │ ├── test-macros.R
│ │ ├── test-math.R
│ │ ├── test-mcem.R
│ │ ├── test-mcmc.R
│ │ ├── test-mcmcrj.R
│ │ ├── test-misc.R
│ │ ├── test-modelValuesInterface.R
│ │ ├── test-models.R
│ │ ├── test-nimbleFunctionInterfaces.R
│ │ ├── test-nimbleFunctionModelAccess.R
│ │ ├── test-nimbleList.R
│ │ ├── test-nimbleList_RCfun.R
│ │ ├── test-noSMC.R
│ │ ├── test-noncenteredSampler.R
│ │ ├── test-numericTypes.R
│ │ ├── test-optim.R
│ │ ├── test-options.R
│ │ ├── test-parameterTransform.R
│ │ ├── test-polyagamma.R
│ │ ├── test-returnTypeErrorTrapping.R
│ │ ├── test-setData.R
│ │ ├── test-setupMargNodes.R
│ │ ├── test-size.R
│ │ ├── test-testTools.R
│ │ ├── test-trunc.R
│ │ ├── test-user.R
│ │ ├── test-waic.R
│ │ ├── test_utils.R
│ │ ├── truncTestLog_Correct.Rout
│ │ └── userTestLog_Correct.Rout
├── prep_pkg.R
├── solaris
│ ├── config.site
│ ├── config.site_alt
│ ├── pkg.oracle.com.certificate.pem
│ ├── pkg.oracle.com.key.pem
│ └── solaris.sh
├── test
├── test-mcmc-results-v0.3-1
├── test-mcmc-results-v0.4-1
├── test-results-v0.4-1
├── test-results-v0.5
├── test-results-v0.5-1
├── test-results-v0.6
├── test-results-v0.6-1
├── test-results-v0.6-2
├── test-results-v0.6-3
├── test-results-v0.6-4
├── test-results-v0.6-5
├── testNimblePkgBinary
├── test_RW_multinomial.R
├── truncation_changes.txt
└── update_license.R
├── run_tests.R
├── save.travis.yml
├── test_times.csv
└── update_test_times.R
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | ^\.github$
2 |
--------------------------------------------------------------------------------
/.github/.gitignore:
--------------------------------------------------------------------------------
1 | *.html
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # emacs backup files
2 | *~
3 | .Rhistory
4 | .Rapp.history
5 | .Rdata
6 | ignoreWork
7 | .DS*
8 | *.o
9 | *.so
10 | *.dll
11 | *.dylib
12 | *.lnk
13 | *.tar.gz
14 | TEMP*
15 | MyMakevars
16 | #*.R
17 | *.Rproj
18 | .Rproj.user
19 | *.Rproj
20 |
21 | /packages/nimble/inst/CppCode/Makeconf
22 |
23 |
--------------------------------------------------------------------------------
/UserManual/.gitignore:
--------------------------------------------------------------------------------
1 | # tex file versions of Rnw files
2 | NimbleUserManual.tex
3 | MCMC.tex
4 | chapter_*.tex
5 | .Rhistory
6 |
7 | # testing files for Daniel
8 | includesMCMConly*
9 | includesWritingNFsonly*
10 | includes*nly*
11 |
12 | # Latex output files
13 | *.aux
14 | *.out
15 | *.bbl
16 | *.blg
17 | *.log
18 | *.toc
19 | *.bbl
20 | *.blg
21 | figure
22 |
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual.pdf
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/linearRegressionGraph-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/linearRegressionGraph-1.png
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/mcmcPump-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/mcmcPump-1.png
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/mcmcPump-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/mcmcPump-2.png
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/mcmcPump2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/mcmcPump2-1.png
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/mcmcPump2-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/mcmcPump2-2.png
--------------------------------------------------------------------------------
/UserManual/NimbleUserManual_files/figure-html/plotPump-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/NimbleUserManual_files/figure-html/plotPump-1.png
--------------------------------------------------------------------------------
/UserManual/README:
--------------------------------------------------------------------------------
1 | Update version number manually in title.tex.
2 |
3 | To create the PDF version of the manual, go to 'src' and run 'make NimbleUserManual.pdf'.
4 |
5 | To create the HTML version of the manual, go to 'src' and run 'make NimbleUserManual.html'.
6 |
7 | 2022-01-13: I changed the #cha:foo refs to #cha-foo as as of recent bookdown, the ':' is no longer changed to '-' in generating the .html file names, so the rendering would produce file names such as cha:welcome-nimble.html.
--------------------------------------------------------------------------------
/UserManual/nimble-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/UserManual/nimble-icon.png
--------------------------------------------------------------------------------
/UserManual/src/Makefile:
--------------------------------------------------------------------------------
1 | NimbleUserManual.pdf: *Rmd
2 | Rscript -e "bookdown::render_book('index.Rmd', output_format='bookdown::pdf_book')"
3 |
4 | NimbleUserManual.html: *Rmd
5 | Rscript -e "bookdown::render_book('index.Rmd', output_format='bookdown::gitbook')"
6 |
7 | %.Rmd: %.Rnw
8 | Rscript -e "source('latex2Rmd.R'); latex2Rmd(\"$(basename $(@))\")"
9 |
10 | clean:
11 | rm ../bookdown-demo.pdf
12 |
13 |
14 |
--------------------------------------------------------------------------------
/UserManual/src/_bookdown.yml:
--------------------------------------------------------------------------------
1 | book_filename: "NimbleUserManual"
2 | output_dir: ..
3 | language:
4 | ui:
5 | chapter_name: "Chapter "
6 | delete_merged_file: true
7 |
8 | rmd_files: ["index.Rmd", "chapter_WelcomeToNimble.Rmd", "chapter_LightningIntroduction.Rmd", "chapter_MoreIntroduction.Rmd", "chapter_InstallingNimble.Rmd", "chapter_WritingModels.Rmd", "chapter_BuildingModels.Rmd", "chapter_MCMC.Rmd", "chapter_OtherAlgorithms.Rmd", "chapter_Spatial.Rmd", "chapter_BNP.Rmd", "chapter_ProgrammingOverview.Rmd", "chapter_RCfunctions.Rmd", "chapter_UserDefined.Rmd", "chapter_UsingModels.Rmd", "chapter_DataStructures.Rmd", "chapter_WritingNimbleFunctions.Rmd", "chapter_AD.Rmd", "refs.Rmd"]
9 |
10 |
11 |
--------------------------------------------------------------------------------
/UserManual/src/_output.yml:
--------------------------------------------------------------------------------
1 | bookdown::gitbook:
2 | css: style.css
3 | config:
4 | toc:
5 | before: |
6 |
8 |
NIMBLE User Manual, Version 1.3.0
9 | NIMBLE Development Team
10 | https://R-nimble.org
11 | after: |
12 | toc_depth: 3
13 | download: ["pdf", "epub"]
14 | split_bib: no
15 | bookdown::pdf_book:
16 | latex_engine: xelatex
17 | citation_package: natbib
18 | keep_tex: yes
19 | toc_depth: 3
20 | includes:
21 | before_body: title.tex
22 | bookdown::epub_book: default
23 |
24 |
25 |
--------------------------------------------------------------------------------
/UserManual/src/refs.Rmd:
--------------------------------------------------------------------------------
1 | `r if (knitr::is_html_output()) '# References {-}'`
2 |
--------------------------------------------------------------------------------
/UserManual/src/tables/BNPconjugacyTable2.md:
--------------------------------------------------------------------------------
1 | Table: (#tab:BNPconjugacy2) Additional conjugate relationships for the `dCRP` distribution supported by NIMBLE’s MCMC engine.
2 |
3 | Baseline Distribution Mixture (Dependent Node) Distribution Parameter
4 | -------------------------------- ------------------------------------- -----------
5 | Normal-Gamma Normal `mean`, `tau`
6 | Normal-Inverse Gamma Normal `mean`, `var`
7 | Multivariate Normal-Wishart Multivariate Normal `mean`, `prec`
8 | Multivariate Normal-Inverse Wishart Multivariate Normal `mean`, `cov`
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/UserManual/src/tables/densityAliasesTable.md:
--------------------------------------------------------------------------------
1 | Table: (\#tab:densityAliases) Distributions with alternative names (aliases)
2 |
3 | Distribution Canonical name Alias
4 | ------------------- ---------------- -----------
5 | Binomial dbin dbinom
6 | Chi-square dchisq dchisqr
7 | Double exponential ddexp dlaplace
8 | Dirichlet ddirch ddirich
9 | Multinomial dmulti dmultinom
10 | Negative binomial dnegbin dnbinom
11 | Weibull dweib dweibull
12 | Wishart dwish dwishart
13 |
--------------------------------------------------------------------------------
/UserManual/src/tables/eigenSvdTableMatrixAsNimList.md:
--------------------------------------------------------------------------------
1 | `eigen(x)` matrix eigendecomposition; returns a $x$ symmetric yes
2 | nimbleList of type `eigenNimbleList`
3 | `svd(x)` matrix singular value decomposition; yes
4 | returns a nimbleList of type
5 | `svdNimbleList`
6 |
7 |
--------------------------------------------------------------------------------
/UserManual/src/tables/eigenSvdTableMatrixElements.md:
--------------------------------------------------------------------------------
1 | `eigen(x)$values` matrix eigenvalues $x$ symmetric yes
2 | `eigen(x)$vectors` matrix eigenvectors $x$ symmetric yes
3 | `svd(x)$d` matrix singular values yes
4 | `svd(x)$u` matrix left singular vectors yes
5 | `svd(x)$v` matrix right singular vectors yes
6 |
7 |
--------------------------------------------------------------------------------
/UserManual/src/tables/linksTable.md:
--------------------------------------------------------------------------------
1 | Table: (\#tab:links) Link functions.
2 |
3 | Link function Description Range Inverse
4 | ----------------- --------------------- ----------- ------------------
5 | `cloglog(y) <- x` Complementary log log $0 < y < 1$ `y <- icloglog(x)`
6 | `log(y) <- x` Log $0 < y$ `y <- exp(x)`
7 | `logit(y) <- x` Logit $0 < y < 1$ `y <- expit(x)`
8 | `probit(y) <- x` Probit $0 < y < 1$ `y <- iprobit(x)`
9 |
--------------------------------------------------------------------------------
/UserManual/src/title.tex:
--------------------------------------------------------------------------------
1 | \thispagestyle{empty}
2 | \begin{center}
3 | {\huge NIMBLE User Manual}\\
4 | \vspace{0.2in}
5 | {\large NIMBLE Development Team}\\
6 | \vspace{0.2in}
7 | {\large Version 1.3.0}\\
8 | \vspace{3in}
9 | \includegraphics[width=1.5in]{../nimble-icon.png}\\
10 | {\large
11 | \href{https://r-nimble.org}{https://r-nimble.org}\\
12 | \href{https://github.com/nimble-dev/nimble}{https://github.com/nimble-dev/nimble}
13 | }
14 | \end{center}
15 |
16 |
--------------------------------------------------------------------------------
/install_revDeps.R:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env Rscript
2 |
3 | revDeps <- c(
4 | 'nimbleSMC'
5 | )
6 |
7 |
8 | ## Note that if don't specify repos, the RStudio repo seems to install from
9 | ## Linux binary (that is what the .tar.gz is?) and doesn't install tests.
10 | for (package in revDeps) {
11 | install.packages(package, type = 'source', INSTALL_opts = '--install-tests', repos = 'https://cran.r-project.org')
12 | }
13 | print(list.files(system.file('tests','testthat', package='nimbleSMC')))
14 | print(list.files(system.file('', package='nimbleSMC')))
15 |
16 |
17 |
--------------------------------------------------------------------------------
/notes/bnp_ModelsAndSamplers.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/notes/bnp_ModelsAndSamplers.pdf
--------------------------------------------------------------------------------
/packages/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: Google
2 | Standard: Cpp03
3 |
--------------------------------------------------------------------------------
/packages/.gitignore:
--------------------------------------------------------------------------------
1 | # don't include built package
2 | *.tar.gz
3 | *.zip
4 | *.tgz
5 |
6 | # don't include object files
7 | *.o
8 | *.so
9 |
10 | MyMakevars
11 | #Eigen*
12 | Eigen_local*
13 |
14 | config.*
15 | *.Rproj
16 | profile/
17 |
--------------------------------------------------------------------------------
/packages/Laplace-examples/pump/pumpTMB.R:
--------------------------------------------------------------------------------
1 | library(TMB)
2 | compile("pumpTMB.cpp")
3 | dyn.load(dynlib("pumpTMB"))
4 |
5 | ## Read data
6 | N <- 10
7 | t <- c(94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5)
8 | X <- c(5, 1, 5, 14, 3, 19, 1, 1, 4, 22)
9 |
10 | data <- list(X = X, t = t)
11 | parameters <- list(u = rep(log(0.1), N), alphat = log(0.1), betat = log(0.1))
12 |
13 | ## Fit model
14 | obj <- MakeADFun(data, parameters, random="u", DLL="pumpTMB")
15 | tmbtime <- system.time(tmbres <- nlminb(obj$par, obj$fn, obj$gr))
16 | ## Back transform model parameters
17 | tmbres$par <- exp(tmbres$par)
18 | names(tmbres$par) <- c("alpha", "beta")
19 | ## Return standard errors
20 | tmbsumm <- summary(sdreport(obj), select = "report")
21 |
--------------------------------------------------------------------------------
/packages/Laplace-examples/pump/pumpTMB.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | template
3 | Type objective_function::operator() ()
4 | {
5 | DATA_VECTOR(X);
6 | DATA_VECTOR(t);
7 | PARAMETER_VECTOR(u);
8 | PARAMETER(alphat);
9 | PARAMETER(betat);
10 |
11 | int N = X.size();
12 | Type ans=0;
13 | vector lambda(N);
14 | // exp transformation for original random effects
15 | vector theta = exp(u);
16 | Type alpha = exp(alphat);
17 | Type beta = exp(betat);
18 |
19 | // Negative log-likelihood
20 | for(int i = 0; i < N; i++){
21 | ans -= dgamma(theta[i], alpha, 1/beta, true);
22 | lambda[i] = theta[i] * t[i];
23 | ans -= dpois(X[i], lambda[i], true) + u[i];
24 | }
25 |
26 | // REPORT(u);
27 | // REPORT(ans);
28 | ADREPORT(alpha);
29 | ADREPORT(beta);
30 | ADREPORT(theta);
31 |
32 | return ans;
33 | }
34 |
--------------------------------------------------------------------------------
/packages/Laplace-examples/spatial/spatialTMB.R:
--------------------------------------------------------------------------------
1 | library(TMB)
2 | compile("spatial.cpp")
3 | dyn.load(dynlib("spatial"))
4 | ## Read data
5 | source("spatial_data.R")
6 |
7 | ## Euclidian distance matrix
8 | dd <- as.matrix(dist(Z))
9 | ## Make AD functions
10 | obj <- MakeADFun(data = list(n=100, y=y, X=X, dd=dd),
11 | parameters=list(
12 | b = c(1,1),
13 | log_a = log(2), #1.428571,
14 | log_sigma = -1 ,#-0.6931472,
15 | u = rep(1,n)),
16 | DLL = "spatial",
17 | random = "u",
18 | silent = TRUE
19 | )
20 | tmbtime <- system.time(tmbres <- nlminb(obj$par, obj$fn, obj$gr))
21 | tmbtime2 <- system.time(tmbsumm <- summary(sdreport(obj)))
22 |
--------------------------------------------------------------------------------
/packages/Laplace-examples/state-space/thetalog.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | template
3 | Type objective_function::operator() ()
4 | {
5 | DATA_VECTOR(y);
6 | PARAMETER_VECTOR(u);
7 | PARAMETER(logr0); Type r0 = exp(logr0);
8 | PARAMETER(logpsi); Type psi = exp(logpsi);
9 | PARAMETER(logK); Type K = exp(logK);
10 | PARAMETER(logQ); Type Q = exp(logQ);
11 | PARAMETER(logR); Type R = exp(logR);
12 |
13 | int n = y.size();
14 | Type f = 0;
15 | for(int t = 1; t < n; t++){
16 | Type mean = u[t-1] + r0 * (1 - pow(exp(u[t-1])/K, psi));
17 | f -= dnorm(u[t], mean, sqrt(Q), true);
18 | }
19 |
20 | for(int t = 0; t < n; t++){
21 | f -= dnorm(y[t], u[t], sqrt(R), true);
22 | }
23 |
24 | REPORT(f);
25 | REPORT(u);
26 | return f;
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/packages/Laplace-examples/state-space/thetalogTMB.R:
--------------------------------------------------------------------------------
1 | library(TMB)
2 | compile("thetalog.cpp")
3 | dyn.load(dynlib("thetalog"))
4 |
5 | ## Read data
6 | y <- scan("thetalog.dat", skip=3, quiet=TRUE)
7 | data <- list(y=y)
8 |
9 | ## Parameter initial guess
10 | parameters <- list(
11 | u = data$y * 0,
12 | logr0 = 0,
13 | logpsi = 0,
14 | logK = 6,
15 | logQ = 0,
16 | logR = 0
17 | )
18 |
19 | ## Fit model
20 | obj <- MakeADFun(data, parameters, random="u", DLL="thetalog")
21 | tmbtime <- system.time(tmbres <- nlminb(obj$par-1, obj$fn, obj$gr))
22 | tmbtime2 <- system.time(tmbsumm <- summary(sdreport(obj)))
23 |
--------------------------------------------------------------------------------
/packages/MyMakevars_template:
--------------------------------------------------------------------------------
1 | NIMBLE_PKG_DIR=C:/Users/duncantl/Nimble Windows/nimble/packages
2 | PKG_CPPFLAGS=-I"$(NIMBLE_PKG_DIR)/nimble/inst/include" -I"$(NIMBLE_PKG_DIR)/nimble"
3 | PKG_LIBS=-lRlapack -lRblas
4 |
--------------------------------------------------------------------------------
/packages/TOFIX:
--------------------------------------------------------------------------------
1 | Fix the Windows part in cppDefs_cppProject.R
2 | shortDirname = dirname(shortPathName(sprintf("%s/%s", NimbleCodeDir(), cppPermList[1])))
3 |
4 |
5 | Consolidate inst/make/Makevars.in and inst/make/Makevars_lib.in to just one file now that in both cases we are linking agains libnimble (.a and .so/.dylib)
--------------------------------------------------------------------------------
/packages/benchmark.R:
--------------------------------------------------------------------------------
1 | library(methods)
2 | library(testthat)
3 | suppressPackageStartupMessages(library(nimble))
4 | test_package("nimble", "^benchmarks$")
5 |
--------------------------------------------------------------------------------
/packages/nimble/.Rbuildignore:
--------------------------------------------------------------------------------
1 | .*\\.o$
2 | .*\\.so$
3 | .*\\.a$
4 | \.dylib$
5 | \\.git
6 | \\.gitignore$
7 | src/Makevars$
8 | inst/Makevars$
9 | NOT_IN_TARBALL$
10 | ^.*\.Rproj$
11 | ^\.Rproj\.user$
12 | ^appveyor\.yml$
13 |
--------------------------------------------------------------------------------
/packages/nimble/LICENSE:
--------------------------------------------------------------------------------
1 | YEAR: 2024
2 | COPYRIGHT HOLDER: Perry de Valpine, Christopher Paciorek, Daniel Turek, Clifford Anderson-Bergman, Nick Michaud, Fritz Obermeyer, Claudia Wehrhahn Cortes, Abel Rodriguez, Sally Paganin, Wei Zhang, Paul van Dam-Bates, Duncan Temple Lang
3 | ORGANIZATION: University of California
4 |
--------------------------------------------------------------------------------
/packages/nimble/NOT_IN_TARBALL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/packages/nimble/NOT_IN_TARBALL
--------------------------------------------------------------------------------
/packages/nimble/R/.gitignore:
--------------------------------------------------------------------------------
1 | config.R
2 | Makevars
3 | .Rapp.history
4 | TEMP*
5 | TAGS
6 |
--------------------------------------------------------------------------------
/packages/nimble/R/config.R.in:
--------------------------------------------------------------------------------
1 | NeedMakevarsFile = @NEED_MAKEVARS_FILE@
2 | UseLibraryMakevars = @R_ENABLE_LIB@
3 | @USE_REGISTRATION@
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/nimble/R/nimble-package.r:
--------------------------------------------------------------------------------
1 | #' @keywords internal
2 | "_PACKAGE"
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/nimble/R/registration.R:
--------------------------------------------------------------------------------
1 |
2 | if(!exists('.NimbleUseRegistration') || !.NimbleUseRegistration) {
3 | message('Error: C function registrations are not set up correctly.')
4 | }
5 |
--------------------------------------------------------------------------------
/packages/nimble/R/types_modelVariableAccessor.R:
--------------------------------------------------------------------------------
1 |
2 | ## CASE 2: modelVariableAccessorVector
3 | ## copy(model1, xxx, nodes) becomes:
4 | ## model1_nodes_accessors <- modelVariableAccessorVector(model1, nodes)
5 | ## copy(model1_nodes_accessors, xxx)
6 | ## model1_nodes_accessors$getAccessors() returns a list of the modelVariableAccessor objects
7 |
8 |
9 | modelVariableAccessorVector <- function(mv, nodeNames, logProb = FALSE, logProbOnly = FALSE) {
10 | ans <- list(mv, substitute(nodeNames), logProb | logProbOnly, parent.frame(), logProbOnly)
11 | class(ans) <- c('modelVariableAccessorVector', 'valuesAccessorVector')
12 | ans
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/cleanup:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | FILES=`cd inst/CppCode; ls *.cpp`
4 |
5 | for f in $FILES ; do
6 | if test -e src/$f; then
7 | echo "src/$f"
8 | rm src/$f
9 | fi
10 | done
11 |
12 | (cd inst/CppCode ; make clean)
13 | #(cd src ; rm *.o)
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/packages/nimble/cleanup.win:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | FILES=`cd inst/CppCode; ls *.cpp`
4 |
5 | for f in $FILES ; do
6 | if test -e src/$f; then
7 | echo "src/$f"
8 | rm src/$f
9 | fi
10 | done
11 |
12 | (cd inst/CppCode ; make clean; rm *.a)
13 | (cd src ; rm *.dll)
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/CppCode/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.so
3 | *.dylib
4 | Makevars
5 | libnimble.a
6 | libnimble_x64.a
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/CppCode/GNUmakefile_customizeMakeconf:
--------------------------------------------------------------------------------
1 | localMakeconf:
2 | $(R_HOME)/bin$(R_ARCH)/Rscript --vanilla ./customizeMakeconf.R
3 |
4 | clean:
5 | -rm -f Makeconf
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/CppCode/Makevars.in:
--------------------------------------------------------------------------------
1 | PKG_CPPFLAGS= -DR_NO_REMAP -I"../include" @EIGEN_INC@
2 |
--------------------------------------------------------------------------------
/packages/nimble/inst/CppCode/customizeMakeconf.R:
--------------------------------------------------------------------------------
1 | packageMakeconfFile <- file.path(R.home('etc'), 'Makeconf')
2 | if(file.exists(packageMakeconfFile)) {
3 | file.copy(packageMakeconfFile, 'Makeconf')
4 | lines <- readLines('Makeconf')
5 | lines <- gsub('-g ', ' ', lines)
6 | writeLines(lines, con = 'Makeconf')
7 | }
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/CppCode/removeCustomizedMakeconf.R:
--------------------------------------------------------------------------------
1 | if(file.exists('Makeconf')) {
2 | file.remove('Makeconf')
3 | }
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/LICENSE:
--------------------------------------------------------------------------------
1 | The material in this directory (apart from other/dipper) was obtained from the examples material of JAGS version 3, licensed under the GPL version 2 and MIT licenses.
2 |
3 | https://sourceforge.net/projects/mcmc-jags/files/
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/R/Rcheck.R:
--------------------------------------------------------------------------------
1 | library(rjags, quietly=TRUE)
2 |
3 | read.jagsdata <- function(file)
4 | {
5 | e <- new.env()
6 | eval(parse(file), e)
7 | return(as.list(e))
8 | }
9 |
10 | check.fun <- function() {
11 | checkstats <- summary(x)$statistics
12 | if (is.matrix(benchstats)) {
13 | rnb <- order(rownames(benchstats))
14 | rnc <- order(rownames(checkstats))
15 | z <- (benchstats[rnb,1] - checkstats[rnc,1])
16 | z <- ifelse(z==0, 0, z/benchstats[rnb,2])
17 | } else {
18 | z <- (benchstats[1] - checkstats[1])
19 | z <- ifelse(z==0, 0, z/benchstats[2])
20 | }
21 | print(z)
22 | if (any(abs(z) > 0.15)) {
23 | stop("FAIL")
24 | quit(save="no", status=1)
25 | } else {
26 | cat("OK\n")
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/R/bench.R:
--------------------------------------------------------------------------------
1 | library(coda)
2 | x <- read.openbugs(quiet=TRUE)
3 | benchstats <- summary(x)$statistics
4 | dump("benchstats", file=benchfile)
5 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/R/check.R:
--------------------------------------------------------------------------------
1 | library(coda, quietly=TRUE)
2 | x <- read.openbugs(quiet=TRUE)
3 | checkstats <- summary(x)$statistics
4 | if (is.matrix(benchstats)) {
5 | rnb <- order(rownames(benchstats))
6 | rnc <- order(rownames(checkstats))
7 | z <- (benchstats[rnb,1] - checkstats[rnc,1])
8 | z <- ifelse(z==0, 0, z/benchstats[rnb,2])
9 | } else {
10 | z <- (benchstats[1] - checkstats[1])
11 | z <- ifelse(z==0, 0, z/benchstats[2])
12 | }
13 | print(z)
14 | q(status=(any(abs(z) > 0.15)))
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/other/dipper/dipper.bug:
--------------------------------------------------------------------------------
1 | model {
2 |
3 | phi ~ dunif(0,1)
4 | p ~ dunif(0,1)
5 |
6 | for(i in 1:nind) {
7 |
8 | x[i, first[i]] <- 1
9 |
10 | for(t in (first[i]+1):k) {
11 | mu.x[i,t] <- phi * x[i,t-1]
12 | mu.y[i,t] <- p * x[i,t]
13 | x[i,t] ~ dbin(mu.x[i,t], 1)
14 | y[i,t] ~ dbin(mu.y[i,t], 1)
15 | }
16 |
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/ReadMe:
--------------------------------------------------------------------------------
1 | There are no benchmarks for blockert.bug and blockht.bug because
2 | of the difficulty in getting stable estimates of the posterior
3 | variance for d.
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.253224633406667, -0.254799456117667, 0.115400764300000,
3 | 0.0597799345822366, 0.143834428983032, 0.0683470040191467, 0.00109142728856247,
4 | 0.00262604537666272, 0.00124783986130610, 0.00144641385932831,
5 | 0.00275380793262567, 0.00204171850594970), .Dim = as.integer(c(3,
6 | 4)), .Dimnames = list(c("d", "delta.new", "sigma"), c("Mean",
7 | "SD", "Naive SE", "Time-series SE")))
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.23204102101, -0.263648382132, 0.185695176100,
3 | 0.104203323304632, 0.566292620568805, 0.119054449455133, 0.00329519841401541,
4 | 0.0179077450314294, 0.00376483225855613, 0.00340734497609960,
5 | 0.0176326420872072, 0.0039840930701565), .Dim = as.integer(c(3,
6 | 4)), .Dimnames = list(c("d", "delta.new", "sigma"), c("Mean",
7 | "SD", "Naive SE", "Time-series SE")))
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/bench-test3.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.240132002598000, -0.245208930790601, 0.73370635672,
3 | 0.257287216245156, 1.17803384757472, 0.872850799145309, 0.00363859070639119,
4 | 0.0166599144417473, 0.0123439743807949, 0.00431558173652028,
5 | 0.0170285034618671, 0.0152254432668114), .Dim = as.integer(c(3,
6 | 4)), .Dimnames = list(c("d", "delta.new", "sigma"), c("Mean",
7 | "SD", "Naive SE", "Time-series SE")))
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blocker-data.R:
--------------------------------------------------------------------------------
1 | "rt" <-
2 | c(3, 7, 5, 102, 28, 4, 98, 60, 25, 138, 64, 45, 9, 57, 25, 33,
3 | 28, 8, 6, 32, 27, 22)
4 | "nt" <-
5 | c(38, 114, 69, 1533, 355, 59, 945, 632, 278, 1916, 873, 263,
6 | 291, 858, 154, 207, 251, 151, 174, 209, 391, 680)
7 | "rc" <-
8 | c(3, 14, 11, 127, 27, 6, 152, 48, 37, 188, 52, 47, 16, 45, 31,
9 | 38, 12, 6, 3, 40, 43, 39)
10 | "nc" <-
11 | c(39, 116, 93, 1520, 365, 52, 939, 471, 282, 1921, 583, 266,
12 | 293, 883, 147, 213, 122, 154, 134, 218, 364, 674)
13 | "Num" <-
14 | 22
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blocker-init.R:
--------------------------------------------------------------------------------
1 | "d" <-
2 | 0
3 | "delta.new" <-
4 | 0
5 | "tau" <-
6 | 1
7 | "mu" <-
8 | c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9 | 0, 0)
10 | "delta" <-
11 | c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12 | 0, 0)
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blocker.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:Num) {
3 | rt[i] ~ dbin(pt[i], nt[i]);
4 | rc[i] ~ dbin(pc[i], nc[i]);
5 | logit(pc[i]) <- mu[i]
6 | logit(pt[i]) <- mu[i] + delta[i];
7 | delta[i] ~ dnorm(d, tau);
8 | mu[i] ~ dnorm(0.0, 1.0E-5);
9 | }
10 | d ~ dnorm(0.0, 1.0E-6);
11 | tau ~ dgamma(1.0E-3, 1.0E-3);
12 | delta.new ~ dnorm(d,tau);
13 | sigma <- 1/sqrt(tau);
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blockert-init.R:
--------------------------------------------------------------------------------
1 | "d" <-
2 | 0
3 | "tau" <-
4 | 1
5 | "mu" <-
6 | c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7 | 0, 0)
8 | "delta" <-
9 | c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
10 | 0, 0)
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blockert.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:Num) {
3 | rt[i] ~ dbin(pt[i], nt[i]);
4 | rc[i] ~ dbin(pc[i], nc[i]);
5 | logit(pc[i]) <- mu[i];
6 | logit(pt[i]) <- mu[i] + delta[i];
7 | delta[i] ~ dt(d, tau, 4);
8 | mu[i] ~ dnorm(0.0, 1.0E-5);
9 | }
10 | d ~ dnorm(0.0, 1.0E-6);
11 | delta.new ~ dt(d, tau, 4);
12 | tau ~ dgamma(1.0E-3, 1.0E-3);
13 | sigma <- sqrt(1/(tau*2)); # SD of t distribution on 4 degrees of freedom
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blockht-data.R:
--------------------------------------------------------------------------------
1 | "rt" <-
2 | c(3, 7, 5, 102, 28, 4, 98, 60, 25, 138, 64, 45, 9, 57, 25, 33,
3 | 28, 8, 6, 32, 27, 22)
4 | "nt" <-
5 | c(38, 114, 69, 1533, 355, 59, 945, 632, 278, 1916, 873, 263,
6 | 291, 858, 154, 207, 251, 151, 174, 209, 391, 680)
7 | "rc" <-
8 | c(3, 14, 11, 127, 27, 6, 152, 48, 37, 188, 52, 47, 16, 45, 31,
9 | 38, 12, 6, 3, 40, 43, 39)
10 | "nc" <-
11 | c(39, 116, 93, 1520, 365, 52, 939, 471, 282, 1921, 583, 266,
12 | 293, 883, 147, 213, 122, 154, 134, 218, 364, 674)
13 | "Num" <-
14 | 22
15 | "Nbins" <-
16 | 10
17 | "eta" <-
18 | c(2,4,6,8,10,12,15,20,30,50)
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/blockht.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:Num) {
3 | rt[i] ~ dbin(pt[i],nt[i]);
4 | rc[i] ~ dbin(pc[i],nc[i]);
5 | logit(pc[i]) <- mu[i];
6 | logit(pt[i]) <- mu[i] + delta[i];
7 | delta[i] ~ dt(d,tau,v);
8 | mu[i] ~ dnorm(0.0, 1.0E-5);
9 | }
10 | delta.new ~ dt(d,tau,v);
11 | d ~ dnorm(0.0,1.0E-6);
12 | tau ~ dgamma(1.0E-3,1.0E-3);
13 | sigma <- 1/sqrt(tau);
14 |
15 | for (n in 1:Nbins) {
16 | prior[n] <- 1/Nbins; # Uniform prior on v
17 | }
18 | k ~ dcat(prior[]);
19 | v <- eta[k]; # degrees of freedom for t
20 | }
21 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/notest2.cmd:
--------------------------------------------------------------------------------
1 | /* blocker example with t-distribution for treatment effect */
2 | model in blockert.bug
3 | data in blocker-data.R
4 | compile, nchains(2)
5 | parameters in blockert-init.R
6 | initialize
7 | update 1000
8 | monitor d, thin(10)
9 | monitor delta.new, thin(10)
10 | monitor sigma, thin(10)
11 | update 10000
12 | coda *
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/notest3.cmd:
--------------------------------------------------------------------------------
1 | model in blockht.bug
2 | data in blockht-data.R
3 | compile, nchains(2)
4 | parameters in blocker-init.R
5 | initialize
6 | update 1000
7 | monitor d
8 | monitor delta.new
9 | monitor sigma
10 | update 50000
11 | coda *
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | data <- read.jagsdata("blocker-data.R")
4 | inits <- read.jagsdata("blocker-init.R")
5 | m <- jags.model("blocker.bug", data, inits, n.chains = 2)
6 | update(m, 3000)
7 | x <- coda.samples(m, c("d","delta.new","sigma"), n.iter=30000, thin=10)
8 | source("bench-test1.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/blocker/test1.cmd:
--------------------------------------------------------------------------------
1 | model in blocker.bug
2 | data in blocker-data.R
3 | load glm
4 | compile, nchains(2)
5 | parameters in blocker-init.R
6 | initialize
7 | update 3000
8 | monitor d, thin(10)
9 | monitor delta.new, thin(10)
10 | monitor sigma, thin(10)
11 | update 30000
12 | coda *
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/bones/bones.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:nChild) {
3 | theta[i] ~ dnorm(0.0, 0.001);
4 |
5 | for (j in 1:nInd) {
6 | # Cumulative probability of > grade k given theta
7 | for (k in 1:(ncat[j]-1)) {
8 | logit(Q[i,j,k]) <- delta[j]*(theta[i] - gamma[j,k]);
9 | }
10 | Q[i,j,ncat[j]] <- 0;
11 | }
12 |
13 | for (j in 1:nInd) {
14 | # Probability of observing grade k given theta
15 | p[i,j,1] <- 1 - Q[i,j,1];
16 | for (k in 2:ncat[j]) {
17 | p[i,j,k] <- Q[i,j,(k-1)] - Q[i,j,k];
18 | }
19 | grade[i,j] ~ dcat(p[i,j,1:ncat[j]]);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/bones/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("bones-data.R")
3 | m <- jags.model("bones.bug", data, n.chains=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("theta"), n.iter=10000)
6 | source("bench-test1.R")
7 | check.fun()
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/bones/test1.cmd:
--------------------------------------------------------------------------------
1 | model in bones.bug
2 | data in bones-data.R
3 | compile, nchains(2)
4 | parameters in bones-init.R
5 | initialize
6 | update 1000
7 | monitor theta
8 | update 10000
9 | coda theta
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(1527.56852, 3042.44997500001, 2167.10592327016, 0.334602909528699,
3 | 21.3952772745395, 1066.22807536413, 3108.27390518326, 0.241399354005255,
4 | 0.478412943833268, 23.8415845603296, 69.503117446785, 0.00539785365280285,
5 | 0.518994073152718, 27.2796486124696, 71.8877553203144, 0.0065916991537614
6 | ), .Dim = as.integer(c(4, 4)), .Dimnames = list(c("theta", "sigma2.within",
7 | "sigma2.between", "f.between"), c("Mean", "SD", "Naive SE", "Time-series SE"
8 | )))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/dyes-data.R:
--------------------------------------------------------------------------------
1 | "y" <-
2 | structure(c(1545, 1540, 1595, 1445, 1595, 1520, 1440, 1555, 1550,
3 | 1440, 1630, 1455, 1440, 1490, 1605, 1595, 1515, 1450, 1520, 1560,
4 | 1510, 1465, 1635, 1480, 1580, 1495, 1560, 1545, 1625, 1445), .Dim = c(6,
5 | 5))
6 | "BATCHES" <-
7 | 6
8 | "SAMPLES" <-
9 | 5
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/dyes-init.R:
--------------------------------------------------------------------------------
1 | "theta" <- 1500
2 | "tau.within" <- 1
3 | "tau.between" <- 1
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/dyes.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:BATCHES) {
3 | for (j in 1:SAMPLES) {
4 | y[i,j] ~ dnorm(mu[i], tau.within);
5 | }
6 | mu[i] ~ dnorm(theta, tau.between);
7 | }
8 |
9 | theta ~ dnorm(0.0, 1.0E-10);
10 | tau.within ~ dgamma(0.001, 0.001); sigma2.within <- 1/tau.within;
11 | tau.between ~ dgamma(0.001, 0.001); sigma2.between <- 1/tau.between;
12 |
13 | sigma2.total <- sigma2.within + sigma2.between;
14 | f.within <- sigma2.within/sigma2.total;
15 | f.between <- sigma2.between/sigma2.total;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("dyes-data.R")
3 | m <- jags.model("dyes.bug", data, n.chains=2)
4 | update(m, 5000)
5 | x <- coda.samples(m, c("theta","sigma2.within","sigma2.between","f.between"),
6 | n.iter=100000, thin=50)
7 | source("bench-test1.R")
8 | check.fun()
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/dyes/test1.cmd:
--------------------------------------------------------------------------------
1 | model in dyes.bug
2 | data in dyes-data.R
3 | compile, nchains(2)
4 | parameters in dyes-init.R
5 | initialize
6 | update 5000
7 | monitor theta, thin(50)
8 | monitor sigma2.within, thin(50)
9 | monitor sigma2.between, thin(50)
10 | monitor f.between, thin(50)
11 | update 100000
12 | coda *
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/bench-test1.R:
--------------------------------------------------------------------------------
1 | benchstats <-
2 | structure(c(-1.3364843048965, 0.8857548235, -0.948221539745,
3 | 0.3409922147826, 0.483523797157, -0.166734238845, 0.542756667,
4 | 1.27772876176106, 0.137639803798128, 0.427066653443961, 0.219644174354971,
5 | 0.377201177302070, 0.0548238742472561, 0.0660601784258409, 0.0285708836810436,
6 | 0.00307771957702348, 0.00954950068024042, 0.0049113930471953,
7 | 0.0084344747364038, 0.00122589909606765, 0.00147715049565945,
8 | 0.0306373037254135, 0.00301569343090085, 0.0119995305179986,
9 | 0.00559785083353585, 0.00902764024983775, 0.00188271237213285,
10 | 0.00214224408183078), .Dim = c(7L, 4L), .Dimnames = list(c("alpha0",
11 | "alpha.Base", "alpha.Trt", "alpha.BT", "alpha.Age", "alpha.V4",
12 | "sigma.b1"), c("Mean", "SD", "Naive SE", "Time-series SE")))
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/bench-test2.R:
--------------------------------------------------------------------------------
1 | benchstats <-
2 | structure(c(-1.37189672981, 0.8736528925, -0.9605229726, 0.355106918969,
3 | 0.479617611166, -0.1013694932506, 0.499196704, 0.3629548375,
4 | 1.24596963892823, 0.139269373665539, 0.42677791506752, 0.217604463793377,
5 | 0.363695771040492, 0.0875368695485932, 0.0715217646809272, 0.044228441996263,
6 | 0.0278607281054439, 0.00311415786699964, 0.00954304429386607,
7 | 0.00486578373249383, 0.0081324846717574, 0.00195738390848186,
8 | 0.00159927527697297, 0.000988978028425506, 0.0290481340303291,
9 | 0.00321706133553644, 0.00999669190698694, 0.00526391236992741,
10 | 0.00855921171217479, 0.00239996464569182, 0.00192372054467975,
11 | 0.00145567919667494), .Dim = c(8L, 4L), .Dimnames = list(c("alpha0",
12 | "alpha.Base", "alpha.Trt", "alpha.BT", "alpha.Age", "alpha.V4",
13 | "sigma.b1", "sigma.b"), c("Mean", "SD", "Naive SE", "Time-series SE"
14 | )))
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/epil-inits.R:
--------------------------------------------------------------------------------
1 | "alpha0" <-
2 | 1
3 | "alpha.Base" <-
4 | 0
5 | "alpha.Trt" <-
6 | 0
7 | "alpha.BT" <-
8 | 0
9 | "alpha.Age" <-
10 | 0
11 | "alpha.V4" <-
12 | 0
13 | "tau.b1" <-
14 | 1
15 | "tau.b" <-
16 | 1
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | m <- jags.model("epil2.bug", data=read.data("epil-data.R"), n.chains=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("alpha0", "alpha.Base", "alpha.Trt", "alpha.BT",
6 | "alpha.Age", "alpha.V4", "sigma.b1"), n.iter=5000,
7 | thin=5)
8 | source("bench-test1.R")
9 | check.fun()
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "epil2.bug"
2 | data in epil-data.R
3 | load glm
4 | compile, nchains(2)
5 | inits in epil-inits.R
6 | initialize
7 | update 1000
8 | monitor alpha0, thin(5)
9 | monitor alpha.Base, thin(5)
10 | monitor alpha.Trt, thin(5)
11 | monitor alpha.BT, thin(5)
12 | monitor alpha.Age, thin(5)
13 | monitor alpha.V4, thin(5)
14 | monitor sigma.b1, thin(5)
15 | update 5000
16 | coda *
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | m <- jags.model("epil3.bug", data=read.data("epil-data.R"), n.chains=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("alpha0", "alpha.Base", "alpha.Trt", "alpha.BT",
6 | "alpha.Age", "alpha.V4", "sigma.b1", "sigma.b"),
7 | n.iter=10000, thin=10)
8 | source("bench-test2.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/epil/test2.cmd:
--------------------------------------------------------------------------------
1 | model in epil3.bug
2 | data in epil-data.R
3 | load glm
4 | compile, nchains(2)
5 | inits in epil-inits.R
6 | initialize
7 | update 1000
8 | monitor alpha0, thin(10)
9 | monitor alpha.Base, thin(10)
10 | monitor alpha.Trt, thin(10)
11 | monitor alpha.BT, thin(10)
12 | monitor alpha.Age, thin(10)
13 | monitor alpha.V4, thin(10)
14 | monitor sigma.b1, thin(10)
15 | monitor sigma.b, thin(10)
16 | update 10000
17 | coda *
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/ReadMe:
--------------------------------------------------------------------------------
1 | It is not currently possible to do the tranformed version of the EQUIV
2 | model in JAGS, since it uses a symmetric order constraint, namely
3 |
4 | tau[1] ~ dgamma(0.001, 0.001) I(tau[3],);
5 | tau[3] ~ dgamma(0.001, 0.001) I(,tau[1]);
6 |
7 | This construction is not allowed in JAGS because it creates a directed
8 | cycle in the model.
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.9940944383, 0.9985, 0.107993561989999, 0.140971934020000,
3 | 0.0503853244807424, 0.038702710369934, 0.0318072686978664, 0.0522499033983419,
4 | 0.000503853244807424, 0.00038702710369934, 0.000318072686978664,
5 | 0.000522499033983419, 0.000496560273546467, 0.000386045689209867,
6 | 0.000546941378452105, 0.000806677796773217), .Dim = as.integer(c(4,
7 | 4)), .Dimnames = list(c("theta", "equivalence", "sigma[1]", "sigma[2]"
8 | ), c("Mean", "SD", "Naive SE", "Time-series SE")))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.9792509085, 0.985, 0.137716297340000, 0.123616081710000,
3 | 1.37818835210000, 1.56343460819999, 1.4338874202, 0.0726088470261219,
4 | 0.121558535890182, 0.0430866436963967, 0.0593885108107869, 0.191581993694522,
5 | 0.186234532854242, 0.203312014471999, 0.000726088470261219, 0.00121558535890182,
6 | 0.000430866436963967, 0.000593885108107869, 0.00191581993694522,
7 | 0.00186234532854242, 0.00203312014471999, 0.000823965642919049,
8 | 0.00131637436275614, 0.000720241017507236, 0.00100258690820864,
9 | 0.00216617370586762, 0.00205346443299852, 0.00258485093374419
10 | ), .Dim = as.integer(c(7, 4)), .Dimnames = list(c("theta", "equivalence",
11 | "sigma[1]", "sigma[2]", "Y[1,1]", "Y[3,2]", "Y[6,2]"), c("Mean",
12 | "SD", "Naive SE", "Time-series SE")))
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/equiv-data.R:
--------------------------------------------------------------------------------
1 | "Y" <-
2 | structure(c(1.4, 1.64, 1.44, 1.36, 1.65, 1.08, 1.09, 1.25, 1.25,
3 | 1.3, 1.65, 1.57, 1.58, 1.68, 1.69, 1.31, 1.43, 1.44, 1.39, 1.52
4 | ), .Dim = c(10, 2))
5 | "group" <-
6 | c(1, 1, -1, -1, -1, 1, 1, 1, -1, -1)
7 | "N" <- 10
8 | "T" <- 2
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/equiv-init.R:
--------------------------------------------------------------------------------
1 | "mu" <- 0
2 | "phi" <- 0
3 | "pi" <- 0
4 | "tau" <- c(1,1)
5 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/equiv.bug:
--------------------------------------------------------------------------------
1 | model {
2 | # Original model
3 | for (i in 1:N) {
4 | d[i] ~ dnorm(0,tau[2]); # Subject random effect
5 | for (k in 1:2){
6 | Treat[i,k] <- group[i]*(k-1.5) + 1.5; # treatment given
7 | Y[i,k] ~ dnorm(m[i,k], tau[1]);
8 | m[i,k] <- mu + pow(-1, Treat[i,k]-1)* phi /2
9 | + pow(-1, k-1)* pi /2 + d[i];
10 | }
11 | }
12 | tau[1] ~ dgamma(0.001, 0.001);
13 | tau[2] ~ dgamma(0.001, 0.001);
14 | sigma[1] <- sqrt(1/tau[1]);
15 | sigma[2] <- sqrt(1/tau[2]);
16 |
17 | pi ~ dnorm(0, 1.0E-06);
18 | phi ~ dnorm(0, 1.0E-06);
19 | mu ~ dnorm(0, 1.0E-06);
20 | theta <- exp(phi);
21 | # Indicate whether 0.8 < theta < 1.2
22 | equivalence <- step(theta - 0.8) - step(theta - 1.2);
23 | }
24 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/equivmiss-data.R:
--------------------------------------------------------------------------------
1 | "Y" <-
2 | structure(c(NA, 1.64, 1.44, 1.36, 1.65, 1.08, 1.09, 1.25, 1.25,
3 | 1.3, 1.65, 1.57, NA, 1.68, 1.69, NA, 1.43, 1.44, 1.39, 1.52), .Dim = c(10,
4 | 2))
5 | "group" <-
6 | c(1, 1, -1, -1, -1, 1, 1, 1, -1, -1)
7 | "N" <- 10
8 | "T" <- 2
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("equiv-data.R")
3 | m <- jags.model("equiv.bug", d, n.chains=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("theta","equivalence","sigma"), n.iter=10000)
6 | source("bench-test1.R")
7 | check.fun()
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/test1.cmd:
--------------------------------------------------------------------------------
1 | model in equiv.bug
2 | data in equiv-data.R
3 | compile, nchains(2)
4 | inits in equiv-init.R
5 | initialize
6 | update 1000
7 | monitor theta
8 | monitor equivalence
9 | monitor sigma
10 | update 10000
11 | coda *
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/equiv/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "equiv.bug"
2 | data in "equivmiss-data.R"
3 | compile, nchains(2)
4 | inits in "equiv-init.R"
5 | initialize
6 | update 1000
7 | monitor theta
8 | monitor equivalence
9 | monitor sigma
10 | monitor Y[1,1]
11 | monitor Y[3,2]
12 | monitor Y[6,2]
13 | update 10000
14 | coda *
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/bench-test1.R:
--------------------------------------------------------------------------------
1 | benchstats <-
2 | structure(c(0.7005387375, 3.873320955, 5.206269915, 1.0283977477,
3 | 0.2624236608034, 0.1276320868335, -0.233013591116, 1.171782081,
4 | 0.142631898325306, 0.371865965473283, 0.505796231861533, 0.30728371221228,
5 | 0.24217635612783, 0.251779866910146, 0.195536827022521, 0.286622924635357,
6 | 0.00318934620415223, 0.0083151757731685, 0.0113099475720563,
7 | 0.00687107268885141, 0.00541522794845025, 0.00562996897776936,
8 | 0.00437233637326975, 0.00640908343394458, 0.00885413896174261,
9 | 0.0289089064309517, 0.0339496360433297, 0.0208992853506661, 0.0160157943725557,
10 | 0.0218721586186754, 0.00605072817987232, 0.0248607517170521), .Dim = c(8L,
11 | 4L), .Dimnames = list(c("a[1]", "a[2]", "a[3]", "beta", "kappa",
12 | "log.sigma", "pi", "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE"
13 | )))
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/inhaler-data.R:
--------------------------------------------------------------------------------
1 | "N" <-
2 | 286
3 | "T" <-
4 | 2
5 | "G" <-
6 | 2
7 | "Npattern" <-
8 | 16
9 | "Ncut" <-
10 | 3
11 | "pattern" <-
12 | structure(c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 1,
13 | 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4), .Dim = as.integer(c(16,
14 | 2)))
15 | "Ncum" <-
16 | structure(c(59, 157, 173, 175, 186, 253, 270, 271, 271, 278,
17 | 280, 281, 282, 285, 285, 286, 122, 170, 173, 175, 226, 268, 270,
18 | 271, 278, 280, 281, 281, 284, 285, 286, 286), .Dim = as.integer(c(16,
19 | 2)))
20 | "treat" <-
21 | structure(c(1, -1, -1, 1), .Dim = as.integer(c(2, 2)))
22 | "period" <-
23 | structure(c(1, 1, -1, -1), .Dim = as.integer(c(2, 2)))
24 | "carry" <-
25 | structure(c(0, 0, -1, 1), .Dim = as.integer(c(2, 2)))
26 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/inhaler-inits.R:
--------------------------------------------------------------------------------
1 | "beta" <-
2 | 0
3 | "pi" <-
4 | 0
5 | "kappa" <-
6 | 0
7 | "a0" <-
8 | c(2, 3, 4)
9 | "tau" <-
10 | 1
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/inhaler.cmd:
--------------------------------------------------------------------------------
1 | model in inhaler.bug
2 | data in inhaler-data.R
3 | compile, nchains(2)
4 | parameters in inhaler-inits.R
5 | initialize
6 | update 1000
7 | monitor a, thin(10)
8 | monitor beta, thin(10)
9 | monitor kappa, thin(10)
10 | monitor log.sigma, thin(10)
11 | monitor pi, thin(10)
12 | monitor sigma, thin(10)
13 | update 10000
14 | coda *
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("inhaler-data.R")
3 | inits <- read.jagsdata("inhaler-inits.R")
4 | m <- jags.model("inhaler.bug", d, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("a","beta","kappa","log.sigma","pi","sigma"),
7 | n.iter=1000)
8 | source("bench-test1.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/inhaler/test1.cmd:
--------------------------------------------------------------------------------
1 | model in inhaler.bug
2 | data in inhaler-data.R
3 | compile, nchains(2)
4 | parameters in inhaler-inits.R
5 | initialize
6 | update 1000
7 | monitor a
8 | monitor beta
9 | monitor kappa
10 | monitor log.sigma
11 | monitor pi
12 | monitor sigma
13 | update 1000
14 | coda *
15 | exit
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/kidney/ReadMe:
--------------------------------------------------------------------------------
1 | Although the kidney example will run, it currently suffers from extremely
2 | high autocorrelation. There may also be a very long transient at
3 | the beginning of the chain requiring a long burnin. In view of these
4 | problems, the kidney example is not currently part of the test suite.
5 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/kidney/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-4.7831624, 0.00291866339160000, -1.968915345, 0.265791517214,
3 | 0.75342247, -1.0063284139, 1.245859934, 0.7179099125, 0.991958536862955,
4 | 0.0167522354569816, 0.545071164414747, 0.613006982741994, 0.612254543123539,
5 | 0.834773133087595, 0.179659976299101, 0.362347551415367, 0.0313684832093504,
6 | 0.000529752199434935, 0.0172366636643072, 0.0193849828705223,
7 | 0.0193611886405616, 0.0263978443007167, 0.00568134729477027,
8 | 0.0114584356705753, 0.0521436954261121, 0.000801389725300001,
9 | 0.0215086114888169, 0.0260244994849658, 0.0268674571467801, 0.0331471966526037,
10 | 0.00953117547520882, 0.0186457130325326), .Dim = as.integer(c(8,
11 | 4)), .Dimnames = list(c("alpha", "beta.age", "beta.sex", "beta.disease[2]",
12 | "beta.disease[3]", "beta.disease[4]", "r", "sigma"), c("Mean",
13 | "SD", "Naive SE", "Time-series SE")))
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/kidney/kidney-init.R:
--------------------------------------------------------------------------------
1 | "t" <-
2 | structure(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
3 | 150, NA, NA, NA, NA, 23, NA, NA, NA, NA, NA, NA, 114, NA, NA,
4 | NA, NA, NA, 6, NA, NA, NA, 55, 7, NA, NA, 14, NA, NA, NA, NA,
5 | NA, NA, NA, NA, NA, 9, NA, 71, 26, 5, NA, NA, 160, 109, NA, 25,
6 | NA, 47, NA, NA, NA, NA, NA, NA, NA, NA, NA, 6, NA, 17, NA, 9), .Dim = as.integer(c(38,
7 | 2)))
8 | "beta.age" <- 0
9 | "beta.sex" <- 0
10 | "beta.disease" <- c(NA,0,0,0)
11 | "alpha" <- -4.5
12 | "r" <- 1.2
13 | "tau" <- 10000
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/kidney/kidney.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:N) {
3 | for (j in 1:M) {
4 |
5 | # Survival times
6 | censored[i,j] ~ dinterval(t[i,j], t.cen[i,j]);
7 | t[i,j] ~ dweib(r,mu[i,j]);
8 |
9 | log(mu[i,j]) <- alpha + beta.age*age[i,j]
10 | + beta.sex*sex[i]
11 | + beta.disease[disease[i]] + b[i];
12 | }
13 | # Random effects:
14 | b[i] ~ dnorm(0.0, tau)
15 | }
16 |
17 | # Priors:
18 | alpha ~ dnorm(0.0, 0.0001);
19 | beta.age ~ dnorm(0.0, 0.0001);
20 | beta.sex ~ dnorm(0.0, 0.0001);
21 | beta.disease[1] <- 0; # corner-point constraint
22 | for(k in 2:4) {
23 | beta.disease[k] ~ dnorm(0.0, 0.0001);
24 | }
25 | tau ~ dgamma(1.0E-3, 1.0E-3);
26 | r ~ dgamma(1.0, 1.0E-3);
27 | sigma <- 1/sqrt(tau); # s.d. of random effects
28 | }
29 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/kidney/notest1.cmd:
--------------------------------------------------------------------------------
1 | model in "kidney.bug"
2 | data in "kidney-data.R"
3 | compile, nchains(2)
4 | inits in "kidney-init.R"
5 | initialize
6 | update 10000
7 | monitor alpha, thin(50)
8 | monitor beta.age, thin(50)
9 | monitor beta.sex, thin(50)
10 | monitor beta.disease[2], thin(50)
11 | monitor beta.disease[3], thin(50)
12 | monitor beta.disease[4], thin(50)
13 | monitor r, thin(50)
14 | monitor sigma, thin(50)
15 | update 50000
16 | coda *
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(1.542340069, 0.425336542871729, 0.0095108142317594,
3 | 0.0141467677072243), .Names = c("Mean", "SD", "Naive SE", "Time-series SE"
4 | ))
5 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leuk-data.R:
--------------------------------------------------------------------------------
1 | "N" <-
2 | 42
3 | "T" <-
4 | 17
5 | "eps" <-
6 | 1e-10
7 | "obs.t" <-
8 | c(1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15,
9 | 17, 22, 23, 6, 6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20,
10 | 22, 23, 25, 32, 32, 34, 35)
11 | "fail" <-
12 | c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13 | 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
14 | 0)
15 | "Z" <-
16 | c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
17 | 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5,
18 | -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,
19 | -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5)
20 | "t" <-
21 | c(1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 22, 23,
22 | 35)
23 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leuk-init.R:
--------------------------------------------------------------------------------
1 | "beta" <-
2 | 0
3 | "dL0" <-
4 | c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
5 | "tau" <-
6 | 1
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leuk-s.dat:
--------------------------------------------------------------------------------
1 | list(t = c(1,2,3,4,5,6,7,8,10,11,12,13,15,16,17,22,23,35),
2 | obs.t = c(1,1,2,2,3,4,4,5,5,8,8,8,8,11,11,12,12,15,17,22,23,
3 | 6,6,6,6,7,9,10,10,11,13,16,17,19,20,22,23,25,32,32,34,35),
4 | fail = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
5 | 1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0),
6 | Z = c(0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,
7 | 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,
8 | -0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,
9 | -0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5)
10 | )
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leuk.in:
--------------------------------------------------------------------------------
1 | list( beta = 0.0,
2 | dL0 = c(1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,
3 | 1.0,1.0,1.0,1.0,1.0,1.0, 1.0,1.0),
4 | tau=1
5 | )
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leukfr-s.dat:
--------------------------------------------------------------------------------
1 | list(t = c(1,2,3,4,5,6,7,8,10,11,12,13,15,16,17,22,23,35),
2 | obs.t = c(1,1,2,2,3,4,4,5,5,8,8,8,8,11,11,12,12,15,17,22,23,
3 | 6,6,6,6,7,9,10,10,11,13,16,17,19,20,22,23,25,32,32,34,35),
4 | group = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
5 | 19,18,8,1,20,6,2,10,3,14,4,11,7,9,12,16,17,5,13,15,21),
6 | fail = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
7 | 1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0),
8 | Z = c(-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,
9 | -0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,
10 | 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,
11 | 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5)
12 | )
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leukfr.dat:
--------------------------------------------------------------------------------
1 | 1 1 0.5 1
2 | 1 1 0.5 2
3 | 2 1 0.5 3
4 | 2 1 0.5 4
5 | 3 1 0.5 5
6 | 4 1 0.5 6
7 | 4 1 0.5 7
8 | 5 1 0.5 8
9 | 5 1 0.5 9
10 | 8 1 0.5 10
11 | 8 1 0.5 11
12 | 8 1 0.5 12
13 | 8 1 0.5 13
14 | 11 1 0.5 14
15 | 11 1 0.5 15
16 | 12 1 0.5 16
17 | 12 1 0.5 17
18 | 15 1 0.5 18
19 | 17 1 0.5 19
20 | 22 1 0.5 20
21 | 23 1 0.5 21
22 | 6 1 -0.5 19
23 | 6 1 -0.5 18
24 | 6 1 -0.5 8
25 | 6 0 -0.5 1
26 | 7 1 -0.5 20
27 | 9 0 -0.5 6
28 | 10 1 -0.5 2
29 | 10 0 -0.5 10
30 | 11 0 -0.5 3
31 | 13 1 -0.5 14
32 | 16 1 -0.5 4
33 | 17 0 -0.5 11
34 | 19 0 -0.5 7
35 | 20 0 -0.5 9
36 | 22 1 -0.5 12
37 | 23 1 -0.5 16
38 | 25 0 -0.5 17
39 | 32 0 -0.5 5
40 | 32 0 -0.5 13
41 | 34 0 -0.5 15
42 | 35 0 -0.5 21
43 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/leukfr.in:
--------------------------------------------------------------------------------
1 | list( beta = 0.0,
2 | dL0 = c(1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,
3 | 1.0,1.0,1.0,1.0,1.0,1.0, 1.0,1.0),
4 | tau=1, g=1
5 | )
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("leuk-data.R")
3 | inits <- read.jagsdata("leuk-init.R")
4 | m <- jags.model("leuk.bug", d, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, "beta", n.iter=2000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/leuk/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "leuk.bug"
2 | data in leuk-data.R
3 | compile, nchains(2)
4 | inits in leuk-init.R
5 | initialize
6 | update 1000
7 | monitor beta
8 | update 2000
9 | coda *
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(2.999527748335, 0.7997792254466, 1.00281795550000,
3 | 1.87984011964000, 0.591376492017078, 0.385949111763721, 0.769695754341595,
4 | 1.50705114637441, 0.00591376492017078, 0.00385949111763721, 0.00769695754341595,
5 | 0.0150705114637441, 0.00696500327512655, 0.00356043575711341,
6 | 0.0130689573842014, 0.0203700020249917), .Dim = as.integer(c(4,
7 | 4)), .Dimnames = list(c("alpha", "beta", "sigma", "tau"), c("Mean",
8 | "SD", "Naive SE", "Time-series SE")))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/line-data.R:
--------------------------------------------------------------------------------
1 | "x" <-
2 | c(1, 2, 3, 4, 5)
3 | "Y" <-
4 | c(1, 3, 3, 3, 5)
5 | "N" <-
6 | 5
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/line-inits.R:
--------------------------------------------------------------------------------
1 | "alpha" <- 0
2 | "beta" <- 0
3 | "tau" <- 1
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/line.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:N) {
3 | mu[i] <- alpha + beta*(x[i] - x.bar);
4 | Y[i] ~ dnorm(mu[i],tau);
5 | }
6 | x.bar <- mean(x[]);
7 | alpha ~ dnorm(0.0,1.0E-4);
8 | beta ~ dnorm(0.0,1.0E-4);
9 | tau ~ dgamma(1.0E-3,1.0E-3);
10 | sigma <- 1.0/sqrt(tau);
11 | }
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | source("line-data.R")
3 | m <- jags.model("line.bug", n.chains=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("alpha","beta","sigma","tau"), n.iter=10000)
6 | source("bench-test1.R")
7 | check.fun()
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/line/test1.cmd:
--------------------------------------------------------------------------------
1 | /* Trivial linear regression model
2 | */
3 | model in line.bug
4 | data in line-data.R
5 | compile, nchains(2)
6 | inits in line-inits.R
7 | initialize
8 | update 1000
9 | monitor alpha
10 | monitor beta
11 | monitor sigma
12 | monitor tau
13 | update 10000
14 | coda *
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/ReadMe:
--------------------------------------------------------------------------------
1 | The original version of the LITTERS example exhibits extremely poor
2 | mixing. This version uses a different parameterization in terms of
3 | the mean mu and a parameter theta that is, approximately, the shrinkage
4 | (It is only equal to the shrinkage when the litter sizes are all equal).
5 |
6 | A uniform prior is given to both theta and mu. The uniform shrinkage
7 | prior has been suggested as a reference prior in GLMMs by Natarajan,
8 | J and Kass, RE. Reference Bayesian methods for generalized linear mixed
9 | models, JASA, vol 95, 227-237 (2000).
10 |
11 | The approximate uniform shrinkage prior is quite revealing in this
12 | example. The posterior of theta[2] is not very different from its
13 | prior, indicating that there is very little information in the data
14 | about this parameter.
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.891243006, 0.737389322000001, 0.5084999256, 0.03645964932,
3 | 0.0269115255558972, 0.0668219976795681, 0.264693285356259, 0.0219835258078707,
4 | 0.000851017160664642, 0.00211309710469921, 0.0083703366307867,
5 | 0.000695180125539647, 0.000908849326318978, 0.00203101794954179,
6 | 0.0103579879291921, 0.000679619774988638), .Dim = as.integer(c(4,
7 | 4)), .Dimnames = list(c("mu[1]", "mu[2]", "theta[1]", "theta[2]"
8 | ), c("Mean", "SD", "Naive SE", "Time-series SE")))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/litters-data.R:
--------------------------------------------------------------------------------
1 | "G" <-
2 | 2
3 | "n" <-
4 | structure(c(13, 12, 12, 11, 9, 10, 9, 9, 8, 11, 8, 10, 13, 10,
5 | 12, 9, 10, 9, 10, 5, 9, 9, 13, 7, 5, 10, 7, 6, 10, 10, 10, 7), .Dim = c(2,
6 | 16))
7 | "N" <-
8 | 16
9 | "r" <-
10 | structure(c(13, 12, 12, 11, 9, 10, 9, 9, 8, 10, 8, 9, 12, 9,
11 | 11, 8, 9, 8, 9, 4, 8, 7, 11, 4, 4, 5, 5, 3, 7, 3, 7, 0), .Dim = c(2,
12 | 16))
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/litters-init.R:
--------------------------------------------------------------------------------
1 | "p" <-
2 | structure(c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
3 | 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
4 | 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5), .Dim = as.integer(c(2,
5 | 16)))
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/litters.bug:
--------------------------------------------------------------------------------
1 | /*
2 | Beta-binomial model for litters data.
3 | Approximate uniform shrinkage prior
4 | with uniform prior for mu
5 |
6 | We need to truncate the beta distribution of p[i] to avoid a
7 | singularity at 1 when b[i] < 1. This slows down the calculation
8 | considerably as it requires calculation of the incomplete beta
9 | function.
10 |
11 | */
12 | model {
13 | for (i in 1:G)
14 | {
15 | for (j in 1:N)
16 | {
17 | r[i,j] ~ dbin(p[i,j], n[i,j]);
18 | p[i,j] ~ dbeta(a[i], b[i]) T(,0.9999);
19 | }
20 |
21 | a[i] <- nbar[i] * mu[i] * phi[i];
22 | b[i] <- nbar[i] * (1 - mu[i]) * phi[i];
23 |
24 | mu[i] ~ dunif(0, 1);
25 | phi[i] <- nbar[i] * theta[i] / (1 - theta[i]);
26 |
27 | theta[i] ~ dunif(0, 1);
28 | nbar[i] <- mean(n[i,]);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("litters-data.R")
3 | inits <- read.jagsdata("litters-init.R")
4 | m <- jags.model("litters.bug", d, inits, n.chains=2)
5 | update(m, 5000)
6 | x <- coda.samples(m, c("mu","theta"), n.iter=50000, thin=50)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/litters/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "litters.bug"
2 | data in "litters-data.R"
3 | compile, nchains(2)
4 | inits in "litters-init.R"
5 | initialize
6 | update 5000
7 | monitor mu, thin(20)
8 | monitor theta, thin(20)
9 | update 20000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-2.745633835, -1.00315582550000, -0.246628370775000,
3 | -1.3127207735, -2.1066172, 0.7594457955, 0.134599617817441, 0.077534970253042,
4 | 0.0741992325942451, 0.084149591609884, 0.108905719330582, 0.0711087756187988,
5 | 0.00300973895185289, 0.00173373464119226, 0.00165914527959050,
6 | 0.00188164207118547, 0.00243520591561694, 0.00159004056080414,
7 | 0.00455924426747034, 0.00290739461757728, 0.0026965506231021,
8 | 0.0027963649898875, 0.00380594358630786, 0.00436433796205854), .Dim = as.integer(c(6,
9 | 4)), .Dimnames = list(c("alpha[1]", "alpha[2]", "alpha[3]", "alpha[4]",
10 | "alpha[5]", "beta"), c("Mean", "SD", "Naive SE", "Time-series SE"
11 | )))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/lsat-init.R:
--------------------------------------------------------------------------------
1 | "alpha" <- c(0,0,0,0,0)
2 | "beta" <- 1
3 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/lsat.dat:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 3 3
2 | 0 0 0 0 1 6 9
3 | 0 0 0 1 0 2 11
4 | 0 0 0 1 1 11 22
5 | 0 0 1 0 0 1 23
6 | 0 0 1 0 1 1 24
7 | 0 0 1 1 0 3 27
8 | 0 0 1 1 1 4 31
9 | 0 1 0 0 0 1 32
10 | 0 1 0 0 1 8 40
11 | 0 1 0 1 0 0 40
12 | 0 1 0 1 1 16 56
13 | 0 1 1 0 0 0 56
14 | 0 1 1 0 1 3 59
15 | 0 1 1 1 0 2 61
16 | 0 1 1 1 1 15 76
17 | 1 0 0 0 0 10 86
18 | 1 0 0 0 1 29 115
19 | 1 0 0 1 0 14 129
20 | 1 0 0 1 1 81 210
21 | 1 0 1 0 0 3 213
22 | 1 0 1 0 1 28 241
23 | 1 0 1 1 0 15 256
24 | 1 0 1 1 1 80 336
25 | 1 1 0 0 0 16 352
26 | 1 1 0 0 1 56 408
27 | 1 1 0 1 0 21 429
28 | 1 1 0 1 1 173 602
29 | 1 1 1 0 0 11 613
30 | 1 1 1 0 1 61 674
31 | 1 1 1 1 0 28 702
32 | 1 1 1 1 1 298 1000
33 |
34 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/lsat2-init.R:
--------------------------------------------------------------------------------
1 | "eta" <- c(0,0,0,0,0)
2 | "delta" <- c(1,1,1,1,1)
3 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("lsat-data.R")
4 | inits <- read.jagsdata("lsat-init.R")
5 | m <- jags.model("lsat.bug", d, inits, n.chains=2, n.adapt=500)
6 | update(m, 500)
7 | x <- coda.samples(m, c("alpha","beta"), n.iter=2000)
8 | source("bench-test1.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/test1.cmd:
--------------------------------------------------------------------------------
1 | model in lsat.bug
2 | data in lsat-data.R
3 | load glm
4 | compile, nchains(2)
5 | inits in lsat-init.R
6 | initialize
7 | update 1000
8 | monitor alpha
9 | monitor beta
10 | update 2000
11 | coda *
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("lsat-data.R")
4 | inits <- read.jagsdata("lsat2-init.R")
5 | m <- jags.model("lsat2.bug", d, inits, n.chains=2, n.adapt=500)
6 | update(m, 500)
7 | x <- coda.samples(m, c("delta","eta"), thin=10, n.iter=10000)
8 | source("bench-test2.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/lsat/test2.cmd:
--------------------------------------------------------------------------------
1 | model in lsat2.bug
2 | data in lsat-data.R
3 | load glm
4 | compile, nchains(2)
5 | inits in lsat2-init.R
6 | initialize
7 | update 1000
8 | monitor delta, thin(10)
9 | monitor eta, thin(10)
10 | update 10000
11 | coda *
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/mice/mice-init.R:
--------------------------------------------------------------------------------
1 | "beta" <- c(-13,-13,-13,-13)
2 | "r" <- 4
3 | "t" <-
4 | c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
5 | NA, NA, 41, NA, NA, NA, NA, NA, NA, NA, 41, 41, NA, NA, NA, 41,
6 | NA, 41, 41, 41, 41, NA, NA, NA, NA, NA, NA, 11, NA, NA, NA, NA,
7 | NA, NA, NA, NA, NA, 25, NA, 41, 41, NA, NA, NA, NA, NA, NA, NA,
8 | NA, NA, NA, NA, 21, NA, NA, NA, NA, 30, 11, NA, NA, NA, NA, NA,
9 | NA)
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/mice/mice.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for(i in 1:N) {
3 | is.censored[i] ~ dinterval(t[i], last.t[i]);
4 | t[i] ~ dweib(r,mu[i]);
5 |
6 | mu[i] <- exp(beta[group[i]]); # relative risk model
7 | }
8 | for(j in 1:M) {
9 | beta[j] ~ dnorm(0.0, 0.0001); # prior
10 | median[j] <- pow(log(2) * # median survival
11 | exp(-beta[j]), 1/r);
12 | }
13 | r ~ dgamma(1.0,0.0001); # slowly decreasing on +ve reals
14 |
15 | irr.control <- beta[1]; # change
16 | veh.control <- beta[2]-beta[1]; # parameterisation
17 | test.sub <- beta[3]-beta[1];
18 | pos.control <- beta[4]-beta[1];
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/mice/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("mice-data.R")
3 | inits <- read.jagsdata("mice-init.R")
4 | m <- jags.model("mice.bug", d, inits, n.chains=2)
5 | update(m, 10000)
6 | x <- coda.samples(m, c("veh.control","test.sub","pos.control","r","median"),
7 | thin=50, n.iter=500000)
8 | source("bench-test1.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/mice/test1.cmd:
--------------------------------------------------------------------------------
1 | /*
2 | Since the autocorrelation of node r is very strong, we set a long
3 | thinning interval.
4 | */
5 | model in "mice.bug"
6 | data in "mice-data.R"
7 | compile, nchains(2)
8 | inits in "mice-init.R"
9 | initialize
10 | update 10000
11 | monitor veh.control, thin(50)
12 | monitor test.sub, thin(50)
13 | monitor pos.control, thin(50)
14 | monitor r, thin(50)
15 | monitor median, thin(50)
16 | update 500000
17 | coda *
18 | exit
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/oxford/ReadMe:
--------------------------------------------------------------------------------
1 | The parameterization has changed for the variance of the random
2 | effects. Here we are using a uniform prior on the standard deviation
3 | (qv seedsuni.bug in the seeds directory). This substantially cuts down
4 | on the autocorrelation of the variance parameter and allows a shorter run.
5 |
6 | You can see the original parameterization in the directory "old".
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/oxford/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.578583954000001, -0.0461005503250001, 0.00702949669105,
3 | 0.1230820353658, 0.0654185681985203, 0.0149358418576360, 0.00305161514347347,
4 | 0.0859365730618193, 0.00146280365482597, 0.000333975576948609,
5 | 6.82361890197445e-05, 0.00192160019119605, 0.00161378145150198,
6 | 0.000363947519384889, 7.65060538223112e-05, 0.00267000525994563
7 | ), .Dim = as.integer(c(4, 4)), .Dimnames = list(c("alpha", "beta1",
8 | "beta2", "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE"
9 | )))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/oxford/oxford.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:K) {
3 | r0[i] ~ dbin(p0[i],n0[i]);
4 | r1[i] ~ dbin(p1[i],n1[i]);
5 | logit(p0[i]) <- mu[i];
6 | logit(p1[i]) <- mu[i] + logPsi[i];
7 | logPsi[i] <- alpha + beta1 * year[i]
8 | + beta2 * (year[i]^2 - 22) + sigma * b[i];
9 | b[i] ~ dnorm(0,1);
10 | mu[i] ~ dnorm(0.0,1.0E-6);
11 | }
12 |
13 | alpha ~ dnorm(0.0,1.0E-6);
14 | beta1 ~ dnorm(0.0,1.0E-6);
15 | beta2 ~ dnorm(0.0,1.0E-6);
16 | sigma ~ dunif(0,3);
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/oxford/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("oxford-data.R")
4 | inits <- read.jagsdata("oxford-init.R")
5 | m <- jags.model("oxford.bug", d, inits, n.chains=2, n.adapt=500)
6 | update(m, 500)
7 | x <- coda.samples(m, c("alpha","beta1","beta2","sigma"),
8 | n.iter=20000, thin=10)
9 | source("bench-test1.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/oxford/test1.cmd:
--------------------------------------------------------------------------------
1 | /* Due to very high autocorrelation for sigma, we set a very long thinning
2 | interval
3 | */
4 | model in "oxford.bug"
5 | data in "oxford-data.R"
6 | load glm
7 | compile, nchains(2)
8 | inits in "oxford-init.R"
9 | initialize
10 | update 1000
11 | monitor alpha, thin(10)
12 | monitor beta1, thin(10)
13 | monitor beta2, thin(10)
14 | monitor sigma, thin(10)
15 | update 20000
16 | coda *
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/pump/pump-data.R:
--------------------------------------------------------------------------------
1 | "N" <-
2 | 10
3 | "t" <-
4 | c(94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5)
5 | "x" <-
6 | c(5, 1, 5, 14, 3, 19, 1, 1, 4, 22)
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/pump/pump-init.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | 1
3 | "beta" <-
4 | 1
5 | "theta" <-
6 | c(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1)
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/pump/pump.bug:
--------------------------------------------------------------------------------
1 | model {
2 |
3 | for (i in 1:N){
4 | theta[i] ~ dgamma(alpha,beta);
5 | lambda[i] <- theta[i]*t[i];
6 | x[i] ~ dpois(lambda[i])
7 | }
8 |
9 | alpha ~ dexp(1.0);
10 | beta ~ dgamma(0.1,1.0);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/pump/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("pump-data.R")
3 | inits <- read.jagsdata("pump-init.R")
4 | m <- jags.model("pump.bug", d, inits, n.chains=2)
5 | update(m,1000)
6 | x <- coda.samples(m, c("theta","alpha","beta"), n.iter=5000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/pump/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "pump.bug"
2 | data in "pump-data.R"
3 | compile, nchains(2)
4 | inits in "pump-init.R"
5 | initialize
6 | update 1000
7 | monitor theta
8 | monitor alpha
9 | monitor beta
10 | update 5000
11 | coda *
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(106.395475260000, 6.186341032, 3.59973711728027,
3 | 0.108801811133848, 0.0359973711728027, 0.00108801811133848, 0.0411237269899422,
4 | 0.00135309590786857), .Dim = as.integer(c(2, 4)), .Dimnames = list(
5 | c("alpha0", "beta.c"), c("Mean", "SD", "Naive SE", "Time-series SE"
6 | )))
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(101.355886930000, 6.543125587, 204.337315, 249.613348800000,
3 | 294.9184589, 340.197303499999, 3.76077448586106, 0.150166080960124,
4 | 8.78577838295244, 10.0548990666074, 12.3236867955387, 14.9198969672696,
5 | 0.0376077448586106, 0.00150166080960124, 0.0878577838295244,
6 | 0.100548990666074, 0.123236867955387, 0.149198969672695, 0.0472146936851333,
7 | 0.00238881773240121, 0.101464650184598, 0.136173472502403, 0.186563611373406,
8 | 0.236919665020644), .Dim = as.integer(c(6, 4)), .Dimnames = list(
9 | c("alpha0", "beta.c", "Y[26,2]", "Y[26,3]", "Y[26,4]", "Y[26,5]"
10 | ), c("Mean", "SD", "Naive SE", "Time-series SE")))
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/rats-init.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | c(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
3 | 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
4 | 250, 250, 250, 250, 250)
5 | "beta" <-
6 | c(6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6)
8 | "alpha.c" <-
9 | 0
10 | "beta.c" <-
11 | 2
12 | "tau.c" <-
13 | 1
14 | "tau.alpha" <-
15 | 1
16 | "tau.beta" <-
17 | 1
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/rats.bug:
--------------------------------------------------------------------------------
1 | model {
2 | for (i in 1:N) {
3 | for (j in 1:T) {
4 | mu[i,j] <- alpha[i] + beta[i]*(x[j] - x.bar);
5 | Y[i,j] ~ dnorm(mu[i,j],tau.c)
6 | }
7 | alpha[i] ~ dnorm(alpha.c,tau.alpha);
8 | beta[i] ~ dnorm(beta.c,tau.beta);
9 | }
10 | alpha.c ~ dnorm(0,1.0E-4);
11 | beta.c ~ dnorm(0,1.0E-4);
12 | tau.c ~ dgamma(1.0E-3,1.0E-3);
13 | tau.alpha ~ dgamma(1.0E-3,1.0E-3);
14 | tau.beta ~ dgamma(1.0E-3,1.0E-3);
15 | sigma <- 1.0/sqrt(tau.c);
16 | x.bar <- mean(x[]);
17 | alpha0 <- alpha.c - beta.c*x.bar;
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/ratsmiss-data.R:
--------------------------------------------------------------------------------
1 | "N" <-
2 | 30
3 | "T" <-
4 | 5
5 | "x" <-
6 | c(8, 15, 22, 29, 36)
7 | "Y" <-
8 | structure(c(151, 145, 147, 155, 135, 159, 141, 159, 177, 134,
9 | 160, 143, 154, 171, 163, 160, 142, 156, 157, 152, 154, 139, 146,
10 | 157, 132, 160, 169, 157, 137, 153, 199, 199, 214, 200, 188, 210,
11 | 189, 201, 236, 182, 208, 188, 200, 221, 216, 207, 187, 203, 212,
12 | 203, 205, 190, 191, 211, 185, NA, NA, NA, NA, NA, 246, 249, 263,
13 | 237, 230, 252, 231, 248, 285, 220, 261, 220, 244, 270, 242, 248,
14 | 234, 243, 259, 246, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 283,
15 | 293, 312, 272, 280, 298, 275, 297, 350, 260, NA, NA, NA, NA,
16 | NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
17 | 320, 354, 328, 297, 323, NA, NA, NA, NA, NA, NA, NA, NA, NA,
18 | NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA
19 | ), .Dim = c(30, 5))
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("rats-data.R")
3 | inits <- read.jagsdata("rats-init.R")
4 | m <- jags.model("rats.bug", d, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha0","beta.c"), n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "rats.bug"
2 | data in "rats-data.R"
3 | compile, nchains(2)
4 | inits in "rats-init.R"
5 | initialize
6 | update 1000
7 | monitor alpha0
8 | monitor beta.c
9 | update 10000
10 | coda *
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/rats/test2.cmd:
--------------------------------------------------------------------------------
1 | /* RATS example with missing data */
2 | model in "rats.bug"
3 | data in "ratsmiss-data.R"
4 | compile, nchains(2)
5 | inits in "rats-init.R"
6 | initialize
7 | update 1000
8 | monitor alpha0
9 | monitor beta.c
10 | monitor Y[26,2]
11 | monitor Y[26,3]
12 | monitor Y[26,4]
13 | monitor Y[26,5]
14 | update 10000
15 | coda *
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(2.1610017678, 0.314888602448, -0.000993973359687598,
3 | 0.25932381884, 111.005399920000, 0.353383417594079, 0.0954336057567014,
4 | 0.000427021991996785, 0.0781208477848897, 6.35469367901355, 0.00499759621879302,
5 | 0.00134963499567294, 6.03900292513429e-06, 0.00110479562441475,
6 | 0.0898689398558755, 0.00949065535819535, 0.00278349689804673,
7 | 1.25799268985875e-05, 0.00140968106311918, 0.0968773787376773
8 | ), .Dim = as.integer(c(5, 4)), .Dimnames = list(c("alpha", "beta",
9 | "gamma", "sigma", "deviance"), c("Mean", "SD", "Naive SE", "Time-series SE"
10 | )))
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(2.1687819926, 0.310451635378, -0.0009683887881574,
3 | 0.288663430399999, 110.31680464, 0.391071386087864, 0.107950146763554,
4 | 0.000479878954427665, 0.0841914526156086, 5.91394764040376, 0.00553058458061503,
5 | 0.00152664561613184, 6.78651325649025e-06, 0.00119064694124885,
6 | 0.0836358496022336, 0.0114986840074569, 0.00347202136199811,
7 | 1.60989956316243e-05, 0.00307070401278235, 0.109009968730892), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("alpha", "beta", "gamma", "sigma", "deviance"
9 | ), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/salm-data.R:
--------------------------------------------------------------------------------
1 | "doses" <-
2 | 6
3 | "plates" <-
4 | 3
5 | "y" <-
6 | structure(c(15, 16, 16, 27, 33, 20, 21, 18, 26, 41, 38, 27, 29,
7 | 21, 33, 60, 41, 42), .Dim = as.integer(c(6, 3)))
8 | "x" <-
9 | c(0, 10, 33, 100, 333, 1000)
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/salm-init.R:
--------------------------------------------------------------------------------
1 | "tau" <-
2 | 0.1
3 | "alpha.star" <-
4 | 0
5 | "beta" <-
6 | 0
7 | "gamma" <-
8 | 0
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/salm-pareto.bug:
--------------------------------------------------------------------------------
1 | model {
2 | alpha.star ~ dnorm(0.0,1.0E-4); # intercept
3 | beta ~ dnorm(0.0,1.0E-4); # mutagenic effect
4 | gamma ~ dnorm(0.0,1.0E-10); # toxic effect
5 | tau ~ dpar(0.5, 0.04); # Pareto prior on precision
6 | sigma <- 1.0/sqrt(tau);
7 |
8 | for(i in 1:doses){
9 | for(j in 1:plates){
10 | log(mu[i,j]) <- alpha.star + beta*(logx[i]-mean(logx[]))
11 | + gamma*(x[i]-mean(x[])) + lambda[i,j];
12 | y[i,j] ~ dpois(mu[i,j]);
13 | lambda[i,j] ~ dnorm(0.0,tau);
14 | }
15 | logx[i] <- log(x[i]+10);
16 | }
17 | alpha <- alpha.star - beta*mean(logx[]) - gamma*mean(x[]);
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/salm.bug:
--------------------------------------------------------------------------------
1 | model {
2 | alpha.star ~ dnorm(0.0,1.0E-4); # intercept
3 | beta ~ dnorm(0.0,1.0E-4); # mutagenic effect
4 | gamma ~ dnorm(0.0,1.0E-10); # toxic effect
5 | tau ~ dgamma(1.0E-3,1.0E-3); # Gamma prior on precision
6 | sigma <- 1.0/sqrt(tau);
7 |
8 | for(i in 1:doses){
9 | for(j in 1:plates){
10 | log(mu[i,j]) <- alpha.star + beta*(logx[i]-mean(logx[]))
11 | + gamma*(x[i]-mean(x[])) + lambda[i,j];
12 | y[i,j] ~ dpois(mu[i,j]);
13 | lambda[i,j] ~ dnorm(0.0,tau);
14 | }
15 | logx[i] <- log(x[i]+10);
16 | }
17 | alpha <- alpha.star - beta*mean(logx[]) - gamma*mean(x[]);
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("salm-data.R")
4 | inits <- read.jagsdata("salm-init.R")
5 | m <- jags.model("salm.bug", d, inits, n.chains=2)
6 | update(m, 1000)
7 | load.module("dic")
8 | x <- coda.samples(m, c("alpha","beta","gamma","sigma","deviance"), n.iter=5000)
9 | source("bench-test1.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "salm.bug"
2 | data in "salm-data.R"
3 | load glm
4 | compile, nchains(2)
5 | inits in "salm-init.R"
6 | initialize
7 | update 1000
8 | monitor alpha
9 | monitor beta
10 | monitor gamma
11 | monitor sigma
12 | load dic
13 | monitor deviance
14 | update 5000
15 | coda *
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("salm-data.R")
4 | inits <- read.jagsdata("salm-init.R")
5 | m <- jags.model("salm-pareto.bug", d, inits, n.chains=2)
6 | update(m, 1000)
7 | load.module("dic")
8 | x <- coda.samples(m, c("alpha","beta","gamma","sigma","deviance"), n.iter=5000)
9 | source("bench-test2.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/salm/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "salm-pareto.bug"
2 | data in "salm-data.R"
3 | load glm
4 | compile, nchains(2)
5 | inits in "salm-init.R"
6 | initialize
7 | update 1000
8 | monitor alpha
9 | monitor beta
10 | monitor gamma
11 | monitor sigma
12 | load dic
13 | monitor deviance
14 | update 5000
15 | coda *
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/bench-test1.R:
--------------------------------------------------------------------------------
1 | benchstats <-
2 | structure(c(-0.5493068746225, 0.080768909708, 1.343254753, -0.81849520934,
3 | 0.28166293745, 0.192311567097756, 0.309519435490865, 0.263666923150379,
4 | 0.432420974661123, 0.140699619184031, 0.00430021736890094, 0.00692106498114936,
5 | 0.0058957716358246, 0.00966922694238986, 0.00314613912903828,
6 | 0.00450839686115534, 0.00807961069082053, 0.00650490843852599,
7 | 0.0109139425636793, 0.0076648366081847), .Dim = c(5L, 4L), .Dimnames = list(
8 | c("alpha0", "alpha1", "alpha2", "alpha12", "sigma"), c("Mean",
9 | "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.554544470614999, 0.093859735701, 1.35123381100000,
3 | -0.82675123843225, 0.280909349725, 0.176848360836085, 0.307830462750172,
4 | 0.267078584797408, 0.427523459072528, 0.140575748548500, 0.00279621810354675,
5 | 0.00486722697737082, 0.00422288321107114, 0.00675973941911482,
6 | 0.00222269774598185, 0.00410936094985568, 0.00708095087151272,
7 | 0.00627108894646244, 0.00983117681054512, 0.0035041658079277), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("alpha0", "alpha1", "alpha2", "alpha12",
9 | "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/bench-test3.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.539476775475999, 0.07290450460916, 1.35044335,
3 | -0.844483570011201, 0.323519511414800, 0.207440930774014, 0.328489794013564,
4 | 0.295719905235092, 0.448870644563235, 0.140288130442534, 0.00414881861548028,
5 | 0.00656979588027128, 0.00591439810470183, 0.00897741289126469,
6 | 0.00280576260885068, 0.00630165833669905, 0.00971581783944712,
7 | 0.0092679340320048, 0.0137654777046475, 0.00342598104762198), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("alpha0", "alpha1", "alpha2", "alpha12",
9 | "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/bench-test4.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.564078382644001, 0.0920855170792, 1.38559145800000,
3 | -0.872653875456001, 0.3511402553112, 0.212653899600968, 0.326121153971964,
4 | 0.293199209694739, 0.460192694513136, 0.151716683354040, 0.00425307799201936,
5 | 0.00652242307943928, 0.00586398419389477, 0.00920385389026273,
6 | 0.00303433366708080, 0.0065192903924603, 0.00950054380263277,
7 | 0.00896634961209464, 0.0135709752729569, 0.00365072408479954), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("alpha0", "alpha1", "alpha2", "alpha12",
9 | "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/bench-test5.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.552304863299799, 0.072979745123, 1.37224430211999,
3 | -0.849563479037, 0.349196386760000, 0.214112856487971, 0.342843033382582,
4 | 0.307108951148868, 0.482850197402199, 0.154502287505980, 0.00302801305523733,
5 | 0.00484853267574779, 0.00434317643840906, 0.00682853297760715,
6 | 0.00218499230408625, 0.00465298450024572, 0.0073970717771974,
7 | 0.00680046848604164, 0.0105763188062271, 0.00339665486799047), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("alpha0", "alpha1", "alpha2", "alpha12",
9 | "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seeds-data.R:
--------------------------------------------------------------------------------
1 | "N" <- 21
2 | "r" <-
3 | c(10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0,
4 | 3, 22, 15, 32, 3)
5 | "n" <-
6 | c(39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45,
7 | 4, 12, 41, 30, 51, 7)
8 | "x1" <-
9 | c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
10 | 1)
11 | "x2" <-
12 | c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1,
13 | 1)
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seeds-init.R:
--------------------------------------------------------------------------------
1 | "tau" <-
2 | 1
3 | "alpha0" <-
4 | 0
5 | "alpha1" <-
6 | 0
7 | "alpha2" <-
8 | 0
9 | "alpha12" <-
10 | 0
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seeds.bug:
--------------------------------------------------------------------------------
1 | model {
2 | alpha0 ~ dnorm(0.0,1.0E-6); # intercept
3 | alpha1 ~ dnorm(0.0,1.0E-6); # seed coeff
4 | alpha2 ~ dnorm(0.0,1.0E-6); # extract coeff
5 | alpha12 ~ dnorm(0.0,1.0E-6);
6 | tau ~ dgamma(1.0E-3,1.0E-3); # 1/sigma^2
7 | sigma <- 1.0/sqrt(tau);
8 | for (i in 1:N) {
9 | b[i] ~ dnorm(0.0,tau);
10 | logit(p[i]) <- alpha0 + alpha1*x1[i] + alpha2*x2[i] +
11 | alpha12*x1[i]*x2[i] + b[i];
12 | r[i] ~ dbin(p[i],n[i]);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seedspar.bug:
--------------------------------------------------------------------------------
1 | /*
2 | Seeds example with Pareto prior on the precision of the random effects
3 | equivalent to a uniform(0, 10) prior on the standard deviation.
4 | */
5 | model {
6 | alpha0 ~ dnorm(0.0,1.0E-6); # intercept
7 | alpha1 ~ dnorm(0.0,1.0E-6); # seed coeff
8 | alpha2 ~ dnorm(0.0,1.0E-6); # extract coeff
9 | alpha12 ~ dnorm(0.0,1.0E-6);
10 | tau ~ dpar(0.5, 0.01); # 1/sigma^2
11 | sigma <- 1.0/sqrt(tau);
12 | for (i in 1:N) {
13 | b[i] ~ dnorm(0.0,tau);
14 | logit(p[i]) <- alpha0 + alpha1*x1[i] + alpha2*x2[i] +
15 | alpha12*x1[i]*x2[i] + b[i];
16 | r[i] ~ dbin(p[i],n[i]);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seedssig.bug:
--------------------------------------------------------------------------------
1 | ## Model with random effects represented by hidden covariate b[i]
2 | model {
3 | alpha0 ~ dnorm(0.0,1.0E-6); # intercept
4 | alpha1 ~ dnorm(0.0,1.0E-6); # seed coeff
5 | alpha2 ~ dnorm(0.0,1.0E-6); # extract coeff
6 | alpha12 ~ dnorm(0.0,1.0E-6);
7 | sigma ~ dexp(1.0);
8 | for (i in 1:N) {
9 | b[i] ~ dnorm(0.0,1.0);
10 | logit(p[i]) <- alpha0 + alpha1*x1[i] + alpha2*x2[i] +
11 | alpha12*x1[i]*x2[i] + sigma * b[i];
12 | r[i] ~ dbin(p[i],n[i]);
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seedsuni.bug:
--------------------------------------------------------------------------------
1 | /*
2 | SEEDS example with uniform prior on the standard error of the random
3 | effects. This version uses the hidden covariate paramaterization with
4 | a uniform prior (instead of a gamma prior) on sigma.
5 | */
6 | model {
7 | alpha0 ~ dnorm(0.0,1.0E-6); # intercept
8 | alpha1 ~ dnorm(0.0,1.0E-6); # seed coeff
9 | alpha2 ~ dnorm(0.0,1.0E-6); # extract coeff
10 | alpha12 ~ dnorm(0.0,1.0E-6);
11 | sigma ~ dunif(0,10);
12 | for (i in 1:N) {
13 | b[i] ~ dnorm(0.0,1.0);
14 | logit(p[i]) <- alpha0 + alpha1*x1[i] + alpha2*x2[i] +
15 | alpha12*x1[i]*x2[i] + sigma * b[i];
16 | r[i] ~ dbin(p[i],n[i]);
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/seedszro.bug:
--------------------------------------------------------------------------------
1 | # SEEDS example with random effects constrained to sum to zero
2 | model {
3 | alpha0 ~ dnorm(0.0,1.0E-6); # intercept
4 | alpha1 ~ dnorm(0.0,1.0E-6); # seed coeff
5 | alpha2 ~ dnorm(0.0,1.0E-6); # extract coeff
6 | alpha12 ~ dnorm(0.0,1.0E-6);
7 | tau ~ dgamma(1.0E-3,1.0E-3); # 1/sigma^2
8 | for (i in 1:N) {
9 | c[i] ~ dnorm(0.0,tau);
10 | b[i] <- c[i] - mean(c[]); # make sure b's add to zero
11 | logit(p[i]) <- alpha0 + alpha1*x1[i] + alpha2*x2[i] +
12 | alpha12*x1[i]*x2[i] + b[i];
13 | r[i] ~ dbin(p[i],n[i]);
14 | }
15 | sigma <- 1.0/sqrt(tau);
16 | }
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("seeds-data.R")
4 | inits <- read.jagsdata("seeds-init.R")
5 | m <- jags.model("seeds.bug", d, inits, n.chains=2, n.adapt=2500)
6 | update(m, 2500)
7 | x <- coda.samples(m, c("alpha0", "alpha1","alpha2","alpha12","sigma"),
8 | n.iter=10000, thin=10)
9 | source("bench-test1.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "seeds.bug"
2 | data in "seeds-data.R"
3 | load glm
4 | compile, nchains(2)
5 | inits in "seeds-init.R"
6 | initialize
7 | update 1000
8 | monitor alpha0 , thin(10)
9 | monitor alpha1 , thin(10)
10 | monitor alpha2 , thin(10)
11 | monitor alpha12 , thin(10)
12 | monitor sigma , thin(10)
13 | update 10000
14 | coda *
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("seeds-data.R")
4 | inits <- read.jagsdata("seeds-init.R")
5 | m <- jags.model("seedszro.bug", d, inits, n.chains=2, n.adapt=2500)
6 | update(m, 2500)
7 | x <- coda.samples(m, c("alpha0", "alpha1","alpha2","alpha12","sigma"),
8 | n.iter=10000, thin=10)
9 | source("bench-test2.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test2.cmd:
--------------------------------------------------------------------------------
1 | /* SEEDS example with random effects constrained to sum to zero */
2 | model in "seedszro.bug"
3 | data in "seeds-data.R"
4 | load glm
5 | compile, nchains(2)
6 | inits in "seeds-init.R"
7 | initialize
8 | update 5000
9 | monitor alpha0 , thin(10)
10 | monitor alpha1 , thin(10)
11 | monitor alpha2 , thin(10)
12 | monitor alpha12 , thin(10)
13 | monitor sigma , thin(10)
14 | update 10000
15 | coda *
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test3.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("seeds-data.R")
4 | inits <- read.jagsdata("seeds-init.R")
5 | m <- jags.model("seedssig.bug", d, inits, n.chains=2, n.adapt=2500)
6 | update(m, 2500)
7 | x <- coda.samples(m, c("alpha0", "alpha1","alpha2","alpha12","sigma"),
8 | n.iter=10000, thin=10)
9 | source("bench-test3.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test3.cmd:
--------------------------------------------------------------------------------
1 | /* SEEDS example with random effects represented by hidden covariate
2 | */
3 | model in "seedssig.bug"
4 | data in "seeds-data.R"
5 | load glm
6 | compile, nchains(2)
7 | inits in "seeds-init.R"
8 | initialize
9 | update 5000
10 | monitor alpha0 , thin(10)
11 | monitor alpha1 , thin(10)
12 | monitor alpha2 , thin(10)
13 | monitor alpha12 , thin(10)
14 | monitor sigma , thin(10)
15 | update 10000
16 | coda *
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test4.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("seeds-data.R")
4 | inits <- read.jagsdata("seeds-init.R")
5 | m <- jags.model("seedsuni.bug", d, inits, n.chains=2, n.adapt=2500)
6 | update(m, 2500)
7 | x <- coda.samples(m, c("alpha0", "alpha1","alpha2","alpha12","sigma"),
8 | n.iter=10000, thin=10)
9 | source("bench-test4.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test4.cmd:
--------------------------------------------------------------------------------
1 | /* SEEDS example with uniform prior on the standard deviation of the
2 | random effects. The autocorrelation is smaller than for other
3 | parameterizations, allowing a shorter run.
4 | */
5 | model in "seedsuni.bug"
6 | data in "seeds-data.R"
7 | load glm
8 | compile, nchains(2)
9 | inits in "seeds-init.R"
10 | initialize
11 | update 5000
12 | monitor alpha0 , thin(10)
13 | monitor alpha1 , thin(10)
14 | monitor alpha2 , thin(10)
15 | monitor alpha12 , thin(10)
16 | monitor sigma , thin(10)
17 | update 10000
18 | coda *
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test5.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | load.module("glm")
3 | d <- read.jagsdata("seeds-data.R")
4 | inits <- read.jagsdata("seeds-init.R")
5 | m <- jags.model("seedspar.bug", d, inits, n.chains=2, n.adapt=2500)
6 | update(m, 2500)
7 | x <- coda.samples(m, c("alpha0", "alpha1","alpha2","alpha12","sigma"),
8 | n.iter=10000, thin=10)
9 | source("bench-test5.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol1/seeds/test5.cmd:
--------------------------------------------------------------------------------
1 | /* SEEDS example with uniform prior on the standard deviation of the
2 | random effects. The results should be identical to test4, although
3 | the parameterization of the model is different.
4 | */
5 | model in "seedspar.bug"
6 | data in "seeds-data.R"
7 | load glm
8 | compile, nchains(2)
9 | inits in "seeds-init.R"
10 | initialize
11 | update 5000
12 | monitor alpha0 , thin(10)
13 | monitor alpha1 , thin(10)
14 | monitor alpha2 , thin(10)
15 | monitor alpha12 , thin(10)
16 | monitor sigma , thin(10)
17 | update 10000
18 | coda *
19 |
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/ReadMe:
--------------------------------------------------------------------------------
1 | The X values have been centred in the model to improve
2 | autocorrelation. The parameter theta0 corresponds to the intercept in
3 | the uncentred model.
4 |
5 | The posterior distributions of theta0 and theta have a very heavy tail.
6 | Excursions into the tail are rare, but have a strong influence on
7 | the mean.
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/air-data.R:
--------------------------------------------------------------------------------
1 | "alpha" <- 4.48
2 | "beta" <- 0.76
3 | "sigma2" <- 81.14
4 | "J" <- 3
5 | "y" <-
6 | c(21, 20, 15)
7 | "n" <-
8 | c(48, 34, 21)
9 | "Z" <-
10 | c(10, 30, 50)
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/air-inits.R:
--------------------------------------------------------------------------------
1 | "theta" <-
2 | c(0, 0)
3 | "X" <-
4 | c(0, 0, 0)
5 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/air.bug:
--------------------------------------------------------------------------------
1 | var
2 | theta[2], X[J], Z[J], mu[J], p[J], y[J], n[J], alpha, beta, tau, sigma2,
3 | theta0;
4 | model {
5 | theta[1] ~ dnorm(0.0,1.0E-3);
6 | theta[2] ~ dnorm(0.0,1.0E-3);
7 | tau <- 1/sigma2;
8 | for (j in 1:J) {
9 | mu[j] <- alpha + beta*Z[j];
10 | X[j] ~ dnorm(mu[j],tau);
11 | logit(p[j]) <- theta[1] + theta[2] * (X[j] - mean(X));
12 | y[j] ~ dbin(p[j],n[j]);
13 | }
14 | theta0 <- theta[1] - theta[2]*mean(X);
15 | }
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.612023159822451, 0.0364082797356349, 13.4124014598000,
3 | 27.7458560869999, 40.9964197499999, 5.27180149177774, 0.168087998262817,
4 | 8.59199108272036, 7.41758203000775, 8.43452177525867, 0.0527180149177774,
5 | 0.00168087998262817, 0.0859199108272036, 0.0741758203000775,
6 | 0.0843452177525867, 0.0894434649687467, 0.00286318982996524,
7 | 0.154120139865778, 0.129543297124219, 0.147994321854581), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("theta0", "theta[2]", "X[1]", "X[2]",
9 | "X[3]"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/bench.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(-0.612023159822451, 0.0364082797356349, 13.4124014598000,
3 | 27.7458560869999, 40.9964197499999, 5.27180149177774, 0.168087998262817,
4 | 8.59199108272036, 7.41758203000775, 8.43452177525867, 0.0527180149177774,
5 | 0.00168087998262817, 0.0859199108272036, 0.0741758203000775,
6 | 0.0843452177525867, 0.0894434649687467, 0.00286318982996524,
7 | 0.154120139865778, 0.129543297124219, 0.147994321854581), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("theta0", "theta[2]", "X[1]", "X[2]",
9 | "X[3]"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/air/notest1.cmd:
--------------------------------------------------------------------------------
1 | load glm
2 | model in "air.bug"
3 | data in "air-data.R"
4 | compile, nchains(2)
5 | inits in "air-inits.R"
6 | initialize
7 | update 10000
8 | monitor theta0, thin(10)
9 | monitor theta[2], thin(10)
10 | monitor X, thin(10)
11 | update 50000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/alli/alli-data.R:
--------------------------------------------------------------------------------
1 | "I" <-
2 | 4
3 | "J" <-
4 | 2
5 | "K" <-
6 | 5
7 | "n" <-
8 | structure(c(39, 20, 24, 41, 16, 28, 29, 22), .Dim = as.integer(c(4,
9 | 2)))
10 | "X" <-
11 | structure(c(23, 5, 5, 16, 7, 13, 8, 17, 4, 11, 11, 19, 0, 8,
12 | 7, 1, 2, 1, 2, 1, 1, 6, 6, 0, 2, 0, 1, 2, 3, 1, 3, 1, 8, 3, 5,
13 | 3, 5, 0, 5, 3), .Dim = as.integer(c(4, 2, 5)))
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/alli/alli-inits.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | c(NA, 0, 0, 0, 0)
3 | "beta" <-
4 | structure(c(NA, NA, NA, NA, NA, 0, 0, 0, NA, 0, 0, 0, NA, 0,
5 | 0, 0, NA, 0, 0, 0), .Dim = as.integer(c(4, 5)))
6 | "gamma" <-
7 | structure(c(NA, NA, NA, 0, NA, 0, NA, 0, NA, 0), .Dim = as.integer(c(2,
8 | 5)))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/alli/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0, -1.870778486, -0.421014124726, 0.554986565, 0.27488635389,
3 | 0, 0.465764570800778, 0.616829033048763, 0.554030326968078, 0.368474880159275,
4 | 0, 0.0147287689714121, 0.0195058467135336, 0.0175199772602694,
5 | 0.0116521988186090, 0, 0.0238148046787432, 0.0262946154148568,
6 | 0.0191076335155862, 0.0129448273550398), .Dim = as.integer(c(5,
7 | 4)), .Dimnames = list(c("b[1,1]", "b[1,2]", "b[1,3]", "b[1,4]",
8 | "b[1,5]"), c("Mean", "SD", "Naive SE", "Time-series SE")))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/alli/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | d <- read.jagsdata("alli-data.R")
3 | inits <- read.jagsdata("alli-inits.R")
4 | m <- jags.model("alli.bug", d, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("b[1,1]","b[1,2]","b[1,3]","b[1,4]","b[1,5]"),
7 | thin=10, n.iter=10000)
8 | source("bench-test1.R")
9 | check.fun()
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/alli/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "alli.bug"
2 | data in "alli-data.R"
3 | compile, nchains(2)
4 | parameters in "alli-inits.R"
5 | initialize
6 | update 1000
7 | monitor b[1,1], thin(10)
8 | monitor b[1,2], thin(10)
9 | monitor b[1,3], thin(10)
10 | monitor b[1,4], thin(10)
11 | monitor b[1,5], thin(10)
12 | /* monitor G2, thin(10) */
13 | update 10000
14 | coda *
15 |
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/asia-data.R:
--------------------------------------------------------------------------------
1 | "asia" <-
2 | 2
3 | "dyspnoea" <-
4 | 2
5 | "p.tuberculosis" <-
6 | structure(c(0.99, 0.95, 0.01, 0.05), .Dim = as.integer(c(2, 2
7 | )))
8 | "p.bronchitis" <-
9 | structure(c(0.7, 0.4, 0.3, 0.6), .Dim = as.integer(c(2, 2)))
10 | "p.smoking" <-
11 | c(0.5, 0.5)
12 | "p.lung.cancer" <-
13 | structure(c(0.99, 0.9, 0.01, 0.1), .Dim = as.integer(c(2, 2)))
14 | "p.xray" <-
15 | structure(c(0.95, 0.02, 0.05, 0.98), .Dim = as.integer(c(2, 2
16 | )))
17 | "p.dyspnoea" <-
18 | structure(c(0.9, 0.3, 0.2, 0.1, 0.1, 0.7, 0.8, 0.9), .Dim = as.integer(c(2,
19 | 2, 2)))
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/asia.bug:
--------------------------------------------------------------------------------
1 | var
2 | asia,smoking,tuberculosis,lung.cancer,bronchitis,either,xray,dyspnoea,
3 | p.asia[2],p.smoking[2],p.tuberculosis[2,2],p.bronchitis[2,2],
4 | p.lung.cancer[2,2],p.xray[2,2],p.dyspnoea[2,2,2];
5 | model {
6 | smoking ~ dcat(p.smoking[]);
7 | tuberculosis ~ dcat(p.tuberculosis[asia,]);
8 | lung.cancer ~ dcat(p.lung.cancer[smoking,]);
9 | bronchitis ~ dcat(p.bronchitis[smoking,]);
10 | either <- max(tuberculosis,lung.cancer);
11 | xray ~ dcat(p.xray[either,]);
12 | dyspnoea ~ dcat(p.dyspnoea[either,bronchitis,])
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/asia2-data.R:
--------------------------------------------------------------------------------
1 | "p.tuberculosis" <-
2 | structure(c(0.99, 0.95, 0.01, 0.05), .Dim = as.integer(c(2, 2
3 | )))
4 | "p.bronchitis" <-
5 | structure(c(0.7, 0.4, 0.3, 0.6), .Dim = as.integer(c(2, 2)))
6 | "p.smoking" <-
7 | c(0.5, 0.5)
8 | "p.lung.cancer" <-
9 | structure(c(0.99, 0.9, 0.01, 0.1), .Dim = as.integer(c(2, 2)))
10 | "p.xray" <-
11 | structure(c(0.95, 0.02, 0.05, 0.98), .Dim = as.integer(c(2, 2
12 | )))
13 | "p.dyspnoea" <-
14 | structure(c(0.9, 0.3, 0.2, 0.1, 0.1, 0.7, 0.8, 0.9), .Dim = as.integer(c(2,
15 | 2, 2)))
16 | "N" <- 5
17 | "asia" <- c(1,1,1,1,1)
18 | "smoking" <- c(2,NA,NA,1,1)
19 | "tuberculosis" <- c(1,1,1,1,1)
20 | "lung.cancer" <- c(2,1,1,1,1)
21 | "bronchitis" <- c(2,2,1,2,1)
22 | "xray" <- c(2,1,2,2,1)
23 | "dyspnoea" <- c(2,2,1,2,2)
24 |
25 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(1.631, 1.0903, 1.1, 1.8177, 1.1851, 1.2222, 0.482558065136853,
3 | 0.286625409572392, 0.300015001125094, 0.386110888426908, 0.388398088702211,
4 | 0.415745648737836, 0.00482558065136853, 0.00286625409572392,
5 | 0.00300015001125094, 0.00386110888426908, 0.00388398088702211,
6 | 0.00415745648737836, 0.00542034101330499, 0.00309836323629328,
7 | 0.00343841891074397, 0.00454083072307805, 0.00427799153737893,
8 | 0.00449885711522478), .Dim = as.integer(c(6, 4)), .Dimnames = list(
9 | c("smoking", "tuberculosis", "lung.cancer", "bronchitis",
10 | "either", "xray"), c("Mean", "SD", "Naive SE", "Time-series SE"
11 | )))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.525210658447999, 0.345942570818771, 0.474789341652999,
3 | 0.654057430399996, 1.5568, 1.365, 0.212549146870507, 0.233163894900116,
4 | 0.212549146798114, 0.233163896202967, 0.496788123694583, 0.481454234396149,
5 | 0.00212549146870507, 0.00233163894900116, 0.00212549146798114,
6 | 0.00233163896202968, 0.00496788123694583, 0.00481454234396149,
7 | 0.00245237262789446, 0.00280505408066832, 0.00245237261368732,
8 | 0.00280505408561749, 0.00564652653350452, 0.00594436023137488
9 | ), .Dim = as.integer(c(6, 4)), .Dimnames = list(c("theta.b[1,1]",
10 | "theta.b[2,1]", "theta.b[1,2]", "theta.b[2,2]", "smoking[2]",
11 | "smoking[3]"), c("Mean", "SD", "Naive SE", "Time-series SE")))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("asia-data.R")
3 | m <- jags.model("asia.bug", data, n.chains=2)
4 | update(m, 10000)
5 | x <- coda.samples(m, c("smoking","tuberculosis","lung.cancer","bronchitis",
6 | "either","xray"), n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "asia.bug"
2 | data in asia-data.R
3 | compile, nchains(2)
4 | initialize
5 | update 10000
6 | monitor smoking
7 | monitor tuberculosis
8 | monitor lung.cancer
9 | monitor bronchitis
10 | monitor either
11 | monitor xray
12 | update 10000
13 | coda *
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("asia2-data.R")
3 | m <- jags.model("asia2.bug", data, n.chains=2)
4 | update(m, 10000)
5 | x <- coda.samples(m, c("theta.b","smoking[2]","smoking[3]"), n.iter=10000)
6 | source("bench-test2.R")
7 | check.fun()
8 |
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/asia/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "asia2.bug"
2 | data in asia2-data.R
3 | compile, nchains(2)
4 | initialize
5 | update 10000
6 | monitor theta.b
7 | monitor smoking[2]
8 | monitor smoking[3]
9 | update 10000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/beetles-cloglog.bug:
--------------------------------------------------------------------------------
1 | var r[N], p[N], x[N], n[N], alpha, alpha.star, beta, r.hat[N], llike[N],
2 | llike.sat[N], D;
3 | model {
4 | for (i in 1:N) {
5 | r[i] ~ dbin(p[i], n[i]);
6 | cloglog(p[i]) <- alpha.star + beta*(x[i]-mean(x[]));
7 | # log likelihood for sample i & saturated log-likelihood:
8 | llike[i] <- r[i]*log(p[i]) + (n[i]-r[i])*log(1-p[i]);
9 | llike.sat[i] <- r[i]*log(r[i]/n[i]) + (n[i]-r[i])*log(1-r[i]/n[i]);
10 | r.hat[i] <- p[i]*n[i]; # fitted values
11 | }
12 | alpha.star ~ dnorm(0.0, 1.0E-3);
13 | beta ~ dnorm(0.0, 1.0E-3);
14 | alpha <- alpha.star - beta*mean(x[]);
15 |
16 | D <- 2 * (sum(llike.sat[]) - sum(llike[]));
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/beetles-data.R:
--------------------------------------------------------------------------------
1 | "x" <-
2 | c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.861, 1.8839
3 | )
4 | "n" <-
5 | c(59, 60, 62, 56, 63, 59, 62, 60)
6 | "r" <-
7 | c(6, 13, 18, 28, 52, 53, 61, 60)
8 | "N" <-
9 | 8
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/beetles-inits.R:
--------------------------------------------------------------------------------
1 | "alpha.star" <- 0
2 | "beta" <- 0
3 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/beetles-logit.bug:
--------------------------------------------------------------------------------
1 | var r[N], p[N], x[N], n[N], alpha, alpha.star, beta, r.hat[N], llike[N],
2 | llike.sat[N], D;
3 | model {
4 | for (i in 1:N) {
5 | r[i] ~ dbin(p[i], n[i]);
6 | logit(p[i]) <- alpha.star + beta*(x[i]-mean(x[]));
7 | # log likelihood for sample i & saturated log-likelihood:
8 | llike[i] <- r[i]*log(p[i]) + (n[i]-r[i])*log(1-p[i]);
9 | llike.sat[i] <- r[i]*log(r[i]/n[i]) + (n[i]-r[i])*log(1-r[i]/n[i]);
10 | r.hat[i] <- p[i]*n[i]; # fitted values
11 | }
12 | alpha.star ~ dnorm(0.0, 1.0E-3);
13 | beta ~ dnorm(0.0, 1.0E-3);
14 | alpha <- alpha.star - beta*mean(x[]);
15 |
16 | D <- 2 * (sum(llike.sat[]) - sum(llike[]));
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/beetles-probit.bug:
--------------------------------------------------------------------------------
1 | var r[N], p[N], x[N], n[N], alpha, alpha.star, beta, r.hat[N], llike[N],
2 | llike.sat[N], D;
3 | model {
4 | for (i in 1:N) {
5 | r[i] ~ dbin(p[i], n[i]);
6 | probit(p[i]) <- alpha.star + beta*(x[i]-mean(x[]));
7 | # log likelihood for sample i & saturated log-likelihood:
8 | llike[i] <- r[i]*log(p[i]) + (n[i]-r[i])*log(1-p[i]);
9 | llike.sat[i] <- r[i]*log(r[i]/n[i]) + (n[i]-r[i])*log(1-r[i]/n[i]);
10 | r.hat[i] <- p[i]*n[i]; # fitted values
11 | }
12 | alpha.star ~ dnorm(0.0, 1.0E-3);
13 | beta ~ dnorm(0.0, 1.0E-3);
14 | alpha <- alpha.star - beta*mean(x[]);
15 |
16 | D <- 2 * (sum(llike.sat[]) - sum(llike[]));
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("beetles-data.R")
3 | inits <- read.jagsdata("beetles-inits.R")
4 | m <- jags.model("beetles-logit.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha","beta","r.hat","D"), n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "beetles-logit.bug"
2 | data in "beetles-data.R"
3 | compile, nchains(2)
4 | parameters in "beetles-inits.R"
5 | initialize
6 | update 1000
7 | monitor alpha
8 | monitor beta
9 | monitor r.hat
10 | monitor D
11 | update 10000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("beetles-data.R")
3 | inits <- read.jagsdata("beetles-inits.R")
4 | m <- jags.model("beetles-probit.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha","beta","r.hat","D"), n.iter=10000)
7 | source("bench-test2.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "beetles-probit.bug"
2 | data in "beetles-data.R"
3 | compile, nchains(2)
4 | parameters in "beetles-inits.R"
5 | initialize
6 | update 1000
7 | monitor alpha
8 | monitor beta
9 | monitor r.hat
10 | monitor D
11 | update 10000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test3.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("beetles-data.R")
3 | inits <- read.jagsdata("beetles-inits.R")
4 | m <- jags.model("beetles-cloglog.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha","beta","r.hat","D"), n.iter=10000)
7 | source("bench-test3.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/beetles/test3.cmd:
--------------------------------------------------------------------------------
1 | model in "beetles-cloglog.bug"
2 | data in "beetles-data.R"
3 | compile, nchains(2)
4 | parameters in "beetles-inits.R"
5 | initialize
6 | update 1000
7 | monitor alpha
8 | monitor beta
9 | monitor r.hat
10 | monitor D
11 | update 10000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/biops/ReadMe:
--------------------------------------------------------------------------------
1 | JAGS version uses structural zeros in the Dirichlet distribution.
2 | When prior[i,j] is zero then error[i,j] is always zero.
3 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/biops/biops-inits.R:
--------------------------------------------------------------------------------
1 | `p` <-
2 | c(0.25, 0.25, 0.25, 0.25)
3 | `true` <-
4 | c(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
6 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
7 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
8 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
9 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
10 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
11 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4)
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/biops/biops.bug:
--------------------------------------------------------------------------------
1 | var
2 | biopsies[ns,4], # grades observed in ith session (multinomial)
3 | nbiops[ns], # total number of biopsies in ith session
4 | true[ns], # true state in ith session
5 | error[4,4], # error matrix in taking biopsies
6 | prior[4,4], # prior parameters for rows of error[,]
7 | p[4]; # underlying incidence of true states
8 | model {
9 | for (i in 1:ns){
10 | true[i] ~ dcat(p[]);
11 | biopsies[i,] ~ dmulti(error[true[i],],nbiops[i]);
12 | }
13 |
14 | for (j in 1:4) {
15 | error[j,] ~ ddirch(prior[j,]);
16 | }
17 |
18 | p[] ~ ddirch(prior[4,]); # prior for p
19 | }
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/biops/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("biops-data.R")
3 | inits <- read.jagsdata("biops-inits.R")
4 | m <- jags.model("biops.bug", data, inits, n.chains=2)
5 | update(m, 10000)
6 | x <- coda.samples(m, c("p","error[2,1]", "error[2,2]", "error[3,1]",
7 | "error[3,2]", "error[3,3]", "error[4,1]",
8 | "error[4,2]", "error[4,3]", "error[4,4]"), n.iter=10000)
9 | source("bench-test1.R")
10 | check.fun()
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/biops/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "biops.bug"
2 | data in "biops-data.R"
3 | compile, nchains(2)
4 | parameters in "biops-inits.R"
5 | initialize
6 | update 1000
7 | monitor p
8 | monitor error[2,1]
9 | monitor error[2,2]
10 | monitor error[3,1]
11 | monitor error[3,2]
12 | monitor error[3,3]
13 | monitor error[4,1]
14 | monitor error[4,2]
15 | monitor error[4,3]
16 | monitor error[4,4]
17 | update 10000
18 | coda *
19 |
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(242.512301, 6.18512567, 14.62717345, 0.520233164000001,
3 | 106.4395322, 2.78066951206617, 0.109256069818309, 2.13646517674223,
4 | 0.0924889008546236, 3.77407571491950, 0.0879324907831817, 0.00345498028824236,
5 | 0.0675609610013966, 0.00292475584986104, 0.119346753210739, 0.0860682334793566,
6 | 0.00360807992251437, 0.0721127921975163, 0.00289234950238049,
7 | 0.122620537131395), .Dim = as.integer(c(5, 4)), .Dimnames = list(
8 | c("mu.beta[1]", "mu.beta[2]", "sigma.beta[1]", "sigma.beta[2]",
9 | "alpha0"), c("Mean", "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(242.66551, 6.18540782, 14.6722047600000, 0.509244204999999,
3 | 0.6412921456, 106.5865509, 2.69616405185117, 0.105350017494226,
4 | 1.98887619549935, 0.0861279920212737, 0.135417660268152, 2.48747439083989,
5 | 0.08526019349318, 0.00333146006820337, 0.0628937876186827, 0.00272360625084034,
6 | 0.00428228241858249, 0.0786608469639393, 0.0951733845257033,
7 | 0.00338454185266790, 0.0556667040982965, 0.00261766818202372,
8 | 0.00411422261392546, 0.0802857436570838), .Dim = as.integer(c(6,
9 | 4)), .Dimnames = list(c("mu.beta[1]", "mu.beta[2]", "sigma.beta[1]",
10 | "sigma.beta[2]", "r", "alpha0"), c("Mean", "SD", "Naive SE",
11 | "Time-series SE")))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/bench-test3.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(106.596587, 6.18575126000001, 10.42905894, 0.502150715,
3 | 242.683101, 2.26387684797866, 0.106995689927564, 1.89231370410078,
4 | 0.0855579639527585, 2.87644508780233, 0.0715900718173534, 0.00338350079992239,
5 | 0.0598402135250836, 0.00270558038057300, 0.0909611804185837,
6 | 0.0808507122952663, 0.00379646195003598, 0.0677856643123738,
7 | 0.00292439342007822, 0.0960030908140512), .Dim = as.integer(c(5,
8 | 4)), .Dimnames = list(c("mu.beta[1]", "mu.beta[2]", "sigma.beta[1]",
9 | "sigma.beta[2]", "alpha0"), c("Mean", "SD", "Naive SE", "Time-series SE"
10 | )))
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/bench-test4.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(106.609298300000, 6.17942346, 10.81283172, 0.505396002,
3 | -0.0817642112753, 242.55659, 2.36249996848004, 0.109527255164421,
4 | 1.97246596486281, 0.086802587192141, 0.242860878024954, 2.85786048547763,
5 | 0.0747088087247292, 0.00346355592186011, 0.0623748505612814,
6 | 0.00274493882322525, 0.00767993529107189, 0.0903734836910388,
7 | 0.0754675554867296, 0.00343367094102554, 0.0639714835667876,
8 | 0.00287717396941173, 0.00808315789496544, 0.0924472421786709), .Dim = as.integer(c(6,
9 | 4)), .Dimnames = list(c("mu.beta[1]", "mu.beta[2]", "sigma.beta[1]",
10 | "sigma.beta[2]", "r", "alpha0"), c("Mean", "SD", "Naive SE",
11 | "Time-series SE")))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/birats-inits.R:
--------------------------------------------------------------------------------
1 | "beta" <-
2 | structure(c(100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
3 | 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
4 | 100, 100, 100, 100, 100, 100, 100, 6, 6, 6, 6, 6, 6, 6, 6, 6,
5 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
6 | ), .Dim = as.integer(c(30, 2)))
7 | "mu.beta" <-
8 | c(0, 0)
9 | "Omega.beta" <- structure(c(1, 0, 0, 1), .Dim=as.integer(c(2,2)))
10 | "tau.beta" <-
11 | c(1, 1)
12 | "tau.c" <-
13 | 1
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("birats-data.R")
3 | inits <- read.jagsdata("birats-inits.R")
4 | m <- jags.model("birats1.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("mu.beta","sigma.beta","alpha0"), thin=10, n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "birats1.bug"
2 | data in birats-data.R
3 | compile, nchains(2)
4 | inits in birats-inits.R
5 | initialize
6 | update 1000
7 | monitor mu.beta, thin(10)
8 | monitor sigma.beta, thin(10)
9 | monitor alpha0, thin(10)
10 | update 10000
11 | coda *
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("birats-data.R")
3 | inits <- read.jagsdata("birats-inits.R")
4 | m <- jags.model("birats2.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("mu.beta","sigma.beta","r", "alpha0"), thin=10,
7 | n.iter=10000)
8 | source("bench-test2.R")
9 | check.fun()
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "birats2.bug"
2 | data in birats-data.R
3 | compile, nchains(2)
4 | inits in birats-inits.R
5 | initialize
6 | update 1000
7 | monitor mu.beta, thin(10)
8 | monitor sigma.beta, thin(10)
9 | monitor r, thin(10)
10 | monitor alpha0, thin(10)
11 | update 10000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test3.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("birats-data.R")
3 | inits <- read.jagsdata("birats-inits.R")
4 | m <- jags.model("birats3.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("mu.beta","sigma.beta","alpha0"), thin=10,
7 | n.iter=10000)
8 | source("bench-test3.R")
9 | check.fun()
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test3.cmd:
--------------------------------------------------------------------------------
1 | model in "birats3.bug"
2 | data in birats-data.R
3 | compile, nchains(2)
4 | inits in birats-inits.R
5 | initialize
6 | update 1000
7 | monitor mu.beta, thin(10)
8 | monitor sigma.beta, thin(10)
9 | monitor alpha0, thin(10)
10 | update 10000
11 | coda *
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test4.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("birats-data.R")
3 | inits <- read.jagsdata("birats-inits.R")
4 | m <- jags.model("birats4.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("mu.beta","sigma.beta","r", "alpha0"), thin=10,
7 | n.iter=10000)
8 | source("bench-test4.R")
9 | check.fun()
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/birats/test4.cmd:
--------------------------------------------------------------------------------
1 | model in "birats4.bug"
2 | data in birats-data.R
3 | compile, nchains(2)
4 | inits in birats-inits.R
5 | initialize
6 | update 1000
7 | monitor mu.beta, thin(10)
8 | monitor sigma.beta, thin(10)
9 | monitor r, thin(10)
10 | monitor alpha0, thin(10)
11 | update 10000
12 | coda *
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/cervix/ReadMe:
--------------------------------------------------------------------------------
1 | The epidemiology in this example is a little out of date. It is now known
2 | that Human Papillomavirus (HPV) is a necessary cause of cervical cancer.
3 | Although HSV-2 may have a role as a cofactor in some cases, trying to
4 | model its effect on cervical cancer without taking into account HPV is
5 | rather pointless.
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/cervix/cervix-inits.R:
--------------------------------------------------------------------------------
1 | "beta0" <-
2 | 0
3 | "beta" <-
4 | 0
5 | "q" <-
6 | 0.5
7 | "phi" <-
8 | structure(c(0.5, 0.5, 0.5, 0.5), .Dim = as.integer(c(2, 2)))
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/cervix/test1.R:
--------------------------------------------------------------------------------
1 | load.module("glm")
2 | m <- jags.model("cervix.bug", data=read.data("cervix-data.R"),
3 | inits=read.data("cervix-inits.R"), n.chain=2)
4 | update(m, 1000)
5 | x <- coda.samples(m, c("beta0C","beta","phi","gamma1","gamma2"),
6 | n.iter=10000, thin=10)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/cervix/test1.cmd:
--------------------------------------------------------------------------------
1 | load glm
2 | model in "cervix.bug"
3 | data in "cervix-data.R"
4 | compile, nchains(2)
5 | parameters in "cervix-inits.R"
6 | initialize
7 | update 1000
8 | monitor beta0C, thin(10)
9 | monitor beta, thin(10)
10 | monitor phi, thin(10)
11 | monitor gamma1, thin(10)
12 | monitor gamma2, thin(10)
13 | update 10000
14 | coda *
15 |
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(1.86734593050999, 2.65550706999999, 0.976866162000004,
3 | 0.862622853, 0.0993965308999997, 0.288028864815654, 0.0738703034051412,
4 | 0.0788082243785414, 0.0361326586182234, 0.0155265477362125, 0.00288028864815654,
5 | 0.000738703034051412, 0.000788082243785414, 0.000361326586182234,
6 | 0.000155265477362125, 0.00505762524854399, 0.00129773683846219,
7 | 0.00135515901718672, 0.000634560717168502, 0.000184674606469514
8 | ), .Dim = as.integer(c(5, 4)), .Dimnames = list(c("U3", "alpha",
9 | "beta", "gamma", "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE"
10 | )))
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/dugongs-data.R:
--------------------------------------------------------------------------------
1 | "N" <- 27
2 | "M" <- 128
3 | "x" <-
4 | c(1, 1.5, 1.5, 1.5, 2.5, 4, 5, 5, 7, 8, 8.5, 9, 9.5, 9.5, 10,
5 | 12, 12, 13, 13, 14.5, 15.5, 15.5, 16.5, 17, 22.5, 29, 31.5)
6 | "Y" <-
7 | c(1.8, 1.85, 1.87, 1.77, 2.02, 2.27, 2.15, 2.26, 2.47, 2.19,
8 | 2.26, 2.4, 2.39, 2.41, 2.5, 2.32, 2.32, 2.43, 2.47, 2.56, 2.65,
9 | 2.47, 2.64, 2.56, 2.7, 2.72, 2.57)
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/dugongs-inits.R:
--------------------------------------------------------------------------------
1 | "tau" <-
2 | 1
3 | "alpha" <-
4 | 1
5 | "beta" <-
6 | 1
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/dugongs.bug:
--------------------------------------------------------------------------------
1 | # This is the WinBUGS version of the DUGONGS model, without discretization
2 | # of the variable gamma (This was done due to a technical limitation of
3 | # classic BUGS: it could only sample from log concave distributions)
4 | #
5 | var
6 | x[N],Y[N],mu[N],alpha,beta,gamma,tau,sigma,p[M],U1,U2,U3;
7 | model {
8 | for (i in 1:N) {
9 | mu[i] <- alpha - beta * gamma^x[i]
10 | Y[i] ~ dnorm(mu[i], tau)
11 | }
12 | alpha ~ dnorm(0.0, 1.0E-6)
13 | beta ~ dnorm(0.0, 1.0E-6)
14 | gamma ~ dunif(0.5, 1)
15 | tau ~ dgamma(1.0E-3, 1.0E-3)
16 | sigma <- 1.0/sqrt(tau)
17 | U3 <- logit(gamma)
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("dugongs-data.R")
3 | inits <- read.jagsdata("dugongs-inits.R")
4 | m <- jags.model("dugongs.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("U3","alpha","beta","gamma","sigma"), n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/dugongs/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "dugongs.bug"
2 | data in "dugongs-data.R"
3 | compile, nchains(2)
4 | parameters in "dugongs-inits.R"
5 | initialize
6 | update 1000
7 | monitor U3
8 | monitor alpha
9 | monitor beta
10 | monitor gamma
11 | monitor sigma
12 | update 10000
13 | coda *
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/ReadMe:
--------------------------------------------------------------------------------
1 | EYES.BUG
2 | The chain can get stuck in a state where all of the observations are in
3 | one group, even with the parameterization suggested by Robert.
4 |
5 | EYES2.BUG
6 | Illustrates a technique for getting rid of the sticky state of
7 | the Gibbs sampler. We condition on their being at least one
8 | observation in each state using the dinterval distribution.
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.5994429576, 0.400557042185, 536.804023499999, 548.768464000001,
3 | 3.83709772, 0.0990720457214025, 0.0990720430764442, 1.03330045623922,
4 | 1.48279418598907, 0.79060374359289, 0.00221531828903023, 0.00221531822988717,
5 | 0.0231053006133244, 0.0331562859651304, 0.0176784371393952, 0.00249303573471148,
6 | 0.00249303558687303, 0.0256899148269664, 0.0415524434234884,
7 | 0.0248596861678153), .Dim = as.integer(c(5, 4)), .Dimnames = list(
8 | c("P[1]", "P[2]", "lambda[1]", "lambda[2]", "sigma"), c("Mean",
9 | "SD", "Naive SE", "Time-series SE")))
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/eyes-data.R:
--------------------------------------------------------------------------------
1 | "N" <- 48
2 | "y" <- c(529.0,530.0,532.0,533.1,533.4,533.6,533.7,534.1,534.8,535.3,
3 | 535.4,535.9,536.1,536.3,536.4,536.6,537.0,537.4,537.5,538.3,
4 | 538.5,538.6,539.4,539.6,540.4,540.8,542.0,542.8,543.0,543.5,
5 | 543.8,543.9,545.3,546.2,548.8,548.7,548.9,549.0,549.4,549.9,
6 | 550.6,551.2,551.4,551.5,551.6,552.8,552.9,553.2)
7 | "Itot" <- c(1,1)
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/eyes-inits.R:
--------------------------------------------------------------------------------
1 | "lambda" <- c(535,NA)
2 | "theta" <- 5
3 | "tau" <- 0.1
4 | "T" <- c(1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,
5 | 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/eyes.dat:
--------------------------------------------------------------------------------
1 | 529.0
2 | 530.0
3 | 532.0
4 | 533.1
5 | 533.4
6 | 533.6
7 | 533.7
8 | 534.1
9 | 534.8
10 | 535.3
11 | 535.4
12 | 535.9
13 | 536.1
14 | 536.3
15 | 536.4
16 | 536.6
17 | 537.0
18 | 537.4
19 | 537.5
20 | 538.3
21 | 538.5
22 | 538.6
23 | 539.4
24 | 539.6
25 | 540.4
26 | 540.8
27 | 542.0
28 | 542.8
29 | 543.0
30 | 543.5
31 | 543.8
32 | 543.9
33 | 545.3
34 | 546.2
35 | 548.8
36 | 548.7
37 | 548.9
38 | 549.0
39 | 549.4
40 | 549.9
41 | 550.6
42 | 551.2
43 | 551.4
44 | 551.5
45 | 551.6
46 | 552.8
47 | 552.9
48 | 553.2
49 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/notest2.cmd:
--------------------------------------------------------------------------------
1 | model in "eyes.bug"
2 | data in "eyes-data.R"
3 | load mix
4 | compile, nchains(2)
5 | parameters in "eyes-inits1.R"
6 | initialize
7 | update 5000
8 | monitor P
9 | monitor lambda
10 | monitor sigma
11 | monitor l0
12 | update 5000
13 | coda *
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("eyes-data.R")
3 | inits <- read.jagsdata("eyes-inits.R")
4 | m <- jags.model("eyes2.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("P", "lambda","sigma"), thin=20, n.iter=40000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/eyes/test1.cmd:
--------------------------------------------------------------------------------
1 | /* We put a restriction on the mixture model, so that each group has at
2 | least one observation. This is done by *pretending* that we have
3 | some extra data: a censored indicator of the number of observations
4 | in each group that tells us that there is at least one member.
5 |
6 | This may or may not be cheating.
7 | */
8 | model in "eyes2.bug"
9 | data in "eyes-data.R"
10 | compile, nchains(2)
11 | parameters in "eyes-inits.R"
12 | initialize
13 | update 1000
14 | monitor P, thin(20)
15 | monitor lambda, thin(20)
16 | monitor sigma, thin(20)
17 | update 40000
18 | coda *
19 |
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.571914840969999, 0.6445696277, 0.385128215899999,
3 | 0.143857530415474, 0.177660552486358, 0.0637914441007439, 0.00143857530415474,
4 | 0.00177660552486358, 0.000637914441007439, 0.00184452304555932,
5 | 0.00235126125425839, 0.000845793980743727), .Dim = as.integer(c(3,
6 | 4)), .Dimnames = list(c("theta", "beta", "p"), c("Mean", "SD",
7 | "Naive SE", "Time-series SE")))
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/hearts-data.R:
--------------------------------------------------------------------------------
1 | "N" <- 12
2 | "x" <-
3 | c(6, 9, 17, 22, 7, 5, 5, 14, 9, 7, 9, 51)
4 | "y" <-
5 | c(5, 2, 0, 0, 2, 1, 0, 0, 0, 0, 13, 0)
6 | "t" <-
7 | c(11, 11, 17, 22, 9, 6, 5, 14, 9, 7, 22, 51)
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/hearts-inits.R:
--------------------------------------------------------------------------------
1 | "delta" <- 0
2 | "alpha" <- 0
3 | "state" <- c(0,0,0,0,0,0,0,0,0,0,0,0)
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/hearts.dat:
--------------------------------------------------------------------------------
1 | 6 5 11
2 | 9 2 11
3 | 17 0 17
4 | 22 0 22
5 | 7 2 9
6 | 5 1 6
7 | 5 0 5
8 | 14 0 14
9 | 9 0 9
10 | 7 0 7
11 | 9 13 22
12 | 51 0 51
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("hearts-data.R")
3 | inits <- read.jagsdata("hearts-inits.R")
4 | m <- jags.model("hearts.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("theta", "beta","p"), thin=20, n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/hearts/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "hearts.bug"
2 | data in "hearts-data.R"
3 | compile, nchains(2)
4 | parameters in "hearts-inits.R"
5 | initialize
6 | update 1000
7 | monitor theta
8 | monitor beta
9 | monitor p
10 | update 10000
11 | coda *
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/ice/ReadMe:
--------------------------------------------------------------------------------
1 | JAGS cannot run the conditional autoregressive model because it creates
2 | directed cycles in the model.
3 |
4 | The estimate of sigma given by JAGS is somewhat larger than the
5 | one produced by BUGS.
6 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/ice/ice-inits.R:
--------------------------------------------------------------------------------
1 | "tau" <- 1
2 | "alpha" <- c(NA,0,0,0,0,0,0,0,0,0,0,0,0)
3 | "beta" <- c(0.05,0.1,0,0,0,0,0,0,0,0,0)
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/ice/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "icear.bug"
2 | data in "ice-data.R"
3 | compile, nchains(2)
4 | parameters in "ice-inits.R"
5 | initialize
6 | update 10000
7 | monitor sigma, thin(100)
8 | monitor logRR, thin(100)
9 | update 100000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/ReadMe:
--------------------------------------------------------------------------------
1 | In the linear and quadratic models, age has been centred to improve
2 | autocorrelation. In the quadratic model, the posterior distribution
3 | of beta2 is much broader than the results reported in the BUGS manual.
4 | Consequently, there is poor agreement with the estimates of beta0,
5 | beta1 and beta2. However, the linear predictors mu[1] .. mu[4] are
6 | in good agreement.
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/jaw-data.R:
--------------------------------------------------------------------------------
1 | "M" <-
2 | 4
3 | "N" <-
4 | 20
5 | "PI" <- 3.14159
6 | "Y" <-
7 | structure(c(47.8, 46.4, 46.3, 45.1, 47.6, 52.5, 51.2, 49.8, 48.1,
8 | 45, 51.2, 48.5, 52.1, 48.2, 49.6, 50.7, 47.2, 53.3, 46.2, 46.3,
9 | 48.8, 47.3, 46.8, 45.3, 48.5, 53.2, 53, 50, 50.8, 47, 51.4, 49.2,
10 | 52.8, 48.9, 50.4, 51.7, 47.7, 54.6, 47.5, 47.6, 49, 47.7, 47.8,
11 | 46.1, 48.9, 53.3, 54.3, 50.3, 52.3, 47.3, 51.6, 53, 53.7, 49.3,
12 | 51.2, 52.7, 48.4, 55.1, 48.1, 51.3, 49.7, 48.4, 48.5, 47.2, 49.3,
13 | 53.7, 54.5, 52.7, 54.4, 48.3, 51.9, 55.5, 55, 49.8, 51.8, 53.3,
14 | 49.5, 55.3, 48.4, 51.8), .Dim = as.integer(c(20, 4)))
15 | "age" <-
16 | c(8, 8.5, 9, 9.5)
17 | "R" <-
18 | structure(c(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), .Dim = c(4,
19 | 4))
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/jaw-inits.R:
--------------------------------------------------------------------------------
1 | "beta0" <-
2 | 40
3 | "beta1" <-
4 | 0
5 | "beta2" <-
6 | 0
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("jaw-data.R")
3 | inits <- read.jagsdata("jaw-inits.R")
4 | m <- jags.model("jaw-constant.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | load.module("dic")
7 | x <- coda.samples(m, c("beta0", "mu", "Sigma2", "RSS", "deviance"),
8 | n.iter=10000)
9 | source("bench-test1.R")
10 | check.fun()
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "jaw-constant.bug"
2 | data in "jaw-data.R"
3 | compile, nchains(2)
4 | parameters in "jaw-inits.R"
5 | initialize
6 | load dic
7 | update 1000
8 | monitor beta0
9 | monitor mu
10 | monitor Sigma2
11 | monitor RSS
12 | monitor deviance
13 | update 10000
14 | coda *
15 |
16 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("jaw-data.R")
3 | inits <- read.jagsdata("jaw-inits.R")
4 | m <- jags.model("jaw-linear.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | load.module("dic")
7 | x <- coda.samples(m,
8 | c("beta0.uncentred","beta1","Sigma2","mu","RSS","deviance"),
9 | n.iter=10000)
10 | source("bench-test2.R")
11 | check.fun()
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "jaw-linear.bug"
2 | data in "jaw-data.R"
3 | compile, nchains(2)
4 | parameters in "jaw-inits.R"
5 | initialize
6 | load dic
7 | update 1000
8 | monitor beta0.uncentred
9 | monitor beta1
10 | monitor Sigma2
11 | monitor mu
12 | monitor RSS
13 | monitor deviance
14 | update 10000
15 | coda *
16 |
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test3.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("jaw-data.R")
3 | inits <- read.jagsdata("jaw-inits.R")
4 | m <- jags.model("jaw-quadratic.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | load.module("dic")
7 | x <- coda.samples(m, c("beta0","beta1","beta0.uncentred","beta1.uncentred",
8 | "beta2","Sigma2","mu","RSS","deviance"),
9 | n.iter=10000)
10 | source("bench-test3.R")
11 | check.fun()
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/jaw/test3.cmd:
--------------------------------------------------------------------------------
1 | model in "jaw-quadratic.bug"
2 | data in "jaw-data.R"
3 | compile, nchains(2)
4 | parameters in "jaw-inits.R"
5 | initialize
6 | load dic
7 | update 1000
8 | monitor beta0
9 | monitor beta1
10 | monitor beta0.uncentred
11 | monitor beta1.uncentred
12 | monitor beta2
13 | monitor Sigma2
14 | monitor mu
15 | monitor RSS
16 | monitor deviance
17 | update 10000
18 | coda *
19 |
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/bench-test1.R:
--------------------------------------------------------------------------------
1 | `benchstats` <-
2 | structure(c(5.254817041, 2.214157841, -5.860410139, 0.23265311001,
3 | 0.13371480616, 0.1001825476, 8.055812192, 0.129185436223467,
4 | 0.121008288926782, 0.105850857526118, 0.126178766630887, 0.109370060863441,
5 | 0.0845108559381675, 1.23603736962342, 0.00129185436223467, 0.00121008288926782,
6 | 0.00105850857526118, 0.00126178766630887, 0.00109370060863441,
7 | 0.000845108559381675, 0.0123603736962342, 0.00536652167265231,
8 | 0.00824408797381219, 0.0109455627018243, 0.00385926935374009,
9 | 0.00383472494693853, 0.00612342043876554, 0.0341873514432241), .Dim = as.integer(c(7,
10 | 4)), .Dimnames = list(c("mu[1]", "mu[2]", "mu[3]", "sigma[1]",
11 | "sigma[2]", "sigma[3]", "sigmaC"), c("Mean", "SD", "Naive SE",
12 | "Time-series SE")))
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/bench-test2.R:
--------------------------------------------------------------------------------
1 | `benchstats` <-
2 | structure(c(5.267767678, 2.19825122035, -5.878231292, 0.25772246908,
3 | 0.27418367272, 0.22958711222, 7.825512028, 0.136485975762224,
4 | 0.193303711509264, 0.144302704132850, 0.114427792103230, 0.153146226506097,
5 | 0.107397445281785, 1.17409428491240, 0.00136485975762224, 0.00193303711509264,
6 | 0.00144302704132850, 0.00114427792103230, 0.00153146226506097,
7 | 0.00107397445281785, 0.0117409428491240, 0.00420845002841319,
8 | 0.0102560694439103, 0.00592153558176224, 0.00256692514089797,
9 | 0.00820144064743893, 0.00252259132615289, 0.0205633213063669), .Dim = as.integer(c(7,
10 | 4)), .Dimnames = list(c("mu[1]", "mu[2]", "mu[3]", "sigma[1]",
11 | "sigma[2]", "sigma[3]", "sigmaC"), c("Mean", "SD", "Naive SE",
12 | "Time-series SE")))
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/mvotree-data.R:
--------------------------------------------------------------------------------
1 | "n" <-
2 | 7
3 | "K" <-
4 | 5
5 | "x" <-
6 | c(118, 484, 664, 1004, 1231, 1372, 1582)
7 | "Y" <-
8 | structure(c(30, 33, 30, 32, 30, 58, 69, 51, 62, 49, 87, 111,
9 | 75, 112, 81, 115, 156, 108, 167, 125, 120, 172, 115, 179, 142,
10 | 142, 203, 139, 209, 174, 145, 203, 140, 214, 177), .Dim = as.integer(c(5,
11 | 7)))
12 | "mean" <-
13 | c(0, 0, 0)
14 | "R" <-
15 | structure(c(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1), .Dim = as.integer(c(3,
16 | 3)))
17 | "prec" <-
18 | structure(c(1e-06, 0, 0, 0, 1e-06, 0, 0, 0, 1e-06), .Dim = as.integer(c(3,
19 | 3)))
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/mvotree-inits.R:
--------------------------------------------------------------------------------
1 | "theta" <-
2 | structure(c(5, 5, 5, 5, 5, 2, 2, 2, 2, 2, -6, -6, -6, -6, -6), .Dim = as.integer(c(5,
3 | 3)))
4 | "mu" <-
5 | c(5, 2, -6)
6 | "tau" <-
7 | structure(c(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1), .Dim = as.integer(c(3,
8 | 3)))
9 | "tauC" <-
10 | 20
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/mvotree.bug:
--------------------------------------------------------------------------------
1 | var
2 | tauC,mu[3],mean[3],prec[3,3],tau[3,3], Y[K,n], phi[K,3],theta[K,3],
3 | sigmaC,sigma[3],x[n], R[3,3], eta[K,n], sigma2[3,3];
4 | model {
5 | for (i in 1:K) {
6 | for (j in 1:n) {
7 | Y[i, j] ~ dnorm(eta[i, j], tauC)
8 | eta[i, j] <- phi[i, 1] / (1 + phi[i, 2] * exp(phi[i, 3] * x[j]))
9 | }
10 | phi[i, 1] <- exp(theta[i, 1])
11 | phi[i, 2] <- exp(theta[i, 2]) - 1
12 | phi[i, 3] <- -exp(theta[i, 3])
13 | theta[i, 1:3] ~ dmnorm(mu, tau)
14 | }
15 | mu[1:3] ~ dmnorm(mean, prec)
16 | tau[1:3,1:3] ~ dwish(R, 3)
17 | sigma2[1:3,1:3] <- inverse(tau)
18 | for (i in 1:3) {
19 | sigma[i] <- sqrt(sigma2[i, i])
20 | }
21 | tauC ~ dgamma(1.0E-3, 1.0E-3)
22 | sigmaC <- 1 / sqrt(tauC)
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/orange-data.R:
--------------------------------------------------------------------------------
1 | "n" <-
2 | 7
3 | "K" <-
4 | 5
5 | "x" <-
6 | c(118, 484, 664, 1004, 1231, 1372, 1582)
7 | "Y" <-
8 | structure(c(30, 33, 30, 32, 30, 58, 69, 51, 62, 49, 87, 111,
9 | 75, 112, 81, 115, 156, 108, 167, 125, 120, 172, 115, 179, 142,
10 | 142, 203, 139, 209, 174, 145, 203, 140, 214, 177), .Dim = as.integer(c(5,
11 | 7)))
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/orange-inits.R:
--------------------------------------------------------------------------------
1 | "theta" <-
2 | structure(c(5, 5, 5, 5, 5, 2, 2, 2, 2, 2, -6, -6, -6, -6, -6), .Dim = as.integer(c(5,
3 | 3)))
4 | "mu" <-
5 | c(5, 2, -6)
6 | "tau" <-
7 | c(20, 20, 20)
8 | "tauC" <-
9 | 20
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/otree.bug:
--------------------------------------------------------------------------------
1 | var
2 | tauC,mu[3],tau[3], Y[K,n],mean[K,n],phi[K,3],theta[K,3],
3 | lower[3],upper[3],sigmaC,sigma[3],x[n];
4 | model {
5 | for (i in 1:K) {
6 | for (j in 1:n) {
7 | Y[i, j] ~ dnorm(mean[i, j], tauC)
8 | mean[i, j] <- phi[i, 1] / (1 + phi[i, 2] * exp(phi[i, 3] * x[j]))
9 | }
10 | phi[i, 1] <- exp(theta[i, 1])
11 | phi[i, 2] <- exp(theta[i, 2]) - 1
12 | phi[i, 3] <- -exp(theta[i, 3])
13 | for (k in 1:3) {
14 | theta[i, k] ~ dnorm(mu[k], tau[k])
15 | }
16 | }
17 | tauC ~ dgamma(1.0E-3, 1.0E-3)
18 | sigmaC <- 1 / sqrt(tauC)
19 | for (k in 1:3) {
20 | mu[k] ~ dnorm(0, 1.0E-4)
21 | tau[k] ~ dgamma(1.0E-3, 1.0E-3)
22 | sigma[k] <- 1 / sqrt(tau[k])
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/otree.dat:
--------------------------------------------------------------------------------
1 |
2 | list(x = c(118.00, 484.00, 664.00, 1004.00, 1231.00, 1372.00, 1582.00),
3 | lower = c(4, 1, -7), upper = c(6, 3, -5),
4 | Y = structure(
5 | .Data = c(30.00, 58.00, 87.00, 115.00, 120.00, 142.00, 145.00,
6 | 33.00, 69.00, 111.00, 156.00, 172.00, 203.00, 203.00,
7 | 30.00, 51.00, 75.00, 108.00, 115.00, 139.00, 140.00,
8 | 32.00, 62.00, 112.00, 167.00, 179.00, 209.00, 214.00,
9 | 30.00, 49.00, 81.00, 125.00, 142.00, 174.00, 177.00),
10 | .Dim = c(5, 7)))
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/otree.in:
--------------------------------------------------------------------------------
1 | list(theta = structure(
2 | .Data = c(5, 2, -6,
3 | 5, 2, -6,
4 | 5, 2, -6,
5 | 5, 2, -6,
6 | 5, 2, -6),
7 | .Dim = c(5, 3)),
8 | mu = c(5, 2, -6), tau = c(20, 20, 20), tauC = 20)
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("orange-data.R")
3 | inits <- read.jagsdata("orange-inits.R")
4 | m <- jags.model("otree.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("mu","sigma","sigmaC"), n.iter=10000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/test1.cmd:
--------------------------------------------------------------------------------
1 | model in otree.bug
2 | data in orange-data.R
3 | compile, nchains(2)
4 | parameters in orange-inits.R
5 | initialize
6 | update 1000
7 | monitor mu
8 | monitor sigma
9 | monitor sigmaC
10 | update 10000
11 | coda *
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("mvotree-data.R")
3 | inits <- read.jagsdata("mvotree-inits.R")
4 | m <- jags.model("mvotree.bug", data, inits, n.chains=2, n.adapt=5000)
5 | update(m, 5000)
6 | x <- coda.samples(m, c("mu","sigma","sigmaC"), n.iter=100000, thin=10)
7 | source("bench-test2.R")
8 | check.fun()
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/orange/test2.cmd:
--------------------------------------------------------------------------------
1 | model in mvotree.bug
2 | data in mvotree-data.R
3 | compile, nchains(2)
4 | parameters in mvotree-inits.R
5 | initialize
6 | update 10000
7 | monitor mu, thin(10)
8 | monitor sigma, thin(10)
9 | monitor sigmaC, thin(10)
10 | update 100000
11 | coda *
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/pigs/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.624135882290002, 0.0618, 0.160675550748061, 0.240803983887031,
3 | 0.00160675550748061, 0.00240803983887031, 0.00162052442426239,
4 | 0.00233260390635399), .Dim = as.integer(c(2, 4)), .Dimnames = list(
5 | c("p", "i[3]"), c("Mean", "SD", "Naive SE", "Time-series SE"
6 | )))
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/pigs/pigs-data.R:
--------------------------------------------------------------------------------
1 | "p.mendelian" <-
2 | structure(c(1, 0.5, 0, 0.5, 0.25, 0, 0, 0, 0, 0, 0.5, 1, 0.5,
3 | 0.5, 0.5, 1, 0.5, 0, 0, 0, 0, 0, 0.25, 0.5, 0, 0.5, 1), .Dim = as.integer(c(3,
4 | 3, 3)))
5 | "p.recessive" <-
6 | structure(c(1, 1, 0, 0, 0, 1), .Dim = as.integer(c(3, 2)))
7 | "A1" <-
8 | 1
9 | "B1" <-
10 | 1
11 | "C1" <-
12 | 1
13 | "D1" <-
14 | 1
15 | "E1" <-
16 | 1
17 | "F1" <-
18 | 1
19 | "G1" <-
20 | 1
21 | "H1" <-
22 | 1
23 | "J1" <-
24 | 2
25 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/pigs/pigs-inits.R:
--------------------------------------------------------------------------------
1 | "Ann1" <-
2 | 0
3 | "Brian1" <-
4 | 0
5 | "Clare" <-
6 | 1
7 | "Diane" <-
8 | 1
9 | "Eric1" <-
10 | 1
11 | "Fred" <-
12 | 1
13 | "Gene" <-
14 | 2
15 | "Henry1" <-
16 | 1
17 | "Ian" <-
18 | 1
19 | "Jane" <-
20 | 3
21 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/pigs/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("pigs-data.R")
3 | inits <- read.jagsdata("pigs-inits.R")
4 | m <- jags.model("pigs.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("p", "i[3]"), thin=5, n.iter=50000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/pigs/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "pigs.bug"
2 | data in "pigs-data.R"
3 | compile, nchains(2)
4 | parameters in "pigs-inits.R"
5 | initialize
6 | update 1000
7 | monitor p, thin(5)
8 | monitor i[3], thin(5)
9 | update 50000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/schools/schools-inits.R:
--------------------------------------------------------------------------------
1 | "theta" <-
2 | 0
3 | "phi" <-
4 | 0.01
5 | "gamma" <-
6 | c(0, 0, 0)
7 | "beta" <-
8 | c(0, 0, 0, 0, 0, 0, 0, 0)
9 | "T" <-
10 | structure(c(10, -3, -3, -3, 135, -65, -3, -65, 135), .Dim = as.integer(c(3,
11 | 3)))
12 | "alpha" <-
13 | structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = as.integer(c(38,
19 | 3)))
20 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/schools/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("schools-data.R")
3 | inits <- read.jagsdata("schools-inits.R")
4 | load.module("glm")
5 | m <- jags.model("schools.bug", data, inits, n.chains=2)
6 | update(m, 1000)
7 | x <- coda.samples(m, c("beta","gamma","phi","theta"), n.iter=10000)
8 | source("bench-test1.R")
9 | check.fun()
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/schools/test1.cmd:
--------------------------------------------------------------------------------
1 | load glm
2 | model in schools.bug
3 | data in schools-data.R
4 | compile, nchains(2)
5 | parameters in schools-inits.R
6 | initialize
7 | update 1000
8 | monitor beta
9 | monitor gamma
10 | monitor phi
11 | monitor theta
12 | update 10000
13 | coda *
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/ReadMe:
--------------------------------------------------------------------------------
1 | notest1.cmd and notest2.cmd run the same changepoint problem with
2 | different starting points. As pointed out in the WinBUGS manual.
3 | This parameterization leads to very poor mixing, hence these examples
4 | are not included in the test suite. You can run them with:
5 |
6 | jags notest3.cmd
7 | jags notest4.cmd
8 |
9 | Then from within R you can then analyze the results with the coda package
10 |
11 | coda
12 | x <- mcmc.list(read.coda("stag1"), read.coda("stag2"))
13 | plot(x)
14 |
15 | test1.cmd and test2.cmd run the changepoint problem with a better
16 | parameterization
17 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/bench-test1.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.5345781815, 0.0287800754782132, 0.025825066670586,
3 | 0.0327484617752981, 0.00025825066670586, 0.000327484617752981,
4 | 0.000466971264972828, 0.000601654259217391), .Dim = as.integer(c(2,
5 | 4)), .Dimnames = list(c("alpha", "x.change"), c("Mean", "SD",
6 | "Naive SE", "Time-series SE")))
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/bench-test2.R:
--------------------------------------------------------------------------------
1 | "benchstats" <-
2 | structure(c(0.536026504500002, 0.0270935518552936, 0.0258906539343350,
3 | 0.0327888006697751, 0.000258906539343350, 0.000327888006697751,
4 | 0.000465505559069793, 0.000593331905220644), .Dim = as.integer(c(2,
5 | 4)), .Dimnames = list(c("alpha", "x.change"), c("Mean", "SD",
6 | "Naive SE", "Time-series SE")))
7 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/notest3.cmd:
--------------------------------------------------------------------------------
1 | load glm
2 | model in "stagnant.bug"
3 | data in "stagnant-data.R"
4 | compile, nchains(2)
5 | parameters in "stagnant-inits1.R"
6 | initialize
7 | update 1000
8 | monitor alpha, thin(10)
9 | monitor beta, thin(10)
10 | monitor k, thin(10)
11 | update 10000
12 | coda *, stem("stag1")
13 |
14 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/notest4.cmd:
--------------------------------------------------------------------------------
1 | model in "stagnant.bug"
2 | data in "stagnant-data.R"
3 | compile, nchains(2)
4 | parameters in "stagnant-inits2.R"
5 | initialize
6 | update 1000
7 | monitor alpha, thin(10)
8 | monitor beta, thin(10)
9 | monitor k, thin(10)
10 | update 10000
11 | coda *, stem("stag2")
12 |
13 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant-data.R:
--------------------------------------------------------------------------------
1 | "N" <- 29
2 | "x" <-
3 | c(-1.39, -1.39, -1.08, -1.08, -0.94, -0.8, -0.63, -0.63, -0.25,
4 | -0.25, -0.12, -0.12, 0.01, 0.11, 0.11, 0.11, 0.25, 0.25, 0.34,
5 | 0.34, 0.44, 0.59, 0.7, 0.7, 0.85, 0.85, 0.99, 0.99, 1.19)
6 | "Y" <-
7 | c(1.12, 1.12, 0.99, 1.03, 0.92, 0.9, 0.81, 0.83, 0.65, 0.67,
8 | 0.6, 0.59, 0.51, 0.44, 0.43, 0.43, 0.33, 0.3, 0.25, 0.24, 0.13,
9 | -0.01, -0.13, -0.14, -0.3, -0.33, -0.46, -0.43, -0.65)
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant-inits1.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | 0.2
3 | "beta" <-
4 | c(-0.45, -1)
5 | "tau" <-
6 | 5
7 | "k" <-
8 | 16
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant-inits2.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | 0.6
3 | "beta" <-
4 | c(-0.45, -1)
5 | "tau" <-
6 | 5
7 | "k" <-
8 | 8
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant-inits3.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | 0.47
3 | "beta" <-
4 | c(-0.45, -1)
5 | "tau" <-
6 | 5
7 | "x.change" <-
8 | 0.5
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant-inits4.R:
--------------------------------------------------------------------------------
1 | "alpha" <-
2 | 0.47
3 | "beta" <-
4 | c(-0.45, -1)
5 | "tau" <-
6 | 5
7 | "x.change" <-
8 | -0.6
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant.bug:
--------------------------------------------------------------------------------
1 | # Change point model with very poor parameterization
2 | var
3 | x[N], mu[N], Y[N], punif[N], J[N],
4 | k, alpha, beta[2], tau, sigma, N;
5 | model {
6 | k ~ dcat(punif[]); # uniform prior over changepoint observation
7 | for (i in 1:N) {
8 | J[i] <- 1 + step(i - (k+0.5)); # J[i]=1 if i<=k; 2 if i>k
9 | mu[i] <- alpha + beta[J[i]]*(x[i] - x[k]);
10 | Y[i] ~ dnorm(mu[i],tau)
11 | punif[i] <- 1/N
12 | }
13 | alpha ~ dnorm(0,1.0E-6);
14 | for (j in 1:2) { beta[j] ~ dnorm(0,1.0E-6)}
15 | tau ~ dgamma(1.0E-3,1.0E-3);
16 | sigma <- 1.0/sqrt(tau);
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/stagnant2.bug:
--------------------------------------------------------------------------------
1 | # Change point model with improved parameterization
2 | var
3 | x[N], mu[N], Y[N], J[N],
4 | alpha, beta[2], tau, sigma, x.change;
5 | model {
6 | for(i in 1 : N) {
7 | Y[i] ~ dnorm(mu[i], tau)
8 | mu[i] <- alpha + beta[J[i]] * (x[i] - x.change)
9 | J[i] <- 1 + step(x[i] - x.change)
10 | }
11 | tau ~ dgamma(0.001, 0.001)
12 | alpha ~ dnorm(0.0,1.0E-6)
13 | for(j in 1 : 2) {
14 | beta[j] ~ dnorm(0.0,1.0E-6)
15 | }
16 | sigma <- 1 / sqrt(tau)
17 | x.change ~ dunif(-1.3,1.1)
18 | }
19 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/test1.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("stagnant-data.R")
3 | inits <- read.jagsdata("stagnant-inits3.R")
4 | m <- jags.model("stagnant2.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha", "x.change"), thin=10, n.iter=100000)
7 | source("bench-test1.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/test1.cmd:
--------------------------------------------------------------------------------
1 | model in "stagnant2.bug"
2 | data in "stagnant-data.R"
3 | compile, nchains(2)
4 | parameters in "stagnant-inits3.R"
5 | initialize
6 | update 1000
7 | monitor alpha, thin(10)
8 | monitor x.change, thin(10)
9 | update 100000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/test2.R:
--------------------------------------------------------------------------------
1 | source("../../R/Rcheck.R")
2 | data <- read.jagsdata("stagnant-data.R")
3 | inits <- read.jagsdata("stagnant-inits4.R")
4 | m <- jags.model("stagnant2.bug", data, inits, n.chains=2)
5 | update(m, 1000)
6 | x <- coda.samples(m, c("alpha", "x.change"), thin=10, n.iter=100000)
7 | source("bench-test2.R")
8 | check.fun()
9 |
10 |
--------------------------------------------------------------------------------
/packages/nimble/inst/classic-bugs/vol2/stagnant/test2.cmd:
--------------------------------------------------------------------------------
1 | model in "stagnant2.bug"
2 | data in "stagnant-data.R"
3 | compile, nchains(2)
4 | parameters in "stagnant-inits4.R"
5 | initialize
6 | update 1000
7 | monitor alpha, thin(10)
8 | monitor x.change, thin(10)
9 | update 100000
10 | coda *
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/Dense:
--------------------------------------------------------------------------------
1 | #include "Core"
2 | #include "LU"
3 | #include "Cholesky"
4 | #include "QR"
5 | #include "SVD"
6 | #include "Geometry"
7 | #include "Eigenvalues"
8 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/Eigen:
--------------------------------------------------------------------------------
1 | #include "Dense"
2 | #include "Sparse"
3 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/StdList:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Hauke Heibel
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_STDLIST_MODULE_H
11 | #define EIGEN_STDLIST_MODULE_H
12 |
13 | #include "Core"
14 | #include
15 |
16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
17 |
18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)
19 |
20 | #else
21 |
22 | #include "src/StlSupport/StdList.h"
23 |
24 | #endif
25 |
26 | #endif // EIGEN_STDLIST_MODULE_H
27 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/src/Core/arch/HIP/hcc/math_constants.h:
--------------------------------------------------------------------------------
1 | /*
2 | * math_constants.h -
3 | * HIP equivalent of the CUDA header of the same name
4 | */
5 |
6 | #ifndef __MATH_CONSTANTS_H__
7 | #define __MATH_CONSTANTS_H__
8 |
9 | /* single precision constants */
10 |
11 | #define HIPRT_INF_F __int_as_float(0x7f800000)
12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff)
13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001)
14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff)
15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000)
16 | #define HIPRT_ZERO_F 0.0f
17 | #define HIPRT_ONE_F 1.0f
18 |
19 | /* double precision constants */
20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000)
21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000)
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/src/Core/functors/TernaryFunctors.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2016 Eugene Brevdo
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TERNARY_FUNCTORS_H
11 | #define EIGEN_TERNARY_FUNCTORS_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | //---------- associative ternary functors ----------
18 |
19 |
20 |
21 | } // end namespace internal
22 |
23 | } // end namespace Eigen
24 |
25 | #endif // EIGEN_TERNARY_FUNCTORS_H
26 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/src/Core/util/NonMPL2.h:
--------------------------------------------------------------------------------
1 | #ifdef EIGEN_MPL2_ONLY
2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode
3 | #endif
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/Eigen/src/misc/lapacke_mangling.h:
--------------------------------------------------------------------------------
1 | #ifndef LAPACK_HEADER_INCLUDED
2 | #define LAPACK_HEADER_INCLUDED
3 |
4 | #ifndef LAPACK_GLOBAL
5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_)
6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER)
8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME
9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE)
10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname
11 | #else
12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
13 | #endif
14 | #endif
15 |
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/COPYING:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -----------------------------------------------------------------------------
12 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/atomic/four/atomic.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -------------------------------------------------------------------------- */
12 | $begin atomic_four$$
13 |
14 | $section Atomic AD Functions: Fourth Generation$$
15 |
16 | $childtable%
17 | include/cppad/core/atomic/four/atomic.hpp%
18 | example/atomic_four/atomic_four.omh
19 | %$$
20 |
21 | $end
22 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/atomic/four/devel/devel.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | ---------------------------------------------------------------------------- */
12 |
13 | $begin atomic_four_devel$$
14 |
15 | $section atomic_four Developer Documentation$$
16 |
17 | $childtable%
18 | include/cppad/core/atomic/four/devel/jac_sparsity.hpp
19 | %$$
20 |
21 | $end
22 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/atomic/three/atomic.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -------------------------------------------------------------------------- */
12 | $begin atomic_three$$
13 |
14 | $section Atomic AD Functions: Third Generation$$
15 |
16 | $childtable%
17 | include/cppad/core/atomic/three/atomic.hpp%
18 | example/atomic_three/atomic_three.omh
19 | %$$
20 |
21 | $end
22 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/discrete/devel.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | ---------------------------------------------------------------------------- */
12 | $begin devel_discrete$$
13 | $spell
14 | $$
15 |
16 | $section Developer Documentation for Discrete Function$$
17 |
18 | $childtable%
19 | include/cppad/core/discrete/discrete.hpp
20 | %$$
21 |
22 | $end
23 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/forward/devel.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -------------------------------------------------------------------------- */
12 | $begin devel_forward$$
13 | $spell
14 | Devel
15 | $$
16 |
17 | $section Devel: Forward Mode$$
18 |
19 | $childtable%
20 | include/cppad/core/forward/forward.hpp
21 | %$$
22 |
23 | $end
24 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/graph/cpp_graph.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -------------------------------------------------------------------------- */
12 | $begin cpp_graph$$
13 |
14 | $section A C++ AD Graph Class$$
15 |
16 | $childtable%
17 | include/cppad/core/graph/cpp_graph.hpp
18 | %$$
19 |
20 | $end
21 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/core/nimble_ADbase_extensions.hpp:
--------------------------------------------------------------------------------
1 | // Added for use by nimble when different shared libraries are being managed from R.
2 | // In such a case, a need arises to set fake tape_id and tape ptr values.
3 | // When CppAD version is updated, this will need to be inserted into the new version.
4 | // The definition for set_tape_info_nimble is in tape_link.hpp, where related CppAD methods appear.
5 | static void set_tape_info_nimble(tape_id_t tape_id, local::ADTape* tape_handle_, bool recover = false);
6 | static void* get_handle_address_nimble(); // used only for diagnostic purposes
7 | static tape_id_t get_tape_id_nimble();
8 | static local::ADTape* get_tape_handle_nimble();
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/local/graph/cpp_graph_itr.omh:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -------------------------------------------------------------------------- */
12 | $begin cpp_graph_itr$$
13 | $spell
14 | Iterator
15 | $$
16 |
17 | $section C++ AD Graph Iterator Class$$
18 |
19 | $childtable%
20 | include/cppad/local/graph/cpp_graph_itr.hpp
21 | %$$
22 |
23 | $end
24 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/cppad/local/graph/json_lexer.omh:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------------------------------
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
3 |
4 | CppAD is distributed under the terms of the
5 | Eclipse Public License Version 2.0.
6 |
7 | This Source Code may also be made available under the following
8 | Secondary License when the conditions for such availability set forth
9 | in the Eclipse Public License, Version 2.0 are satisfied:
10 | GNU General Public License, Version 2.0 or later.
11 | -----------------------------------------------------------------------------
12 | $begin json_lexer$$
13 | $spell
14 | Json
15 | $$
16 |
17 | $section Lexical Analysis Class for a Json AD Graph$$.
18 |
19 | $childtable%
20 | include/cppad/local/graph/json_lexer.hpp
21 | %$$
22 |
23 |
24 | $end
25 |
--------------------------------------------------------------------------------
/packages/nimble/inst/include/nimble_ADbase_extensions.hpp:
--------------------------------------------------------------------------------
1 | // Added for use by nimble when different shared libraries are being managed from R.
2 | // In such a case, a need arises to set fake tape_id and tape ptr values.
3 | // When CppAD version is updated, this will need to be inserted into the new version.
4 | // The definition for set_tape_info_nimble is in tape_link.hpp, where related CppAD methods appear.
5 | static void set_tape_info_nimble(tape_id_t tape_id, local::ADTape* tape_handle_, bool recover = false);
6 | static void* get_handle_address_nimble(); // used only for diagnostic purposes
7 | static tape_id_t get_tape_id_nimble();
8 | static local::ADTape* get_tape_handle_nimble();
9 |
--------------------------------------------------------------------------------
/packages/nimble/inst/make/.gitignore:
--------------------------------------------------------------------------------
1 | Makevars
2 | Makevars.win
3 | Makevars_lib
4 |
--------------------------------------------------------------------------------
/packages/nimble/inst/make/Makevars.in:
--------------------------------------------------------------------------------
1 | # lib=FALSE
2 | # from=Makevars.in
3 |
4 | CXXPICFLAGS = @CXXPICFLAGS@
5 |
6 | ifndef EIGEN_INC
7 | EIGEN_INC=@EIGEN_INC@
8 | endif
9 |
10 | ifndef NIMBLE_INC_DIR
11 | NIMBLE_INC_DIR=@NIMBLE_INC_DIR@
12 | endif
13 |
14 | ifndef NIMBLE_LIB_DIR
15 | NIMBLE_LIB_DIR=@NIMBLE_LIB_DIR@
16 | endif
17 |
18 | PKG_CPPFLAGS= -DR_NO_REMAP $(EIGEN_INC) -DEIGEN_MPL2_ONLY=1 -I"$(NIMBLE_INC_DIR)" -Wno-misleading-indentation -Wno-ignored-attributes -Wno-deprecated-declarations
19 | PKG_LIBS=-L"$(NIMBLE_LIB_DIR)" -lnimble $(LAPACK_LIBS) $(BLAS_LIBS)
20 |
21 |
--------------------------------------------------------------------------------
/packages/nimble/man/ADbreak.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{ADbreak}
4 | \alias{ADbreak}
5 | \title{NIMBLE language function to break tracking of derivatives}
6 | \usage{
7 | ADbreak(x)
8 | }
9 | \arguments{
10 | \item{x}{scalar value}
11 | }
12 | \description{
13 | This function is used in a method of a nimbleFunction that has derivatives enabled. It returns its value but breaks tracking of derivatives.
14 | }
15 | \details{
16 | This funcion only works with scalars.
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/ADproxyModelClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cppDefs_ADtools.R
3 | \docType{class}
4 | \name{ADproxyModelClass-class}
5 | \alias{ADproxyModelClass-class}
6 | \alias{ADproxyModelClass}
7 | \title{create an ADproxyModelClass object}
8 | \arguments{
9 | \item{Rmodel}{The name of an uncompiled model}
10 | }
11 | \description{
12 | create an ADproxyModelClass object. For internal use.
13 | }
14 | \details{
15 | This is a proxy model for model_AD. The class needs just enough pieces to be used like a model for purposes of nodeFunction compilation. The model will contain an ADproxyModel and then the nodeFunction setup code will extract it. The model interface will population the proxy model's CobjectInterface
16 | }
17 |
18 | \author{
19 | NIMBLE development team
20 | }
21 |
--------------------------------------------------------------------------------
/packages/nimble/man/BUGSdeclClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/BUGS_BUGSdecl.R
3 | \docType{class}
4 | \name{BUGSdeclClass-class}
5 | \alias{BUGSdeclClass-class}
6 | \alias{BUGSdeclClass}
7 | \title{BUGSdeclClass contains the information extracted from one BUGS declaration}
8 | \description{
9 | BUGSdeclClass contains the information extracted from one BUGS declaration
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/CAR_calcNumIslands.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/CAR.R
3 | \name{CAR_calcNumIslands}
4 | \alias{CAR_calcNumIslands}
5 | \title{Calculate number of islands based on a CAR adjacency matrix.}
6 | \usage{
7 | CAR_calcNumIslands(adj, num)
8 | }
9 | \arguments{
10 | \item{adj}{vector of indices of the adjacent locations (neighbors) of each spatial location. This is a sparse representation of the full adjacency matrix.}
11 |
12 | \item{num}{vector giving the number of neighbors of each spatial location, with length equal to the total number of locations.}
13 | }
14 | \description{
15 | Calculate number of islands (distinct connected groups) based on a CAR adjacency matrix.
16 | }
17 | \seealso{
18 | \code{\link{CAR-Normal}}
19 | }
20 | \author{
21 | Daniel Turek
22 | }
23 |
--------------------------------------------------------------------------------
/packages/nimble/man/CmodelBaseClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cppInterfaces_models.R
3 | \docType{class}
4 | \name{CmodelBaseClass-class}
5 | \alias{CmodelBaseClass-class}
6 | \alias{CmodelBaseClass}
7 | \title{Class \code{CmodelBaseClass}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/CnimbleFunctionBase-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cppInterfaces_nimbleFunctions.R
3 | \docType{class}
4 | \name{CnimbleFunctionBase-class}
5 | \alias{CnimbleFunctionBase-class}
6 | \alias{CnimbleFunctionBase}
7 | \title{Class \code{CnimbleFunctionBase}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/RmodelBaseClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/BUGS_model.R
3 | \docType{class}
4 | \name{RmodelBaseClass-class}
5 | \alias{RmodelBaseClass-class}
6 | \alias{RmodelBaseClass}
7 | \title{Class \code{RmodelBaseClass}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/any_na.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{any_na}
4 | \alias{any_na}
5 | \alias{any_nan}
6 | \title{Determine if any values in a vector are NA or NaN}
7 | \usage{
8 | any_na(x)
9 |
10 | any_nan(x)
11 | }
12 | \arguments{
13 | \item{x}{vector of values}
14 | }
15 | \description{
16 | NIMBLE language functions that can be used in either compiled or uncompiled
17 | nimbleFunctions to detect if there are any NA or NaN values in a vector.
18 | }
19 | \author{
20 | NIMBLE Development Team
21 | }
22 |
--------------------------------------------------------------------------------
/packages/nimble/man/buildAuxiliaryFilter.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/miscFunctions.R
3 | \name{buildAuxiliaryFilter}
4 | \alias{buildAuxiliaryFilter}
5 | \title{Placeholder for buildAuxiliaryFilter}
6 | \usage{
7 | buildAuxiliaryFilter(...)
8 | }
9 | \arguments{
10 | \item{...}{arguments}
11 | }
12 | \description{
13 | This function has been moved to the `nimbleSMC` package.
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/buildBootstrapFilter.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/miscFunctions.R
3 | \name{buildBootstrapFilter}
4 | \alias{buildBootstrapFilter}
5 | \title{Placeholder for buildBootstrapFilter}
6 | \usage{
7 | buildBootstrapFilter(...)
8 | }
9 | \arguments{
10 | \item{...}{arguments}
11 | }
12 | \description{
13 | This function has been moved to the `nimbleSMC` package.
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/buildEnsembleKF.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/miscFunctions.R
3 | \name{buildEnsembleKF}
4 | \alias{buildEnsembleKF}
5 | \title{Placeholder for buildEnsembleKF}
6 | \usage{
7 | buildEnsembleKF(...)
8 | }
9 | \arguments{
10 | \item{...}{arguments}
11 | }
12 | \description{
13 | This function has been moved to the `nimbleSMC` package.
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/buildIteratedFilter2.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/miscFunctions.R
3 | \name{buildIteratedFilter2}
4 | \alias{buildIteratedFilter2}
5 | \title{Placeholder for buildIteratedFilter2}
6 | \usage{
7 | buildIteratedFilter2(...)
8 | }
9 | \arguments{
10 | \item{...}{arguments}
11 | }
12 | \description{
13 | This function has been moved to the `nimbleSMC` package.
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/buildLiuWestFilter.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/miscFunctions.R
3 | \name{buildLiuWestFilter}
4 | \alias{buildLiuWestFilter}
5 | \title{Placeholder for buildLiuWestFilter}
6 | \usage{
7 | buildLiuWestFilter(...)
8 | }
9 | \arguments{
10 | \item{...}{arguments}
11 | }
12 | \description{
13 | This function has been moved to the `nimbleSMC` package.
14 | }
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/checkInterrupt.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{checkInterrupt}
4 | \alias{checkInterrupt}
5 | \title{Check for interrupt (e.g. Ctrl-C) during nimbleFunction execution. Part of the NIMBLE language.}
6 | \usage{
7 | checkInterrupt()
8 | }
9 | \description{
10 | Check for interrupt (e.g. Ctrl-C) during nimbleFunction execution. Part of the NIMBLE language.
11 | }
12 | \details{
13 | During execution of nimbleFunctions that take a long time, it is nice to occassionally check if the user has entered an interrupt and bail out of execution if so. This function does that. During uncompiled nimbleFunction execution, it does nothing. During compiled execution, it calls R_checkUserInterrupt() of the R headers.
14 | }
15 | \author{
16 | Perry de Valpine
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/codeBlockClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/MCMC_utils.R
3 | \docType{class}
4 | \name{codeBlockClass-class}
5 | \alias{codeBlockClass-class}
6 | \alias{codeBlockClass}
7 | \title{Class \code{codeBlockClass}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/eigenNimbleList.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \docType{data}
4 | \name{eigenNimbleList}
5 | \alias{eigenNimbleList}
6 | \title{eigenNimbleList definition}
7 | \format{
8 | An object of class \code{list} of length 1.
9 | }
10 | \usage{
11 | eigenNimbleList
12 | }
13 | \description{
14 | \code{nimbleList} definition for the type of \code{nimbleList} returned by \code{\link{nimEigen}}.
15 | }
16 | \seealso{
17 | \code{\link{nimEigen}}
18 | }
19 | \author{
20 | NIMBLE development team
21 | }
22 | \keyword{datasets}
23 |
--------------------------------------------------------------------------------
/packages/nimble/man/getBUGSexampleDir.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/BUGS_readBUGS.R
3 | \name{getBUGSexampleDir}
4 | \alias{getBUGSexampleDir}
5 | \title{Get the directory path to one of the classic BUGS examples installed with NIMBLE package}
6 | \usage{
7 | getBUGSexampleDir(example)
8 | }
9 | \arguments{
10 | \item{example}{The name of the classic BUGS example.}
11 | }
12 | \value{
13 | Character string of the fully pathed directory of the BUGS example.
14 | }
15 | \description{
16 | NIMBLE comes with some of the classic BUGS examples. \code{getBUGSexampleDir} looks up the location of an example from its name.
17 | }
18 | \seealso{
19 | \code{\link{readBUGSmodel}} for usage in creating a model from a classic BUGS example
20 | }
21 | \author{
22 | Christopher Paciorek
23 | }
24 |
--------------------------------------------------------------------------------
/packages/nimble/man/getDefinition.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_util.R
3 | \name{getDefinition}
4 | \alias{getDefinition}
5 | \title{Get nimbleFunction definition}
6 | \usage{
7 | getDefinition(nf)
8 | }
9 | \arguments{
10 | \item{nf}{A nimbleFunction generator, or a compiled or un-compiled specialized nimbleFunction.}
11 | }
12 | \description{
13 | Returns a list containing the nimbleFunction definition components (setup function, run function, and other member methods) for the supplied nimbleFunction generator or specialized instance.
14 | }
15 | \author{
16 | Daniel Turek
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/getNimbleOption.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/options.R
3 | \name{getNimbleOption}
4 | \alias{getNimbleOption}
5 | \title{Get NIMBLE Option}
6 | \usage{
7 | getNimbleOption(x)
8 | }
9 | \arguments{
10 | \item{x}{a character string holding an option name}
11 | }
12 | \value{
13 | The value of the option.
14 | }
15 | \description{
16 | Allow the user to get the value of a global _option_
17 | that affects the way in which NIMBLE operates
18 | }
19 | \examples{
20 | getNimbleOption('verifyConjugatePosteriors')
21 | }
22 | \author{
23 | Christopher Paciorek
24 | }
25 |
--------------------------------------------------------------------------------
/packages/nimble/man/getsize.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/all_utils.R
3 | \name{getsize}
4 | \alias{getsize}
5 | \title{Returns number of rows of modelValues}
6 | \usage{
7 | getsize(container)
8 | }
9 | \arguments{
10 | \item{container}{modelValues object}
11 | }
12 | \description{
13 | Returns the number of rows of NIMBLE modelValues object. Works in R and NIMBLE.
14 | }
15 | \details{
16 | See the \href{https://r-nimble.org/html_manual/cha-welcome-nimble.html}{User Manual} or \code{help(modelValuesBaseClass)} for information about modelValues objects
17 | }
18 | \examples{
19 | mvConf <- modelValuesConf(vars = 'a', types = 'double', sizes = list(a = 1) )
20 | mv <- modelValues(mvConf)
21 | resize(mv, 10)
22 | getsize(mv)
23 | }
24 | \author{
25 | Clifford Anderson-Bergman
26 | }
27 |
--------------------------------------------------------------------------------
/packages/nimble/man/identityMatrix.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/NF_utils.R
3 | \name{identityMatrix}
4 | \alias{identityMatrix}
5 | \title{Create an Identity matrix (Deprecated)}
6 | \usage{
7 | identityMatrix(d)
8 | }
9 | \arguments{
10 | \item{d}{The size of the identity matrix to return, will return a d-by-d matrix}
11 | }
12 | \value{
13 | A d-by-d identity matrix
14 | }
15 | \description{
16 | Returns a d-by-d identity matrix (square matrix of 0's, with 1's on the main diagnol).
17 | }
18 | \details{
19 | This function can be used in NIMBLE run code. It is deprecated because now one can use diag(d) instead.
20 | }
21 | \examples{
22 | Id <- identityMatrix(d = 3)
23 |
24 | }
25 | \author{
26 | Daniel Turek
27 | }
28 |
--------------------------------------------------------------------------------
/packages/nimble/man/is.nf.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_util.R
3 | \name{is.nf}
4 | \alias{is.nf}
5 | \title{check if a nimbleFunction}
6 | \usage{
7 | is.nf(f, inputIsName = FALSE, where = -1)
8 | }
9 | \arguments{
10 | \item{f}{object to be tested}
11 |
12 | \item{inputIsName}{logical indicating whether the function is provided as the character name of the function or the function object itself}
13 |
14 | \item{where}{Optional argument needed due to R package namespace issues but which should not need to be provided by a user.}
15 | }
16 | \description{
17 | Checks an object to determine if it is a nimbleFunction (i.e., a function created by \code{nimbleFunction} using setup code).
18 | }
19 | \seealso{
20 | \code{\link{nimbleFunction}} for how to create a nimbleFunction
21 | }
22 |
--------------------------------------------------------------------------------
/packages/nimble/man/is.nl.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \name{is.nl}
4 | \alias{is.nl}
5 | \title{check if a nimbleList}
6 | \usage{
7 | is.nl(l)
8 | }
9 | \arguments{
10 | \item{l}{object to be tested}
11 | }
12 | \description{
13 | Checks an object to determine if it is a nimbleList (i.e., a list created by \code{nlDef$new()}).
14 | }
15 | \seealso{
16 | \code{\link{nimbleList}} for how to create a nimbleList
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/modelDefClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/BUGS_modelDef.R
3 | \docType{class}
4 | \name{modelDefClass-class}
5 | \alias{modelDefClass-class}
6 | \alias{modelDefClass}
7 | \title{Class for NIMBLE model definition}
8 | \description{
9 | Class for NIMBLE model definition that is not usually needed directly by a user.
10 | }
11 | \details{
12 | See \code{\link{modelBaseClass}} for information about creating NIMBLE BUGS models.
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/packages/nimble/man/nimDim.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/all_utils.R
3 | \name{nimDim}
4 | \alias{nimDim}
5 | \alias{dim}
6 | \title{return sizes of an object whether it is a vector, matrix or array}
7 | \usage{
8 | nimDim(obj)
9 | }
10 | \arguments{
11 | \item{obj}{objects for which the sizes are requested}
12 | }
13 | \value{
14 | a vector of sizes in each dimension
15 | }
16 | \description{
17 | R's regular \code{dim} function returns NULL for a vector. It is useful to have this function that treats a vector similarly to a matrix or array. Works in R and NIMBLE. In NIMBLE \code{dim} is identical to \code{nimDim}, not to R's \code{dim}
18 | }
19 | \examples{
20 | x <- rnorm(4)
21 | dim(x)
22 | nimDim(x)
23 | y <- matrix(x, nrow = 2)
24 | dim(y)
25 | nimDim(y)
26 |
27 | }
28 | \author{
29 | NIMBLE development team
30 | }
31 |
--------------------------------------------------------------------------------
/packages/nimble/man/nimOptimDefaultControl.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{nimOptimDefaultControl}
4 | \alias{nimOptimDefaultControl}
5 | \title{Creates a default \code{control} argument for \code{\link{nimOptim}}.}
6 | \usage{
7 | nimOptimDefaultControl()
8 | }
9 | \value{
10 | \code{\link{optimControlNimbleList}}
11 | }
12 | \description{
13 | Creates a default \code{control} argument for \code{\link{nimOptim}}.
14 | }
15 | \seealso{
16 | \code{\link{nimOptim}}, \code{\link{optim}}
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/nimble-math.Rd:
--------------------------------------------------------------------------------
1 | \name{nimble-math}
2 | \title{Mathematical functions for BUGS and nimbleFunction programming}
3 | \alias{besselK}
4 | \alias{cloglog}
5 | \alias{cube}
6 | \alias{expit}
7 | \alias{icloglog}
8 | \alias{ilogit}
9 | \alias{inprod}
10 | \alias{inverse}
11 | \alias{iprobit}
12 | \alias{logdet}
13 | \alias{logfact}
14 | \alias{loggam}
15 | \alias{logit}
16 | \alias{nimEquals}
17 | \alias{nimRound}
18 | \alias{nimStep}
19 | \alias{nimSwitch}
20 | \alias{phi}
21 | \alias{pow}
22 | \alias{probit}
23 | \description{
24 | Mathematical functions for use in BUGS code and in nimbleFunction programming (i.e., nimbleFunction run code). See Chapter 5 of the User Manual for more details.
25 | }
26 | \author{NIMBLE Development Team}
--------------------------------------------------------------------------------
/packages/nimble/man/nimbleFunctionBase-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_core.R
3 | \docType{class}
4 | \name{nimbleFunctionBase-class}
5 | \alias{nimbleFunctionBase-class}
6 | \alias{nimbleFunctionBase}
7 | \title{Class \code{nimbleFunctionBase}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/nimbleFunctionList-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/types_nimbleFunctionList.R
3 | \docType{class}
4 | \name{nimbleFunctionList-class}
5 | \alias{nimbleFunctionList-class}
6 | \alias{nimbleFunctionList}
7 | \title{Create a list of nimbleFunctions}
8 | \description{
9 | Create an empty list of nimbleFunctions that all will inherit from a base class.
10 | }
11 | \details{
12 | See the \href{https://r-nimble.org/html_manual/cha-welcome-nimble.html}{User Manual} for information about creating and populating a \code{nimbleFunctionList}.
13 | }
14 |
15 | \author{
16 | NIMBLE development team
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/optimControlNimbleList.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \docType{data}
4 | \name{optimControlNimbleList}
5 | \alias{optimControlNimbleList}
6 | \title{Data type for the \code{control} parameter of \code{\link{nimOptim}}}
7 | \format{
8 | An object of class \code{list} of length 1.
9 | }
10 | \usage{
11 | optimControlNimbleList
12 | }
13 | \description{
14 | \code{\link{nimbleList}} definition for the type of \code{\link{nimbleList}} input as the \code{control} parameter
15 | to \code{\link{nimOptim}}. See \code{\link{optim}} for details.
16 | }
17 | \seealso{
18 | \code{\link{optim}}, \code{\link{nimOptim}}
19 | }
20 | \keyword{datasets}
21 |
--------------------------------------------------------------------------------
/packages/nimble/man/optimDefaultControl.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{optimDefaultControl}
4 | \alias{optimDefaultControl}
5 | \title{Creates a deafult \code{control} argument for \code{\link{optim}} (just an empty list).}
6 | \usage{
7 | optimDefaultControl()
8 | }
9 | \value{
10 | an empty \code{list}.
11 | }
12 | \description{
13 | Creates a deafult \code{control} argument for \code{\link{optim}} (just an empty list).
14 | }
15 | \seealso{
16 | \code{\link{nimOptim}}, \code{\link{optim}}
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/pow_int.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{pow_int}
4 | \alias{pow_int}
5 | \title{Power function for integer-valued exponent}
6 | \usage{
7 | pow_int(a, b)
8 | }
9 | \arguments{
10 | \item{a}{Base}
11 |
12 | \item{b}{Exponent}
13 | }
14 | \value{
15 | a^b
16 | }
17 | \description{
18 | pow function with exponent required to be integer
19 | }
20 | \details{
21 | This is required in nimble models and nimbleFunctions if derivatives will be tracked
22 | but tracked only with respect to a, such that b might be any (positive, 0, or negative) integer.
23 | This contrasts with pow(a, b) (equivalent to a^b), which requires b > 0 if derivatives will be
24 | tracked, even if they will only be requested with respect to a.
25 | }
26 |
--------------------------------------------------------------------------------
/packages/nimble/man/printErrors.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/all_utils.R
3 | \name{printErrors}
4 | \alias{printErrors}
5 | \title{Print error messages after failed compilation}
6 | \usage{
7 | printErrors(excludeWarnings = TRUE)
8 | }
9 | \arguments{
10 | \item{excludeWarnings}{logical indicating whether compiler warnings should be printed; generally such warnings can be ignored.}
11 | }
12 | \description{
13 | Retrieves the error file from R's tempdir and prints to the screen.
14 | }
15 | \author{
16 | Christopher Paciorek
17 | }
18 |
--------------------------------------------------------------------------------
/packages/nimble/man/run.time.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_Rexecution.R
3 | \name{run.time}
4 | \alias{run.time}
5 | \title{Time execution of NIMBLE code}
6 | \usage{
7 | run.time(code)
8 | }
9 | \arguments{
10 | \item{code}{code to be timed}
11 | }
12 | \description{
13 | Time execution of NIMBLE code
14 | }
15 | \details{
16 | Function for use in nimbleFunction run code; when nimbleFunctions are run in R, this simply wraps \code{system.time}.
17 | }
18 | \author{
19 | NIMBLE Development Team
20 | }
21 |
--------------------------------------------------------------------------------
/packages/nimble/man/singleVarAccessClass-class.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleFunction_compile.R
3 | \docType{class}
4 | \name{singleVarAccessClass-class}
5 | \alias{singleVarAccessClass-class}
6 | \alias{singleVarAccessClass}
7 | \title{Class \code{singleVarAccessClass}}
8 | \description{
9 | Classes used internally in NIMBLE and not expected to be called directly by users.
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/packages/nimble/man/svdNimbleList.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \docType{data}
4 | \name{svdNimbleList}
5 | \alias{svdNimbleList}
6 | \title{svdNimbleList definition}
7 | \format{
8 | An object of class \code{list} of length 1.
9 | }
10 | \usage{
11 | svdNimbleList
12 | }
13 | \description{
14 | \code{nimbleList} definition for the type of \code{nimbleList} returned by \code{\link{nimSvd}}.
15 | }
16 | \seealso{
17 | \code{\link{nimSvd}}
18 | }
19 | \author{
20 | NIMBLE development team
21 | }
22 | \keyword{datasets}
23 |
--------------------------------------------------------------------------------
/packages/nimble/man/waicDetailsNimbleList.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \docType{data}
4 | \name{waicDetailsNimbleList}
5 | \alias{waicDetailsNimbleList}
6 | \title{waicDetailsNimbleList definition}
7 | \format{
8 | An object of class \code{list} of length 1.
9 | }
10 | \usage{
11 | waicDetailsNimbleList
12 | }
13 | \description{
14 | \code{waicDetailsNimbleList} definition for the \code{nimbleList} type returned by WAIC
15 | computation.
16 | }
17 | \details{
18 | See \code{help(waic)} for details on the elements of the list.
19 | }
20 | \author{
21 | NIMBLE development team
22 | }
23 | \keyword{datasets}
24 |
--------------------------------------------------------------------------------
/packages/nimble/man/waicNimbleList.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/nimbleList_core.R
3 | \docType{data}
4 | \name{waicNimbleList}
5 | \alias{waicNimbleList}
6 | \title{waicNimbleList definition}
7 | \format{
8 | An object of class \code{list} of length 1.
9 | }
10 | \usage{
11 | waicNimbleList
12 | }
13 | \description{
14 | \code{waicNimbleList} definition for the \code{nimbleList} type returned by WAIC
15 | computation.
16 | }
17 | \details{
18 | See \code{help(waic)} for details on the elements of the list.
19 | }
20 | \author{
21 | NIMBLE development team
22 | }
23 | \keyword{datasets}
24 |
--------------------------------------------------------------------------------
/packages/nimble/src/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore all standard code files, since these should be copied over from inst/CppCode, but can't use *.cpp because do need nimble.cpp
2 | accessorClasses.cpp
3 | NamedObjects.cpp
4 | nimDists.cpp
5 | RcppUtils.cpp
6 | dists.cpp
7 | ModelClassUtils.cpp
8 | Utils.cpp
9 | nimbleGraph.cpp
10 | Makevars
11 | NFxnUtils.cpp
12 | Values.cpp
13 | eigenUsingClasses.cpp
14 |
--------------------------------------------------------------------------------
/packages/nimble/src/DO_NOT_PUT_CODE_HERE_DO_IN_INST_CPPCODE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nimble-dev/nimble/992f7baae185b68b1d02143c0da14179ae477c89/packages/nimble/src/DO_NOT_PUT_CODE_HERE_DO_IN_INST_CPPCODE
--------------------------------------------------------------------------------
/packages/nimble/src/Makevars.in:
--------------------------------------------------------------------------------
1 | PKG_CPPFLAGS= -DR_NO_REMAP -I../inst/include @EIGEN_INC@
2 | PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) # $(FLIBS)
3 |
--------------------------------------------------------------------------------
/packages/nimble/src/Makevars.win:
--------------------------------------------------------------------------------
1 | PKG_CPPFLAGS= -DR_NO_REMAP -I../inst/include
2 | PKG_LIBS=-lRlapack -lRblas
3 |
--------------------------------------------------------------------------------
/packages/nimble/tests/testthat/AD_knownFailures.R:
--------------------------------------------------------------------------------
1 | ## try to keep in alphabetical order
2 | AD_knownFailures <- list( ## not complete:
3 | ## name the elements by operator name
4 | ##
5 | "%%" = list(
6 | '*' = list( ## * means all inputs fail
7 | compilation = TRUE
8 | )
9 | )
10 | ## var = list(
11 | ## 'arg1 = double(2))' = list(
12 | ## ## nimble doesn't support var of matrices, see sizeUnaryReduction
13 | ## ## This has been removed from unaryReductionOpTests2
14 | ## compilation = TRUE
15 | ## )
16 | ## ),
17 | )
18 |
--------------------------------------------------------------------------------
/packages/nimble/tests/testthat/barkerTestLog_Correct.Rout:
--------------------------------------------------------------------------------
1 | Test passed 😀
2 | ── Failure: Barker sampler seems to work with variations on the adaptation scheme ──
3 | all(...) is not TRUE
4 |
5 | `actual`: FALSE
6 | `expected`: TRUE
7 |
8 | Error:
9 | ! Test failed
10 | Backtrace:
11 | ▆
12 | 1. ├─base::source("/var/tmp/nimble-dev/nimble/packages/nimble/tests/testthat/test-barker.R")
13 | 2. │ ├─base::withVisible(eval(ei, envir))
14 | 3. │ └─base::eval(ei, envir)
15 | 4. │ └─base::eval(ei, envir)
16 | 5. ├─testthat::test_that(...) at tests/testthat/test-barker.R:60:1
17 | 6. │ └─withr (local) ``() at tests/testthat/test-barker.R:60:1
18 | 7. └─reporter$stop_if_needed()
19 | 8. └─rlang::abort("Test failed", call = NULL)
20 | [1] "Mon Dec 9 08:36:18 2024"
21 |
--------------------------------------------------------------------------------
/packages/solaris/config.site:
--------------------------------------------------------------------------------
1 | CC="cc -xc99"
2 | CFLAGS='-O -xlibmieee -xlibmil -xtarget=native -nofstore'
3 | F77="f95"
4 | FFLAGS='-O -libmil -xtarget=native -nofstore'
5 | CXX="CC -library=stlport4"
6 | CXXFLAGS="-O -xlibmil -xtarget=native -nofstore"
7 | CXX1X="/opt/csw/bin/g++"
8 | CXX1XFLAGS="-O2"
9 | CXX1XPICFLAGS=-fPIC
10 | FC=$F77
11 | FCFLAGS=$FFLAGS
12 | SAFE_FFLAGS="-O -fstore"
13 | FCLIBS="-lfai -lfui -lfsu"
14 | R_LD_LIBRARY_PATH="/opt/solarisstudio12.3/lib:/usr/local/lib:/opt/csw/lib"
15 |
--------------------------------------------------------------------------------
/packages/solaris/config.site_alt:
--------------------------------------------------------------------------------
1 | CC="/opt/csw//bin/gcc"
2 | CFLAGS=-O2
3 | CPPFLAGS="-I/opt/csw/include -I/usr/local/include"
4 | F77="/opt/csw//bin/gfortran"
5 | FFLAGS=-O2
6 | CXX="/opt/csw//bin/g++"
7 | CXXFLAGS=-O2
8 | FC=$F77
9 | FCFLAGS=-O2
10 | LDFLAGS="-L/opt/csw/lib -L/usr/local/lib"
11 |
--------------------------------------------------------------------------------
/packages/test:
--------------------------------------------------------------------------------
1 | #!/bin/sh -xe
2 |
3 | (cd ../nimble ; ./cleanup)
4 | Rscript -e 'try(remove.packages("nimble"))'
5 | if test -e nimble_0.6.tar.gz ; then
6 | rm nimble_0.6.tar.gz
7 | fi
8 |
9 | echo "****************************** testing default binary build with different locations (needed to work across machines)"
10 | if ! test -d RTempLib ; then
11 | mkdir RTempLib
12 | fi
13 |
14 | CONFIG_ARGS="'--enable-dylib=false'"
15 | R CMD INSTALL --configure-args="$CONFIG_ARGS" --build ../nimble
16 | Rscript -e 'try(remove.packages("nimble"))'
17 |
18 | GZ=`ls nimble_*gz`
19 | echo "****************************** Installing nimble binary package $GZ"
20 | R CMD INSTALL -l RTempLib $GZ
21 |
22 | echo "Running testBUGSmodel()"
23 | Rscript -e 'library(methods); library("nimble", lib.loc = "RTempLib"); print(system.file(package = "nimble")); testBUGSmodel("pump")'
24 |
--------------------------------------------------------------------------------
/packages/update_license.R:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env Rscript
2 |
3 | header <- readLines('GPL_header.txt')
4 | penultimate_line <- ' * https://www.R-project.org/Licenses/'
5 |
6 | cppFiles = c(Sys.glob('nimble/inst/include/nimble/*.h'),
7 | Sys.glob('nimble/inst/CppCode/*.cpp'))
8 | for (filename in cppFiles) {
9 | lines <- readLines(filename)
10 | old <- grep(penultimate_line, lines)
11 | if (length(old)) {
12 | lines <- lines[(old[1] + 3):length(lines)]
13 | }
14 | lines <- c(header, '', lines)
15 | writeLines(lines, con = filename)
16 | }
17 |
--------------------------------------------------------------------------------