# Interesting density function

1. Nov 18, 2008

### daviddoria

I am trying to make a function which is exponential for a while, and then turns gaussian:
$$f(l,d) = \lambda e^{-\lambda d} , 0 < d < l$$

and
$$f(l,d) = (1-\int_0^l \lambda e^{-\lambda d} dd) \frac{1}{\sigma \sqrt{2 \pi}} e^{-(d-l)^2/(2\sigma^2)} , l < d < \infty$$
(That is supposed to be a piecewise function!)

You can see that as a function of d, the function is exponential until l and then gives the remaining weight (ie 1 - the area accumulated so far) to the gaussian.

The problem is, interpreted as a function of l (the likelihood of l given d instead of the probability of d given l), I don't understand if it is defined, since the piecewise region depends on l.

Does that make sense?

Thanks,
Dave

2. Nov 19, 2008

### ssd

For any given l, is f(l,d) is a density function at all ? Does its integral over (0,inf) become 1?

3. Nov 19, 2008

### daviddoria

yea its a density function. They way the two functions are combined is exactly to make it a density function. It looks at the integral from 0 to l of the first function and then gives (1-that area) weight to the second function, so the total is now 1.

4. Nov 19, 2008

But the integral of the second function over the domain in question is not 1.

5. Nov 19, 2008

### daviddoria

the integral of the second function from l to infinity would be some value < 1, and then it is scaled to instead be the remaining portion of "1" that has not been "used" by the first function. Maybe I did that scaling a bit wrong, but it doesn't change the point really I dont think?

6. Nov 19, 2008