From: leo nidas on
Hi there,

I have a density (generalized gamma) and the associated survival function and I would like to know for which values of the density's parameters the hazard rate (f(x)/S(x)) is increasing. decreasing, arc shaped or U-shaped.

I have one example for each shape in the code below. The hazard rate can only take one of these four shapes (plus the constant shape since the exponential distribution is a special case of the above density (as well as the weibull, the beta...)).

So my question is what can I do to find out the regions of interest? I am a little confused.. More looking for a mathematical advice.. Or how can I use matlab to seek for these regions..

I mean if I knew that it is arc shaped or U spaped I could minimize with fminsearch
and then see if I have a maximum or minimum and decide between the two but still would not know for which values it is arc shaped or U-shaped.. Not to mention now.

Any mathematical or computational advice is more than welcome!


x=0.2:0.01:4;

a=-2;l=2;g=0.5 %arc
%a=1.8;l=2;g=0.7 %increasing
%a=0.3;l=0.3;g=1.5 %decreasing
%a=2;l=0.4;g=0.2 %bath

fx=1./gamma(g).*abs(a).*g.^g.*l.^(a.*g).*x.^(a.*g-1).*exp(-g.*(l.*x).^a);
S=gammainc(g.*(l.*x).^a,g).*(a<0)+(1-gammainc(g.*(l.*x).^a,g)).*(a>0);

h=fx./S;
plot(x,h)
From: leo nidas on
forgot to say that -Inf<a<Inf, l>0, g>0 and that a~=0. (Basically if a=0, then this density is the limiting case of a log normal and I don't really care about this.)