Code Monkey home page Code Monkey logo

cmdstan's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmdstan's Issues

make fails to remake model when headers change

Presumably related to #27 -- make doesn't pick up any changes to dependent headers, requiring a user to delete any existing compiled executable before recompiling. I'm guessing that the makefile doesn't look into the Stan submodule somehow, although the best I can figure is that the dependencies are set in Line 108 of the makefile which should look into the submodule.

Rename print stansummary

(original issue: stan-dev/stan#664)

from @tmalsburg:
The name print is already taken by other Unix tools. Installing print on Unix-like systems may therefore lead to conflicts. Apart from that, print is not very informative as a name. The issue came up in #630 and I proposed to rename print to stansummary (reminiscent of R's summary function which does something similar for mixed models). @bob-carpenter proposed mcmcprint and stanprint. I like the use of stan as a prefix for all stan-binaries because that is informative and it reduces the probability of naming conflicts with other software packages.

Changing the name would probably require changes in some other places as well: documentation, other software that builds on stan (stan-mode.el for example), etc. Not at least, the users have to relearn the command. Nevertheless, it might make sense to change it.

makefile issue: stan/version.hpp: No such file or directory

Reported by @goedman on stan-dev on 6/14/2014:
I noticed below warning messages. The file is clearly available, but 1 level deeper (.../cmdstan/stan/src/stan/version.hpp).

Might just be temporarily, while the separation of stan and cmdstan is in progress.
...
From https://github.com/stan-dev/cmdstan
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
Robs-15inch-2:cmdstan rob$ make stan-update
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
git submodule init
git submodule update
Robs-15inch-2:cmdstan rob$ 

Additional relevant info:
I get the 3 messages every time I compile a model, not just when I update/compile CmdStan.

The issue seems to be that the path is missing the extra /stan/ element in the grep path.

But if it is just me, it is not a big deal.

And, yes, it looks like that's the issue.

CmdStan build fail on ubuntu (2.4.0)

Hi - just tried building from current master (which I believe matches v2.4.0 - git commit 3ba4dcc). I'm on Ubuntu Trusty 14.04.1, with gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2.

These two compiles seemed to complete successfully:

         make bin/libstanc.a
         make bin/libstan.a

but then when I run

         make src/models/basic_estimators/bernoulli

I get

g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -Wno-unused-local-typedefs  -lpthread  -O0 -o test/test-models/stanc src/test/test-models/stanc.cpp -Lbin -lstanc

--- Translating Stan model to C++ code ---
test/test-models/stanc src/models/basic_estimators/bernoulli.stan --o=src/models/basic_estimators/bernoulli.cpp
Model name=bernoulli_model
Input file=src/models/basic_estimators/bernoulli.stan
Output file=src/models/basic_estimators/bernoulli.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -Wno-unused-local-typedefs   -c -O3 -o src/models/basic_estimators/bernoulli.o src/models/basic_estimators/bernoulli.cpp
In file included from src/stan/agrad/rev.hpp:4:0,
                 from src/stan/model/model_header.hpp:16,
                 from src/models/basic_estimators/bernoulli.cpp:3:
src/stan/agrad/rev/var_stack.hpp:49:17: warning: ‘void stan::agrad::free_memory()’ defined but not used [-Wunused-function]
     static void free_memory() {
                 ^

--- Linking C++ model ---
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -Wno-unused-local-typedefs  -lpthread  -O3 -o src/models/basic_estimators/bernoulli src/models/basic_estimators/bernoulli.o -Lbin -lstan
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [src/models/basic_estimators/bernoulli] Error 1

Also, make bin/stanc results in make: *** No rule to make target 'bin/stanc'. Stop. So does make bin/print.

I'm following the instructions in "cmdstan-guide-2.4.0.pdf". I wonder if the doc is wrong or the code is wrong...?

Argument names to model seem wrong?

Running the compiled bernoulli model for help on arguments yield the following:

./bernoulli
Usage: ./bernoulli <subarg1_1> ... <subarg1_m> ... <arg_n> <subarg_n_1> ... <subarg_n_m>

Begin by selecting amongst the following inference methods and diagnostics,
sample Bayesian inference with Markov Chain Monte Carlo
optimize Point estimation
diagnose Model diagnostics

Or see help information with
help Prints help
help-all Prints entire argument tree

Additional configuration available by specifying
id Unique process identifier
data Input data options
init Initialization method: "x" initializes randomly bewteen [-x, x], "0" initializes to 0, anything else identifies a file of values
random Random number configuration
output File output options

See ./bernoulli [ help | help-all ] for details on individual arguments.

Failed to parse arguments, terminating Stan

However, the actual argument names for e.g. data and output seem to be "data file" and "output file"? E.g.: ./bernoulli sample data file=bernoulli.data.R output file=tst.csv

catch and reject random seeds that overflow int

From Andria Dawson on stan-users:

When I use the flag random seed=4294967295, I do not get the same behavior each time (whereas I do for the other seeds I get/try). When this seed is used, I see a different seed number in my csv output file as well. I flukily noticed this using one of my models, so tried with the birats models posted in the Stan examples list (see: https://github.com/stan-dev/stan/tree/master/src/models/bugs_examples/vol2/birats) but still get this strange behavior.

Is there something I am doing incorrectly that would make a single seed not work when others seem to?

I am using CmdStan 2.1.0

To see this using birats, I can run:

./birats.exe sample num_warmup=20 num_samples=10 save_warmup=1 data file=birats.dump random seed=4294967295 output file=birats.csv

I (Bob) believe the problem may be due to the fact that the given seed overflows a signed int (but not an unsigned int). We should read in a long and check that it'll fit into an int and flag it if it doesn't. No idea why the behavior would change from run to run.

rewrite bin/print to not require footer/comments

[moved from stan-dev/stan#486]

Reported by Bob:
From Marcus (and me informally):

It would be great if we could run bin/print on just a CSV file of samples. That would let us monitor as we go on the CSV file. For online evaluation, it'd be very nice if we could ignore an incomplete last line.

It'd be even nicer if we had something that could connect to tail or something and calculate as we go, rather than having to recalculate bin/print. Then we could have live monitors like BUGS did

Parser Should Generate a hpp, Not a cpp

see stan-dev/stan#803

From Michael:
Right now the parser turns example.stan into example.cpp, even though the generated C++ no longer includes a main function. It would be more consistent to have the parser generate a .hpp file.

A bunch of the tests that use parsed models will have to be updated.

catches with informative errors for wrong argument value types in command.hpp

(original issue: stan-dev/stan#398)

Bob writes:
We should print out informative answers for arguments of the wrong types in the command. Here's the current behavior:

~/temp2$ ./sd sample adapt engaged=4

Exception: bad lexical cast: source type value could not be interpreted as target
Diagnostic information:
Throw location unknown (consider using BOOST_THROW_EXCEPTION)
Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEEE
std::exception::what: bad lexical cast: source type value could not be interpreted as target

What should be happening is that we detect that 4 is not a valid value for engaged, which only takes boolean values, and we should report that.

CmdStan guide updates needed

Since the Command Stan guide was written, the example-models have been moved into their own repo. The guide references these models throughout - update all sections so that they are consistent with current repo organization.

meaningful messages on files not existing

Right now, if the user provides a file that doesn't exist, they get an error message that one of the variables in the model can't be found (init or data, depending on usage).

What should happen is that we should test that the file exists and return a meaningful message if it doesn't.

I don't know whether this is something that's going to get sorted out automatically in the new command config infrastructure or not.

(I also filed the same issue on RStan.)

printing "Elapsed Time--" two times

Suppose I have a model compiled with the executable called foo. After running it, I have output.csv, which has the following tails

$ tail -n 15 output.csv
-0.0448711,0.989694,1.04541,2,3,0,-0.29957,0.155283
-0.306522,0.91375,1.04541,2,3,0,0.782971,0.752996
-0.367464,0.985952,1.04541,1,1,0,0.857279,-0.0714063
-0.795205,0.968491,1.04541,2,3,0,1.26111,-1.00386
-0.387185,1,1.04541,1,1,0,0.879983,0.233558

#  Elapsed Time: 0.009149 seconds (Warm-up)
#                0.016632 seconds (Sampling)
#                0.025781 seconds (Total)


#  Elapsed Time: 0.009149 seconds (Warm-up)
#                0.016632 seconds (Sampling)
#                0.025781 seconds (Total)

remove model tests from cmdstan

the model tests - basic distributions, estimators, bug_examples, etc - are being tested via cmd stan.
these tests need to be reworked - we should remove them for the time being, since they are too brittle to be useful.

issue with path in makefile for stan/version.hpp

Rob Goedman reports on stan-users:

I noticed below warning messages. The file is clearly available, but 1 level deeper 
( .../cmdstan/stan/src/stan/version.hpp).

From https://github.com/stan-dev/cmdstan
 * branch            develop    -> FETCH_HEAD
Already up-to-date.

$ make stan-update
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
grep: /Users/rob/Projects/Stan/cmdstan/src/stan/version.hpp: No such file or directory
git submodule init
git submodule update

seg fault when using diagnostic mode

Matt Spencer's code (submitted to stan-users) either:

  1. seg faults
  2. reports a bus error

when running like:

> ./coralss7 data file=coralss7.data.R method=diagnose

It gets to printing TEST GRADIENT MODE then dies.

call make from anywhere

We should be able to call make from anywhere by specifying a -f flag to the makefile in the cmdstan directory.

@mitzimorris has already gotten most of this done, but it looks like there was a snag towards the end. I'll try to get it fixed.

Fix documentation for building a Stan program

Jarrett Barber on stan-users reported:

Hi All,

I built cmdstan 2.4.0 on Mac OS X 10.9.4 today seemingly without a hitch (as described in cmdstan-guide-2.4.0.pdf Appdendix B.7.).  As a quick check to see if things are working, I tried to compile the bernoulli file as described in Section 2.4 of the guide.  But, a symbol is not found; see error below.  Note that my installation of cmdstan 2.1.0 still works fine.  It appears that some of the directory structure of the Stan distribution has changed since 2.1.0.  Perhaps the makefile needs updated flag variables to point in the right location of libraries?  Just a guess.  Anyway, your help is appreciated.

Best,

Jarrett

bash-3.2$ pwd
/Applications/cmdstan/stan
bash-3.2$ make src/models/basic_estimators/bernoulli

--- Linking C++ model ---
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -Wno-unused-function -ftemplate-depth-256    -O3 -o src/models/basic_estimators/bernoulli src/models/basic_estimators/bernoulli.o -Lbin -lstan
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [src/models/basic_estimators/bernoulli] Error 1
bash-3.2$ 

trim Boost and Eigen libs in releases a la RStan

Chop down the library size in CmdStan for releases the same way it's done in RStan (and presumably PyStan).

I think C++ Stan should keep all of the libs in its repo to make it easy to develop against.

next version of cmdstan manual (2.4.0++)

  • explain what happens if algo=fixed_param is specified without also specifying user-defined inits

Bill Harris pointed out some issues on stan-users:

  • change paths to example models to new location; right now they are src/models/basic_estimators and we need to use the path where they actually are (I think stan/src...)
  • change the way we refer to stan-home to make it clear that it's now cmdstan-home; we can't identify it by saying it's the directory with the makefile, because both cmdstan and cmdstan/stan have makefiles
  • Bill Harris also suggests we might want to add a dummy file to the home directory we intend, such as cmdstan/THIS_FILE_IS_IN_CMDSTAN_HOME

More from Bill Harris:

  • Reword the Cygwin install instructions, which refer to RStan. I'm not sure what's up with them, but they now end with "At this point the instructions given for installing Rstan finally worked."

Still more:

The Cygwin instructions come at the end of section B.4. Does "At this point the instructions given for installing Rstan finally worked" imply one should return to the start of B.4 (Windows installation) or to B.3 (Linux installation)? The former seems to imply that Rtools is necessary, and the latter seems to suggest that the Cygwin tools may suffice.
  • upgrade Mac OS X install instructions

Jiqiang and Andrew are going to update this:

https://github.com/stan-dev/rstan/wiki/RStan-Mac-OS-X-Prerequisite-Installation-Instructions

at which point we can just copy it into the CmdStan manual.

  • Fix documentation for building a Stan program #45
  • update doc for L-BFGS default, pointers to Stan language doc #44

Fix make target for stan-pr/*

This is for Jenkins. The account doesn't have config automatically set up and it fails to merge pull requests properly.

Error reading in large integral real values

Originally reported by @ksvanhorn in stan-dev/stan#204.

Example model:

data {
  int y;
}
parameters {
  real<lower=0,upper=1> theta;
}
model {
}

Example data 1:

y <- -138109526142584496

Example data 2:

y <- 1234567890123456789

Running:
./issue data file=issue.data.R sample

results in:

...
Exception: variable does not exist; processing stage=data initialization; variable name=y; base type=int
Diagnostic information: 
Dynamic exception type: St13runtime_error
std::exception::what: variable does not exist; processing stage=data initialization; variable name=y; base type=int

Option to have the print command produce a CSV file

From ksvanhorn:
Often I want to process the results of the print command from R or via some other automated process. This is made more convenient if I can get the results in CSV format.

I've already written code to do this, and will be creating a feature branch with my mods.

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.