Code Monkey home page Code Monkey logo

baorista's Introduction

cran version development version R-hub

baorista

baorista is an R package that provides a Bayesian inferential tool for analysing time-frequencies of archaeological events associated with time spans typically obtained from relative chronological sequences (e.g. periods and phases) and often analyses using aoristic sums. At its core baorista is a frontend for fitting Bayesian models via the NIMBLE probabilistic programming language.

Please note that baorista is based on Nimble, which requires a working C++ compiler. For more information please read the dedicated section of the nimble manual.

For a quick introduction to baorista check the package vignette as well as the associated paper and its github repo

Funding

The development of this package was funded by a Philip Leverhulme Prize (PLP-2019-304) awarded to E.Crema.

baorista's People

Contributors

ercrema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

baorista's Issues

Bug when using nimble 1.2.0

Latest version of nimble (1.2.0) generates the following error message when executing the expfit() function:

library(baorista)
data(samplemat) 
x.mat <- createProbMat(pmat=samplemat,timeRange=c(5000,3001),resolution=100)
exponential.fit <- expfit(x.mat) #fitting using default MCMC/Prior settings

Compiling nimble model...
Error in FUN(X[[i]], ...) :
checkAndPrepareDistributionInfo: random generation function rAExp is missing returnType or returnType does not match the type of the x argument to the corresponding density function.

The problem is most likely caused by inconsistencies between the random number generator function and the custom probability distribution.
Downgrading nimble to 1.1.0 fixes the problem (e.g. running devtools::install_version('nimble',version='1.1.0')) , but an update of expfit(), logisticfit() and icarfit() is required, or alternatively the issue is with nimble 1.2.0 itself. nimble developers have been contacted for help.

Development plans for v.0.2.0

  • Add error message in case users provide unsupported probability distribution as prior.
  • Fix BUG on expfit() where rPrior argument is not correctly implemented in the model definition. (Possibly release earlier on version 0.1.5?)
  • UPDATE all models so that inits values are derived explicitly from random draws of the prior.
  • add NEW model based on double exponential growth

CRAN

  • Please always explain all acronyms in the description text. -> ICAR

The Description field is intended to be a (one paragraph) description of what the package does and why it may be useful. Please add more details about the package functionality and implemented methods in your Description text.

  • Please add \value to .Rd files regarding exported methods and explain the functions results in the documentation. Please write about the structure of the output (class) and also what the output means. (If a function does not return a value, please document that too, e.g. \value{No return value, called for side effects} or similar) -> Missing Rd-tags:

    plot.fittedExp.Rd: \value
    plot.fittedICAR.Rd: \value
    plot.fittedLogistic.Rd: \value
    plot.probMat.Rd: \value

  • \dontrun{} should only be used if the example really cannot be executed (e.g. because of missing additional software, missing API keys, ...) by the user. That's why wrapping examples in \dontrun{} adds the comment ("# Not run:") as a warning for the user. Does not seem necessary. Please replace \dontrun with \donttest.

Please unwrap the examples if they are executable in < 5 sec, or replace dontrun{} with \donttest{}.

  • You write information messages to the console that cannot be easily suppressed.

It is more R like to generate objects that can be used to extract the information a user is interested in, and then print() that object. Instead of print()/cat() rather use message()/warning() or if(verbose)cat(..) (or maybe stop()) if you really have to write text to the console. (except for print, summary, interactive functions) -> R/expfit.R, R/icarfit.R, R/logisticfit.R

  • Please make sure that you do not change the user's options, par or working directory. If you really have to do so within functions, please ensure with an immediate call of on.exit() that the settings are reset when the function is exited.

e.g.:
...
oldpar <- par(no.readonly = TRUE) # code line i
on.exit(par(oldpar)) # code line i + 1
...
par(mfrow=c(2,2)) # somewhere after
...
If you're not familiar with the function, please check ?on.exit. This function makes it possible to restore options before exiting a function even if the function breaks. Therefore it needs to be called immediately after the option change within a function.
-> R/plotfittedExp.R, R/plotfittedICAR.R , R/plotfittedLogistic.R

  • Please do not modifiy the .GlobalEnv. This is not allowed by the CRAN policies. -> R/expfit.R, R/icarfit.R, R/logisticfit.R

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.