stan-dev / stan-dev/rstan

Couple of issues with variational...

Open
#480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:
  1. With certain models, calling vb(model, data) will run properly with some datasets, but produce a no valid constructor errors with others.
  2. Running the same model using cmdstan variational and trying to import the results into R with read_stan_csv, produces a not all are integers error.
Description:

Describe the issue as clearly as possible.

I made and compiled a model, and would like to run variational bayes on it. I first try to do this with a subset of my data (3000 rows), and I am able to do it using vb() from inside R. I then try to run vb() using the full dataset (60000 rows) and get this error:

> vbout_all <- vb(model, data_all_arima$data_bundle)
trying deprecated constructor; please alert package maintainer
Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) : 
  no valid constructor available for the argument list
failed to create the model; variational Bayes not done

To be clear, this is exactly the same model, run in the same session. The two datasets are generated using the same code, the only difference being that in one, only the first 3000 rows are used.

I therefore try to run variational using cmdstan, outputting the same dataset using stan_rdump. This runs fine (on the full 60k dataset). However, when I then try to import the output into R with read_stan_csv, I get this error:

> vb_arima <- read_stan_csv("./vb_arima")
Error in all_int_eq(warmup) : not all are integers
In addition: Warning message:
In FUN(X[[i]], ...) : line with "Elapsed Time" not found
Reproducible Steps:

Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.

See above. I would prefer not to share my model publicly, and am not permitted to share the dataset. I am happy to go over the details and share privately with a developer looking at the issue.

If you have a reproducible example, please include it.

Current Output:

If applicable, any relevant output from RStan.

See above.

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

The version of RStan you are running (e.g., from packageVersion("rstan"))
2.17.2

R Version:

The version of R you are running (e.g., from R.version.string)
R version 3.4.3 (2017-11-30)

Operating System:

Your operating system (e.g., OS X 10.11.3)
10.12.6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two reported entry points, vb(model, data) and read_stan_csv(), using the supplied RStan 2.17.2 and R 3.4.3 environment while comparing the 3,000-row and 60,000-row cases. Inspect the cmdstan variational output produced via stan_rdump, including the missing “Elapsed Time” line and warmup parsing. Done means both variational paths complete and the generated CSV imports without either reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.