简体   繁体   中英

WinBUGS error 'expected key word END' caused by wrong exponential code (not length of data)

Q: Can anyone tell me the maximum number of data rows in a WinBUGS data file?

How I found out there is a maximum. While building and testing a WinBUGS model in R2WinBUGS, I constructed a dummy data set with all possible data combinations of 6 variables (18750 rows). By running the code in R, WinBUGS built the model and loaded the data and then crashed. After repeating this in WinBUGS directly, I got the message 'expected key word END' while loading the data, although there is 'END' at the end of my data file (including the required empty line after that). It took me some time to find out that cutting a lot of data rows fixes the problem. There is no information (to my knowledge) in the WinBUGS Manual or tutorials I found on the net.

Update: found out that 372 rows is too long, 216 rows is ok. I guess 254 is the maximum length.

Answer

Discovered this by accident. The problem was not the data length, but the presence of X.Xe-4 in stead of X.XE-4 (it is clearly stated in the manual, I just didn't think of that when I saw the error 'expected key word END'. Limiting the data length just limited the probability of getting a small number in my data set.

See my own answer above: it was the presence of X.Xe-X in stead of X.XE-X in the data set that led to 'expected key word END'

Update 2 December 2015: FYI: I got the same error when I entered 2E-07 (changed from R-style 2e-07). The correct format is 2.0E-07 or 2.0E-7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM