Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16236

Re: Plot InverseSurvivalFunction

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Plot InverseSurvivalFunction
Date 2013-11-15 23:35 +0000
Message-ID <l66b40$8m7$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


On 11/15/13 at 6:41 AM, emammendes@gmail.com (Eduardo M. A. M.
Mendes) wrote:

>Is there any way to evaluate (or even plot) the inverse survival
>function of a sum of two Fs?

>Here is what I have so far

>\[ScriptCapitalD]=TransformedDistribution[u+v,{u\[Distributed]
>FRatioDistribution[2,2 2],v\[Distributed]FRatioDistribution[2,2 2]}]

>PDF[\[ScriptCapitalD],x]

>Plot[PDF[\[ScriptCapitalD],x],{x,0,10},Filling->Axis]

>CDF[\[ScriptCapitalD],x]

>Plot[CDF[\[ScriptCapitalD],x],{x,0,10},Filling->Axis]

>All above commands return the results I expect but when I try

>Plot[InverseSurvivalFunction[\[ScriptCapitalD],x],{x,0,1},Filling->
>Axis,PlotRange-> Full]

>Mathematica won't show any curve. Does it mean that Mathematica
>could not find an expression for it?

When you say Mathematica didn't show a curve exactly what do you
mean? Do you mean you got the result

Plot[I, {x, 0, 1}]

will give, i.e., a graphic showing an axis with no curve? Or do
you mean simply you didn't get anything in the time you were
willing to wait?

If it is the latter, then there is a way to get the desired
plot. First, note the difference in the amount of time to
produce a plot between

d = TransformedDistribution[
    u + v, {u \[Distributed] FRatioDistribution[2, 2 2],
     v \[Distributed] FRatioDistribution[2, 2 2]}];

pdf = PDF[d, x];
Plot[pdf, {x, 0, 10}, Filling -> Axis]

and

Plot[PDF[d, x], {x, 0, 10}, Filling -> Axis]

When you do Plot[PDF[d,x] ... Mathematica substitutes a
numerical value for x then finds the density function of your
distribution with that value. That is, Mathematica repeats the
computation of the density function for every numerical value
used for x.

By doing pdf=PDF[d,x];Plot[pdf ... the computation of the
density function is done once rather than many times. This way,
Mathematica does far less computation and gets the end result
much faster.

Now, this won't completely solve the problem since

InverseSurvivalFunction[d, x]

returns unevaluated which means Mathematica will have to do a
lot of computation to make a plot with

Plot[InverseSurvivalFunction[d,x], ...

But notice

SurvivalFunction[d,x] does evaluate to closed form expression.
So, a quick way to get the desired plot would be:

sf = SurvivalFunction[d, x];
ParametricPlot[{sf, x}, {x, 0, 10}, AspectRatio -> 1/GoldenRatio]


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Plot InverseSurvivalFunction Bill Rowe <readnews@sbcglobal.net> - 2013-11-15 23:35 +0000

csiph-web