Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bgoodri opened this issue Apr 18, 2017 · 10 comments
Open

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

bgoodri opened this issue Apr 18, 2017 · 10 comments
Labels
Milestone

Comments

@bgoodri
Copy link
Contributor

bgoodri commented Apr 18, 2017

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

@bob-carpenter bob-carpenter added this to the 2.15.0++ milestone Apr 19, 2017
@bob-carpenter
Copy link
Contributor

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.

@syclik
Copy link
Member

syclik commented Apr 19, 2017 via email

@syclik
Copy link
Member

syclik commented May 9, 2017

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

@bgoodri
Copy link
Contributor Author

bgoodri commented May 9, 2017 via email

@syclik
Copy link
Member

syclik commented May 9, 2017 via email

@bob-carpenter
Copy link
Contributor

bob-carpenter commented May 10, 2017 via email

@bgoodri
Copy link
Contributor Author

bgoodri commented May 10, 2017 via email

@jgabry
Copy link
Member

jgabry commented May 10, 2017 via email

@mitzimorris mitzimorris removed their assignment May 12, 2017
@mitzimorris
Copy link
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.

@ahartikainen
Copy link

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 " "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants