ggPMX icon indicating copy to clipboard operation
ggPMX copied to clipboard

VPC CI of lower percentile missing

Open tmss1 opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug CI for lower percentile missing in VPC

To Reproduce

ctr2 %>% 
  pmx_plot_vpc(
    scale_y_log10 = T,
    bin = pmx_vpc_bin(style="equal"),
  ) 

image

There are warning messages about NaN values: image

Not sure if they are from the log-transformation of very small values, and if are causing the problem? Is it possible to check this and may exclude them for computation of CI?

tmss1 avatar Nov 24 '22 14:11 tmss1

My guess is many of the simulated values give NA or it is highly variable, which makes the lower value confidence interval not show or be reliable.

Depending on the model, it could be simulating values that are negative and then gives the bad values. If that is the case, you could try a log-normal distribution of residuals to see if this helps the VPC.

I'm unsure if this can be solved or not.

mattfidler avatar Nov 28 '22 23:11 mattfidler

Thanks @mattfidler, As a follow up, the CIs are showing okay for a narrower prediction interval (e.g., 25th to 75th as attached), so it seems to support your suspicion that the simulated values are highly variable and some are too low or give NA values. The error model is only proportional so there should not be negative values.

image

tmss1 avatar Jan 13 '23 11:01 tmss1

@tmss1

  • thanks for bringing up this issue
  • it has so far not been possible to reproduce the missing lower percetile Confidence Interval using available data
  • if there is any data you could share (here or privately) that would allow the behavior to be reproduced, then it may be possible to analyse it (otherwise we would try to generate some synthetic data)

tynsci avatar Jan 23 '23 09:01 tynsci

Thanks @tynsci, Would you be able to start the investigation with some synthetic data first please as it may be difficult to share the data?

tmss1 avatar Feb 16 '23 10:02 tmss1