# subbotools: Power Exponential estimation

## Table of Contents

## Getting Started

The package subbotools provides a set of programs for the Maximum Likelihood Estimation of the Symmetric and Asymmetric Power Exponential (or Subbotin) families of distributions.

### Requirements

The recent versions of the package depend on the GNU Scientific Library (GSL) version 2 (>= 2.1). Package versions before the 1.2.2 depend on the GNU Scientific Library (GSL) version 1 (version >= 1.6).

To be installed from source, the package requires a C compiler and the standard C library. Unix-like environment in which GNU auto-tools can work is required for automatic installation.

### Installation instructions

On `Linux`

, the `subbotools`

package can be either installed using a
.deb package or from source. The first method is recommended. You can
download the relevant package from the cafed repository. Only 64 bit
executable and source code are made available starting from version
1.2.2. Alternatively, for automatic package installation in
Debian/Ubuntu or derived systems, these commands can be issued in the
terminal

sudo add-apt-repository "deb ftp://cafim.sssup.it/debian ./" sudo apt-get update sudo apt-get install subbotools

answer 'y' to any request. If you want to stay on the safer side and be able to check the integrity of the package, you have to download my GPG public key and install it in the apt-keyring. BEFORE issuing the previous commands do

sudo apt-key add giulio.asc

If installation from source is required instead, keep reading.

The installation from source should be rather straightforward. Download the package and unpack it

tar xvzf subbotools-{version}.tar.gz

move inside the source directory

cd subbotools-{version}

run the configure script

./configure

then build the files

make

become root

su

and install them

make install

If you can't install the file as root you have to provide a different
directory for the binaries using the option `--prefix`

of the
configure script. For more detailed instructions see the "INSTALL"
file in the distributed package.

In `Windows`

, the `subbotools`

package is installed in the `Cygwin`

environment. Follow the instructions in the cygwin installation page.

## Overview

Three distinct families of distributions are considered: the original Subbotin family, its asymmetric generalization and a "lesser asymmetric" version that results convenient for certain data. The parametrization of the different families is reported below. For further details see the official documentation, also available in PDF format.

### Symmetric Power Exponential

This is the original Subbotin, or Exponential Power (EP), family of distributions which depend on three parameters: the scale parameter \(a\), the shape parameter \(b\) and the position parameter \(m\). The main use of this family is in providing a smooth interpolation between the Gaussian and the Laplacian density. Indeed both these distributions can be seen as special cases of the Subbotin distribution. In this way by fitting a Subbotin on a given dataset, one does obtain a descriptive information about the tail behavior (shape parameter) but also derive some inference about the postulated Gaussian or Laplacian behavior of the data. The density reads

\[ f(x;a,b,m) = {1 \over 2 \, a \, b^{1/b} \, \Gamma(1+1/b)}\; e^{-{1 \over b}\, \left|{x-m \over a}\right|^b} \;\;. \]

Figure 1: EP densities with a=1 and different values of b.

Figure 2: EP densities with b=1 and different values of a.

### Asymmetric Power Exponential

The Asymmetric Exponential Power (AEP) is a 5-parameter family of densities. In addition to the location parameter m, the left and right parts of the density are independently parametrized by a scale and shape parameter. The density reads

\[ f(x;b_l,b_r,a_l,a_r,m) = \frac{1}{C}\;\; e^{-\left( \frac{1}{b_l}\;\left|\frac{x-m}{a_l}\right|^{b_l}\;\theta(m-x)+ \frac{1}{b_r}\;\left|\frac{x-m}{a_r}\right|^{b_r}\;\theta(x-m) \right)} \]

where \(\theta(x)\) is the Heaviside theta function and \(C\) the normalization constant, \(C = a_l b_l^{1/b_l-1}\Gamma(1/b_l) + a_r b_r^{1/b_r-1}\Gamma(1/b_r)\).

Figure 3: AEP with a_{l}=1, b_{l}=2, a_{r}=1 and different values of b_{r}.

Figure 4: AEP with a_{l}=1, b_{l}=0.5, b_{r}=0.5 and different values of a_{r}

These plots are taken from A new class of asymmetric exponential power densities with applications to economics and finance by G. Bottazzi and A. Secchi.

### Less Asymmetric Power Exponential

The less asymmetric density is the Asymmetric Power Exponential density, with the two scale parameters set equal, that is \(a_l=a_r\).

\[ f(x;b_l,b_r,a,m) = \frac{1}{C}\;\; e^{-\left( \frac{1}{b_l}\;\left|\frac{x-m}{a}\right|^{b_l}\;\theta(m-x)+ \frac{1}{b_r}\;\left|\frac{x-m}{a}\right|^{b_r}\;\theta(x-m) \right)} \]

the normalization constant now reads \(C = a (b_l^{1/b_l-1}\Gamma(1/b_l) + b_r^{1/b_r-1}\Gamma(1/b_r))\).

### Structure of the package

The subbotools package is composed of the following programs:

- subbofit
- finds the Subbotin density that better fit a given set of observations. The observations are considered independently drawn from the same probability distribution and the parameters value are obtained via maximum likelihood estimation.
- subboafit
- finds the asymmetric Subbotin density that better fit a given set of observations. The observations are considered independently drawn from the same probability distribution and the parameters value are obtained via maximum likelihood estimation.
- subbolafit
- finds the (less) asymmetric Subbotin density, i.e. an asymmetric density with a symmetric scale parameter, that better fit a given set of observations. The observations are considered independently drawn from the same probability distribution and the parameters value are obtained via maximum likelihood estimation.
- subboshow
- takes a set of observations as input and produces a graphic showing the value of the log-likelihood of this set as a function of the density parameters.
- subbogen
- generates random variables extracted from a Subbotin density. The relevant parameters can be provided on the command line or read from standard input.
- subboagen
- generates random variables extracted from an asymmetric Subbotin density. The relevant parameters can be can be provided on the command line or read from standard input.

These programs have been mainly written to be used from the command line. They read data from file or standard input in an ASCII format and print the result in ASCII format to standard output. The versatile gnuplot program is used as graphic back-end. When the output is intended to be graphically displayed, it has been designed in a format suitable to be sent to gnuplot for plotting.

## Documentation

For a description of the method applied and a brief tutorial on the use of the different commands see here. The same instructions are available in a PDF document.

The properties of the ML estimator are studied in the paper A new class of asymmetric exponential power densities with applications to economics and finance by G. Bottazzi and A. Secchi. If you find this package useful, you are kindly asked to mention this paper as a background reference in the publications derived by its use in your research or professional activity.

## Contributors

Angelo Secchi provided helpful suggestions in the design of programs user interface and he wrote the Cygwin installation instructions.