SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: order of arguments in the formula for ctree function [ Reply ]
By: Torsten Hothorn on 2016-09-20 11:54
[forum:43512]
Dear Ismail,

Thanks a lot for this report. In fact, this was a bug present when all log-p-values are very small. The code was a little too strict about ties in general and also did not work as intended in the case of ties. This is now fixed in r955 and will travel to CRAN in due course. For your example, the two calls produce the same tree (use majority = TRUE for the same NA handling).

Best,

Torsten

RE: order of arguments in the formula for ctree function [ Reply ]
By: ismail sezen on 2016-09-17 19:09
[forum:43507]
Sorry;

data.abl <- readRDS("data.abl.rds")

RE: order of arguments in the formula for ctree function [ Reply ]
By: ismail sezen on 2016-09-17 19:07
[forum:43506]

data.rds (10) downloads
Re-upload as rds file format by saveRDS function. (211K)

RE: order of arguments in the formula for ctree function [ Reply ]
By: Achim Zeileis on 2016-09-17 19:05
[forum:43505]
Thanks for the example. Unfortunately, the data appears to be corrupted after upload to R-Forge. When I download it and try to load it into R I get:

R> load("data.abl.rda")
Error: bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file 'data.abl.rda' has magic number 'BZh9'
Use of save versions prior to 2 is deprecated

Can you try to replace the file and check that it works after upload? Thanks!

RE: order of arguments in the formula for ctree function [ Reply ]
By: ismail sezen on 2016-09-17 17:42
[forum:43504]

data.abl.rda (23) downloads
I can say that I have almost zero p-values. I've attached whole data file (181K). I tried to fetch a sample but it didn't reproduce the same error below %60. So, I'm sending whole data. Tree plot changes at the very first node.

library(partykit)
x <- data.abl
x <- x[complete.cases(x),] # remove NA
ctm <- ctree(pm10 ~ abl.hf + temp + spd + inv.type + dn, x); plot(ctm)
ctm <- ctree(pm10 ~ temp + abl.hf + spd + inv.type + dn, x); plot(ctm)

Some Extra Information:
pm10 (numeric): Particulate Matter
abl.hf (numeric): Atmospheric Boundary Layer (this is negative correlated with pm10 but not high ~ -35)
temp (numeric): Surface Temperature (correlation with pm10 is almot zero)
spd: Wind speed (Negative correlated with pm10 but not high ~ -0.35)
inv.type (factor): Inversion Type
dn (factor): Day or Night

pm10, abl.hf and spd have right-skewed distribution.

cor(pm10 ~ abl.hf) = -0.35
cor(log10(pm10) ~ log10(abl.hf)) = -0.52

RE: order of arguments in the formula for ctree function [ Reply ]
By: Achim Zeileis on 2016-09-17 15:40
[forum:43503]
Usually, this should not happen. However, we have seen numerical problems for very extreme (almost zero) p-values. But it is hard to say more without a reproducible example. Could you please post a minimal data set and ctree() calls that illustrates the problem?

order of arguments in the formula for ctree function [ Reply ]
By: ismail sezen on 2016-09-17 01:01
[forum:43502]
Hello,

I'm using new partykit package. If I change order of arguments in the formula, the resultant tree changes. It does not happen in old party::ctree function. Is this an expected behavior?

Thanks to:
Vienna University of Economics and Business Powered By FusionForge