-
Notifications
You must be signed in to change notification settings - Fork 2
/
README-libstable
134 lines (97 loc) · 5.5 KB
/
README-libstable
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Libstable: Fast, Parallel and High-Precision Computation of alpha-Stable
Distributions in C and MATLAB
Alpha-stable distributions are a family of well-known probability
distributions. However, the lack of closed analytical expressions
hinders their application. Currently, several tools have been developed
to numerically evaluate their density and distribution functions or
to estimate their parameters, but available solutions either do not
reach sufficient precision on their evaluations or are excessively
slow for practical purposes. Moreover, they do not take full advantage
of the parallel processing capabilities of current multi-core machines.
Other solutions work only on a subset of the $\alpha$-stable parameter
space. We present a C/C++ library and a MATLAB front-end that permits
fully parallelized, fast and high precision evaluation of density,
distribution and quantile functions (PDF, CDF and CDF$^{-1}$ respectively),
random variable generation and parameter estimation of $\alpha$-stable
distributions in their whole parameter space. The library here described
can be easily integrated on third party developments.
Keywords: alpha-stable distributions, numerical calculation,
parallel processing
Copyright (C) 2013. Javier Royuela del Val
Federico Simmross Wattenberg
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; If not, see <http://www.gnu.org/licenses/>.
Javier Royuela del Val.
E.T.S.I. Telecomunicación
Universidad de Valladolid
Paseo de Belén 15, 47002 Valladolid, Spain.
=======================[Usage of libstable]=======================
Libstable has been developed at the Image Processing Laboratory (LPI)
to give support for various research projects based on alpha-stable
distributions, where it is used on a regular basis both in C/C++ and
in MATLAB developments. It has been thoroughly tested on specific
applications. Its source code and sample programs are publicly available
at <http://www.lpi.tel.uva.es/stable> under the GPLv3 license.
====================== Compiling the library =====================
Dependencies:
----------------
Libstable depends on several numerical methods provided by the GNU
Scientific Library (GSL) [1], which must be installed in the system.
Its available at
<http://www.gnu.org/gsl>
Pthreads [2] has been used to implement parallelism. More information
about this library can be found at
<https://computing.llnl.gov/tutorials/pthreads/>
Compilation:
----------------
Makefiles are provided so that the developed library can be easily
compiled from the source code with the make command:
$ make
After compilation, both shared libstable.so and static (libstable.a)
versions of the library are produced. Several example programs to test
the main functions of the library are also compiled against the static
version of the library by default. They can be found under the tests
folder.
================== Usage in C/C++ environments ==================
If the libstable header files and compiled library are not located on the
standard search path of the compiler and linker respectively, their location
must be provided as command line flag to compile and link C developments.
The program must also be linked to the GSL and system's math libraries.
Typical command for compilation and static linking of a source file example.c
with the GNU C compiler gcc is:
$ gcc -O3 -I/path/to/headers -c example.c
$ gcc example.o /path/to/libstable/libstable.a -lgsl -lgslcblas -lm
When linking with the shared version of the library, the path to libstable.so
must be provided to the system's dynamic linker, typically by defining the
shell variable LD_LIBRARY_PATH. The path to the shared library must also
be provided when linking the program:
$ gcc -L/path/to/libstable example.o -lgsl -lgslcblas -lm -lstable
================== Usage in MATLAB environment ==================
MATLAB environment supports loading shared C libraries by means of the
loadlibrary function. The shared version of the developed library (libstable.so)
and the header file stable_api.h are required. In order to start using
Libstable execute the following command in MATLAB environment:
>> loadlibrary('libstable','stable_api.h')
Paths to libstable.so and stable_api.h must be in current folder or included
in MATLAB search path.
When the library is no longer needed, it can be unloaded by executing
>> unloadlibrary('libstable')
Several MATLAB functions in the form of .m files are provided to access the
capabilities of Libstable. These files can be easily modified by the user to
adjust library parameters as needed.
** Further documentation **
Further documentation about the functions provided by Libstatble both in C/C++
and MATLAB environments can be found in the documentation file provided
within the library.
[1] GSL - GNU Scientific Library. On line: http://www.gnu.org/s/gsl.
[2] B. Barney, "POSIX Threads Programming Tutorial", On line:
https://computing.llnl.gov/tutorials/pthreads.