Colin,
probability theory is not one of my strengths, so I'd have to
approach this using a kind of brute-force method.
Generally, you have a set of bounds, you could experiment by
specifying a range of means for the random-exponential, and if you
do enough of each value, you can calculate the mean of the resulting
data set and get kind of a mapping between "incoming means"
(supplied to the function) and outcoming means (that come out of
repeated calls to the function).
I did something like this in the following R code:
First, a function to give me a bounded exponential (note R's rexp
uses a rate, where rate = 1/mean):
rexp_truncated <- function(emean, lowerlimit, upperlimit) {
tmp <- rexp(n = 1, rate = 1/emean)
while (tmp < lowerlimit | tmp > upperlimit) {
tmp <- rexp(n = 1, rate = 1/emean)
}
return (tmp)
}
Then I did some loops (probably quite inefficient) to sweep the
values of "incoming-mean" and lower/upper bounds:
n <- 10000
df <- NULL
for(emean in seq(from = 2, to = 5, by = 0.5)) {
for (lowerlimit in seq(from = .5, to = 1, by = 0.1)) {
for (upperlimit in seq(from = 10, to = 15, by = 1)) {
tmp <- c(emean, lowerlimit, upperlimit,
mean(replicate(n = n, rexp_truncated(emean = emean,
lowerlimit = lowerlimit, upperlimit = upperlimit)))
)
df <- rbind(df, tmp)
}
}
}
colnames(df) <- c("incoming-mean", "lowerlimit",
"upperlimit", "estimated-mean")
And this will give an output something like this:
If "n" is large enough, these "estimated-mean"/out-coming values are
pretty stable... but if the limits are too close to the
incoming-mean, it can take a long time for rejection-sampling to get
all the values...
So here, let's say (conveniently - because it happened to be in my
table) I want the resulting mean to be 2.5, and my lower limit is
0.5 and upper limit is 15. That means I'd need to supply the
truncated-exponential function a mean of 2.
You might need to work that backwards using an optimization
technique so that you can provide the estimated-mean and the bounds
and get the "incoming mean" needed given those bounds. Though
somebody better versed in calculus of probability distributions
could probably develop a similar mapping function analytically, but
that wouldn't be me!
Note that even if you can get the means to match this way, the
variance of the truncated distribution probably cannot be made to
also match.
I hope that helps!
Dale