Giter VIP home page Giter VIP logo

iwmm's Issues

Replace loo::psis with posterior::pareto_khat (when available)

Currently loo::psis is used to calculate the pareto-k diagnostics, but there is work to have a pareto_khat diagnostic function in posterior. Using this instead would remove the dependency on loo and allow for loo to suggest iwmm (as discussed here).

I can make a branch implementing this change and create a PR once the corresponding functions are merged into posterior

CRAN submission

Now that we've changed over to posterior rather than loo for the psis code, we could think about submitting to CRAN so that other packages could use the iwmm functionality. Specifically I'm thinking of priorsense and potentially loo itself. I think that iwmm could be used to fix stan-dev/loo/issues/209

I'm opening this issue mainly to keep track of the tasks we would need to do to get iwmm on CRAN.

Skip `cmdstan`-related test if `cmdstan` is not detected instead of failing it

Currently tests are run regardless of cmdstan being installed, which leads to a failure in a case it is not. The test should be instead skipped, I think.

--->  Testing R-iwmm
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-iwmm/R-iwmm/work/iwmm-b40fdc398f4d8ffe5e32aa2a8367cb3d3db6607c" && /opt/local/bin/R CMD check ./iwmm_0.0.1.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-iwmm/R-iwmm/work/iwmm-b40fdc398f4d8ffe5e32aa2a8367cb3d3db6607c/iwmm.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
    GNU Fortran (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘iwmm/DESCRIPTION’ ... OK
* this is package ‘iwmm’ version ‘0.0.1’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
  .lintr
These were most likely included in error. See section ‘Package
structure’ in the ‘Writing R Extensions’ manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘iwmm’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘importance_sampling_bootstrap.Rmd’ ‘iwmm.Rmd’
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 58 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-moment-match-cmdstan-analytical.R:35:3'): (code run outside of `test_that()`) ──
  Error: CmdStan path has not been set yet. See ?set_cmdstan_path.
  Backtrace:
      ▆
   1. └─cmdstanr::cmdstan_model(...) at test-moment-match-cmdstan-analytical.R:35:3
   2.   └─cmdstanr::cmdstan_version()
   3.     └─cmdstanr:::stop_no_path()
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 58 ]
  Error: Test failures

Moment matching for brmsfit

I think it would be good to have a moment_match.brmsfit method. It should probably return a modified brmsfit object with the draws replaced with the moment matched draws, so that further functions from brms would work (e.g. posterior_predict, see n-kall/priorsense#18). I'm not sure where the weights would be stored though. At some stage I think brms will store the posterior in draws format (rather than the current stanfit object), so that would help, but that will likely only happen in the next major release.

Return only transformation

I think it would be a good idea to have an option to just return the transformation computed by moment_match.
This would make it more memory efficient when doing many moment matches (e.g. for loo-cv, or power-scaling).

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.