Ted Byers
2010-Jul-16 19:20 UTC
[R] Elementary question about computing confidence intervals.
I would have thought this to be relatively elementary, but I can't find it mentioned in any of my stats texts. Please consider the following: library(fitdistrplus) fp = fitdist(y,"exp"); rate = fp$estimate; sd = fp$sd fOneWeek = exp(-rate*7); #fraction that happens within a week - y is measured in days fr = exp(-rate*dt); #fraction remaining - dt = elapsed time from time of sample to present fh = 1 - fr; # fraction that occurred from time of sample to present # assume n = total number that have happened from time of sample to present T = n / fh # t is the total number at y = 0 NR = fr * T NNW = NR * (1 - fOneWeek) (If you wanted to run this, just populate y with random numbers from an exponential distribution.) What I show here simply extracts an estimate and standard deviation from the data.frame returned by fitdist, and tries to compute a number of integrals. What I need is the number of events that can be expected next week, next month, and from now to the end of time. Unless I have gone senile in my old age, I have the integrals correct. Please correct me if I missed something. But what I need help (to refresh my memory - I used to know this way back in the stone age) to compute the confidence intervals for each of these integrals. So I don't bother anyone with similar elementary questions, what web resource exists that defines confidence intervals for such integrals for arbitrary distributions? or does such a resource exist? Thanks Ted [[alternative HTML version deleted]]