File: continuous_laplace.rst

package info (click to toggle)
python-scipy 0.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 75,464 kB
  • ctags: 79,406
  • sloc: python: 143,495; cpp: 89,357; fortran: 81,650; ansic: 79,778; makefile: 364; sh: 265
file content (37 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

.. _continuous-laplace:

Laplace (Double Exponential, Bilateral Exponential) Distribution
================================================================

.. math::
   :nowrap:

    \begin{eqnarray*} f\left(x\right) & = & \frac{1}{2}e^{-\left|x\right|}\\ F\left(x\right) & = & \left\{ \begin{array}{ccc} \frac{1}{2}e^{x} &  & x\leq0\\ 1-\frac{1}{2}e^{-x} &  & x>0\end{array}\right.\\ G\left(q\right) & = & \left\{ \begin{array}{ccc} \log\left(2q\right) &  & q\leq\frac{1}{2}\\ -\log\left(2-2q\right) &  & q>\frac{1}{2}\end{array}\right.\end{eqnarray*}

.. math::
   :nowrap:

    \begin{eqnarray*} m_{d}=m_{n}=\mu & = & 0\\ \mu_{2} & = & 2\\ \gamma_{1} & = & 0\\ \gamma_{2} & = & 3\end{eqnarray*}

The ML estimator of the location parameter is

.. math::

     \hat{L}=\mathrm{median}\left(X_{i}\right)

where :math:`X_{i}` is a sequence of :math:`N` mutually independent Laplace RV's and the median is some number
between the :math:`\frac{1}{2}N\mathrm{th}` and the :math:`(N/2+1)\mathrm{th}` order statistic ( *e.g.* take the average of these two) when :math:`N` is even. Also,

.. math::

     \hat{S}=\frac{1}{N}\sum_{j=1}^{N}\left|X_{j}-\hat{L}\right|.

Replace :math:`\hat{L}` with :math:`L` if it is known. If :math:`L` is known then this estimator is distributed as :math:`\left(2N\right)^{-1}S\cdot\chi_{2N}^{2}` .

.. math::
   :nowrap:

    \begin{eqnarray*} h\left[X\right] & = & \log\left(2e\right)\\  & \approx & 1.6931471805599453094.\end{eqnarray*}

Implementation: `scipy.stats.laplace`