I have successfully installed coda in R, and I am also able to read
output from a Bugs run into
coda. When I try to plots from CODA Output Analysis Menu, I do however
_get_ problems:
CODA Output Analysis Menu
*************************
1:Plots
2:Statistics
3:List/Change Options
4:Return to Main Menu
Selection: 1
Error: "missing" illegal use of missing
Quitting CODA....
Do you want to save the BUGS output as an R object file(y/n) ?
1:
I tried to use the same data in the Splus version of coda, and that
worked fine.
I have also got the same type of problem with coda in R with output from
a completely different model.
Can anybody help me with this?
Geir
- --
Geir Storvik Tlf: (+47) 22855894
1. Amanuensis Fax: (+47) 22854349
Department of Mathematics email: geirs at math.uio.no
Statistics Division
University of Oslo
P.O.Box 1053 Blindern
N-0316 Oslo
Norway
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Problems with coda
4 messages · Geir Olve Storvik, LUK ShunTim, Martyn Plummer
Geir Olve Storvik wrote:
I have successfully installed coda in R, and I am also able to read output from a Bugs run into coda. When I try to plots from CODA Output Analysis Menu, I do however _get_ problems: CODA Output Analysis Menu ************************* 1:Plots 2:Statistics 3:List/Change Options 4:Return to Main Menu Selection: 1 Error: "missing" illegal use of missing Quitting CODA.... Do you want to save the BUGS output as an R object file(y/n) ? 1: I tried to use the same data in the Splus version of coda, and that worked fine. I have also got the same type of problem with coda in R with output from a completely different model.
Geir,
I had the same problem and got it fixed by adding an additional argument
"bwf" to the "densplot" function like this:
"densplot" <-function (x, combine.chains = F, bwf)
{
x <- as.mcmc(x)
# *** Argument bwf required do.densplot <- function(j, i) {
# Like the next line
do.densplot <- function(j, i, bwf) {
#NB Using R scoping rules
#
if (missing(i))
y <- as.vector(x[, j, , drop = T])
else y <- as.vector(x[, j, i, drop = T])
y.orig <- y
# *** R complains about the next line, "illegal use of missing"
if (missing(bwf)) {
N <- length(!is.na(y))
bw <- 1.06 * min(sd(y), IQR(y)/1.34) *
N^-0.2
}
else {
bw <- bwf(y)
if (bw == 0)
bw <- 0.1
}
...
There are a couple of other bugs, too.
I have notified the author/maintainer of the package and according to
him, it may be due to changes in R between 0.62 and 0.63 and he is
trying to look at the problem.
Regards,
ST
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
2 days later
Thanks to ShumTim for comments on the problems regarding CODA. As noted, the "missing" problem is not the only one in CODA, and correcting this only made CODA to crash at another place. It therefore seems best to wait for an updated version of CODA Geir
LUK ShunTim wrote:
Geir Olve Storvik wrote:
I have successfully installed coda in R, and I am also able to read output from a Bugs run into coda. When I try to plots from CODA Output Analysis Menu, I do however _get_ problems: CODA Output Analysis Menu ************************* 1:Plots 2:Statistics 3:List/Change Options 4:Return to Main Menu Selection: 1 Error: "missing" illegal use of missing Quitting CODA.... Do you want to save the BUGS output as an R object file(y/n) ? 1: I tried to use the same data in the Splus version of coda, and that worked fine. I have also got the same type of problem with coda in R with output from a completely different model.
Geir,
I had the same problem and got it fixed by adding an additional argument
"bwf" to the "densplot" function like this:
"densplot" <-function (x, combine.chains = F, bwf)
{
x <- as.mcmc(x)
# *** Argument bwf required do.densplot <- function(j, i) {
# Like the next line
do.densplot <- function(j, i, bwf) {
#NB Using R scoping rules
#
if (missing(i))
y <- as.vector(x[, j, , drop = T])
else y <- as.vector(x[, j, i, drop = T])
y.orig <- y
# *** R complains about the next line, "illegal use of missing"
if (missing(bwf)) {
N <- length(!is.na(y))
bw <- 1.06 * min(sd(y), IQR(y)/1.34) *
N^-0.2
}
else {
bw <- bwf(y)
if (bw == 0)
bw <- 0.1
}
...
There are a couple of other bugs, too.
I have notified the author/maintainer of the package and according to
him, it may be due to changes in R between 0.62 and 0.63 and he is
trying to look at the problem.
Regards,
ST
--
Geir Storvik Tlf: (+47) 22855894
1. Amanuensis Fax: (+47) 22854349
Department of Mathematics email: geirs at math.uio.no
Statistics Division
University of Oslo
P.O.Box 1053 Blindern
N-0316 Oslo
Norway
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I apologise for the state of CODA. I am working on a new version. Martyn
On 15-Apr-99 Geir Olve Storvik wrote:
Thanks to ShumTim for comments on the problems regarding CODA. As noted, the "missing" problem is not the only one in CODA, and correcting this only made CODA to crash at another place. It therefore seems best to wait for an updated version of CODA Geir
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._