scipy/numpy inverse cumulative normal

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bartsimpson8882002@yahoo.com

    #1

    scipy/numpy inverse cumulative normal

    I was wondering if scipy/numpy has the inverse cumulative normal
    function, ie the function f in this expression

    f(scipy.stats.n orm.cdf(1.2)) = 1.2

    or more generally, a function f which fits the criteria

    f(scipy.stats.n orm.cdf(x)) = x

    There is a distribution called invnorm, but I am not sure of how to use
    it.
  • Robert Kern

    #2
    Re: scipy/numpy inverse cumulative normal

    bartsimpson8882 002@yahoo.com wrote:[color=blue]
    > I was wondering if scipy/numpy has the inverse cumulative normal
    > function, ie the function f in this expression
    >
    > f(scipy.stats.n orm.cdf(1.2)) = 1.2
    >
    > or more generally, a function f which fits the criteria
    >
    > f(scipy.stats.n orm.cdf(x)) = x[/color]

    Look in the file where all of the distributions are defined,
    Lib/stats/distributions.p y . You will find that each distribution object also
    has a method call .ppf(), the Percent Point Function, the inverse of the CDF.

    In [1]: from scipy.stats import norm

    In [2]: norm.ppf(norm.c df(1.2))
    Out[2]: array(1.2000000 000000004)
    [color=blue]
    > There is a distribution called invnorm, but I am not sure of how to use
    > it.[/color]

    invnorm is another probability distribution entirely. Don't bother with it.

    --
    Robert Kern
    robert.kern@gma il.com

    "I have come to believe that the whole world is an enigma, a harmless enigma
    that is made terrible by our own mad attempt to interpret it as though it had
    an underlying truth."
    -- Umberto Eco

    Comment

    • noonoo

      #3
      Re: scipy/numpy inverse cumulative normal

      In article <mailman.4266.1 144520725.27775 .python-list@python.org >,
      robert.kern@gma il.com says...[color=blue]
      > bartsimpson8882 002@yahoo.com wrote:[color=green]
      > > I was wondering if scipy/numpy has the inverse cumulative normal
      > > function, ie the function f in this expression
      > >
      > > f(scipy.stats.n orm.cdf(1.2)) = 1.2
      > >
      > > or more generally, a function f which fits the criteria
      > >
      > > f(scipy.stats.n orm.cdf(x)) = x[/color]
      >
      > Look in the file where all of the distributions are defined,
      > Lib/stats/distributions.p y . You will find that each distribution object also
      > has a method call .ppf(), the Percent Point Function, the inverse of the CDF.
      >
      > In [1]: from scipy.stats import norm
      >
      > In [2]: norm.ppf(norm.c df(1.2))
      > Out[2]: array(1.2000000 000000004)
      >[color=green]
      > > There is a distribution called invnorm, but I am not sure of how to use
      > > it.[/color]
      >
      > invnorm is another probability distribution entirely. Don't bother with it.
      >
      >[/color]
      Great thanks very much. Exactly what I was looking for. And seeing the
      scipy.info for ppf, that's exactly what it says as well. Got distracted
      by the invnorm distribution :-(

      Comment

      Working...