Skip to content

ADVI can write 1.#INF on Windows, which cannot be read #2283

Open

Description

@bgoodri

Summary:

It is possible for ADVI to obtain a realization that is infinite, and if it writes that to a CSV file, reading the CSV file breaks. We should coerce this to the nearest floating point number before writing.

Description:

CSV files should only have finite numerical values below the headings

Reproducible Steps:

In R 3.2.x for Windows, load rstanarm 2.15.x and do

fit <- stan_glm(mpg ~ ., data = mtcars, prior = hs_plus(4, 1, 2, 0.5), 
                       seed = 12345 algorithm = "meanfield", QR = TRUE)

Current Output:

scan() expected 'a real', got '1.#INF'

Expected Output:

Finite estimates

Additional Information:

Provide any additional information here.

Current Version:

v2.15.0

Activity

  1. added this to the milestone on Apr 19, 2017
  2. bob-carpenter commented on Apr 19, 2017

    @bob-carpenter
    Member

    Is there something in this (stan-dev/stan) repo that should be fixed?

    Would it be OK if that fix allowed infinite and NaN values to be read?

    I added the next release as milestone and assigned to @mitzimorris but I'm still not sure what needs to be fixed (if anything) in this repo.

  3. syclik commented on Apr 19, 2017

    @syclik
    Member
  4. syclik commented on May 9, 2017

    @syclik
    Member

    @bgoodri, thoughts? Can we either close this or list what needs to be done?

  5. bgoodri commented on May 9, 2017

    @bgoodri
    ContributorAuthor
  6. syclik commented on May 9, 2017

    @syclik
    Member
  7. bob-carpenter commented on May 10, 2017

    @bob-carpenter
    Member
  8. bgoodri commented on May 10, 2017

    @bgoodri
    ContributorAuthor
  9. jgabry commented on May 10, 2017

    @jgabry
    Member
  10. removed their assignment
    on May 12, 2017
  11. mitzimorris commented on May 12, 2017

    @mitzimorris
    Member

    what is the current proposal? initial proposal was this:

    In Stan, update the writers so that it prints something not OS dependent. That's this file: src/stan/callbacks/stream_writer.hpp

    unassigned myself per subsequent discussion, but happy to do this if that's what we want.

  12. ahartikainen commented on Jun 12, 2017

    @ahartikainen

    Are these not the common/preferred ways to write&read infinities / nans to and from CSV?

    They should be platform independent. I mean reading with common R/Python(Pandas) tools.

    inf
    -inf
    nan or " "
    
  13. removed this from the 2.16.0 milestone on Jul 5, 2017
  14. 6 remaining items

  15. removed this from the 2.17.0 milestone on Sep 6, 2017
  16. modified the milestones: 2.18.0, 2.18.0++ on Jul 13, 2018
  17. modified the milestones: 2.18.1, 2.18.1++ on Dec 23, 2018
  18. modified the milestones: 2.18.1++, 2.19.0++ on Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions