Error running bernoulli example of Stan in julia - julia

I'm trying to run the bernoulli example that is
here using cmdstan2.17.1
however when I run the bernoulli.jl file in atom, after changing the
CmdStanDir="/CMDSTAN_HOME"
to the path where I created the .bash file, it gives me this error:
An error occurred while compiling the Stan program.
Please check your Stan program in variable 'bernoulli' and the contents of /Users/panky/Desktop/Uni/IO/T2/tmp/bernoulli_build.log.
Buy when I go to that file it appears this:
make: *** No rule to make target '/Users/panky/Desktop/Uni/IO/T2/tmp/bernoulli'. Stop.
What does it means? What am I doing wrong?

Please set your CMDSTAN_HOME = to the path where your CmdStan program lives. Right now it is set to ("/Users/panky/Desktop") , which is pointing to your Desktop

Related

How to view warnings for incorrect Stan model in rstan?

Currently, if I make a typo in *.stan file (forget a trailing semicolon for example), and then run the model in R, it just silently quits without showing any error messages:
library(rstan)
fit <- stan(file="mymodel.stan", data=c(1,2))
Is there a way to see compilation errors for my Stan model? Something like
Semicolon missing on line 13
This answer should not be necessary for much longer into the future, but in the recent past you may need to do
install.packages("rstan", type = "source")
in order to correctly handle the exceptions that are thrown when parsing invalid Stan programs under the Catalina version of the Mac OSX operating system.

kerasR giving error

I am trying to use kerasR for deep learning in R. I am trying to reproduce the examples in the package. Trying the following code produces error:
library(kerasR)
mod <- Sequential()
The error is:
Error in Sequential() : attempt to apply non-function
I'd suggest to look at this issue in KerasR Github repo:
https://github.com/statsmaths/kerasR/issues/1
Basically you should check where is located your version of python and then use reticulate::use_python("PATH_TO_PYTHON") to tell the system where to find Python.
Watch Out!
You can load just one Python interpreter per session and the use_python() function doesn't warn you if there already is a loaded interpreter.
Moreover if you run py_config() it automatically loads the first interpreter that he finds (which, in your case, seems to be the wrong one!), thus you'd better call reticulate::use_python("PATH_TO_PYTHON") before anything else.

display trees of discrepancy analysis in R (using graphviz)

I am doing a discrepancy analysis in R and have problems displaying the tree with graphviz. I did everything as described in Studer et al 2011 (in: Guillet et al: Advances in Knowledge Discovery and Management). I use the disstree command to build my tree called tree.lcp and then try to display it with graphviz:
seqtree2dot(tree.lcp, filename="hh.lcp", seqdata=seqhh)
shell("dot -Tsvg -O hh.lcp.dot")
There is no problem with the first command but the second brings this error message:
Can not find command "dot" .
Error messages:
1: command 'C:\Windows\system32\cmd.exe /c dot -Tsvg -O hh.lcp.dot' gave status 1
2: In shell("dot -Tsvg -O hh.lcp.dot") :
'dot -Tsvg -O hh.lcp.dot' process failed - error code 1
I suppose it has something to do with th path command (see GraphViz: Windows PATH not set with new installer, issue when calling from R) but I installed GraphViz to C:\Program Files (x86)\Graphviz2.36 which I understand is the default.
Any idea, where the problem lies? And how could I include the path in the shell-command if the problem is still the path command?
Thanks! Katharina
You can specify the path as follows
shell(paste('"C:/Program Files (x86)/Graphviz2.36/dot"','-Tsvg -O hh.lcp.dot'))
However, if you want to plot a tree from dissimilarities between sequences, you are probably better to use the newer simplified seqtreedisplay function that generates the plot directly from the seqtree object, i.e., the outcome of the seqtree function. Normally, seqtreedisplay should find Graphviz by itself.
For more details, look at the help page by typing help(seqtreedisplay).
The latest TraMineR version has a new function that run everything directly. The function is called seqtreedisplay.
seqtreedisplay(tree.lcp, type="d")
Try running: TraMineR.checkupdates() to know if you have the latest stable version.

Difficulty calling R2OpenBUGS

I am having a problem calling R2OpenBUGS.
I suspect it is probably simple to fix but I can't spot the solution.
My call looks like this:
MCMCres<-bugs(data=d,inits=inits,parameters.to.save=c("theta","alpha","tau","precv"),
n.iter=2000,model.file="model.txt",n.chains=2,n.burnin=250,n.thin=5,
OpenBUGS.pgm=BugsDir,codaPkg=F,working.directory=wdir,debug=T,WINE=NULL)
The error I get back is as follows:
Error in bugs.run(n.burnin, OpenBUGS.pgm, debug = debug, WINE = WINE, :
Look at the log file in C:/Users/James/Desktop/ALS Spatial Analysis/ALS and
try again with 'debug=TRUE' to figure out what went wrong within OpenBUGS.
Now OpenBUGS isn't even opening so the log file is not written. I'm not sure whats going on since this is all I have to go on. It is finding the OpenBUGS executable and it is finding the model file as those were errors I had gotten previously and have fixed.
Any ideas anyone ?

How do I initialize variables used for importing libraries in Ride?

I have a custom robot framework library which accepts an argument to initialize it.
*** Settings ***
Library NotifyUsers ${max_messages}
This works just fine when executed from the command line using pybot:
pybot --variable max_messages:4 my_test
However, this variable doesn't exist in Ride when it imports the library at startup. I've tried defining it in the Arguments field on the Run tab, but that isn't instantiated until you run a test.
If I replace the variable and hard code an integer argument, it works fine in Ride.
Apologies to Bryan Oakley! I somehow managed to delete his answer which pointed me in the right direction.
Adding an entry to the variable table does not resolve this issue, however using a Variable File does! It appears that Ride will import variable files when it starts up. Variable Tables contained in a test suite are not resolved until run time.

Resources