StatAnaly is a statisticaly analysis package written in C++. The header-only library is designed for rapid prototyping in numerical computations.
StatAnaly is a work-in-progress in terms of features. Currently it supports the following operations:
- Compute the sum of random variables of probability distributions.
There are three global static variables representing different sums:
-
cnvl represents the simple sum, ie
$R=X+Y$ -
cnvlSq represents the sum of the squares, ie
$R=X^2+Y^2$ -
cnvlSSqrt represents the sum of the squares and then take square root, ie
$R=\sqrt{X^2+Y^2}$
The sum of two RVs of standard uniform distributions is a RV of Irwin-Hall distribution.
disStdUniform su1{}, su2{};
probDistr* rsu = cnvl.go(su1, su2);
disIrwinHall* rih = dynamic_cast<disIrwinHall*>(rsu);
The sum of an array of RVs of standard uniform distributions is a RV of Irwin-Hall distribution.
disStdUniform su1{}, su2{}, su3{}, su4{};
probDistr* rsu = convolve<disStdUniform>({su1, su2, su3, su4});
disIrwinHall* rih = dynamic_cast<disIrwinHall*>(rsu);
The sum of two squares of RVs of normal distributions is a RV of Chi Square distribution.
disNormal a(0,1);
disNormal b(0,1);
disChiSq s = *static_cast<disChiSq*>(cnvlSq.go(a,b));
The sum of two squares of RVs of normal distribution (with same variance) is a RV of Rician distribution.
disNormal a(2,9);
disNormal b(3,9);
disRician s = *static_cast<disRician*>(cnvlSSqrt.go(a,b));
The building and testing of the package require the following FOSS:
- CMake
- CTest
- Google Test
Make a build directory, and then compile the source codes.
mkdir build
cd build/
cmake ../
make
A main function (in playground.cpp) is provided as a playground for experimentation. To build the executable:
mkdir build
cd build/
cmake ../
make playground
StatAnaly follows a test-driven development mindset. Unit tests are provided to ensure numerical accurarcy. StatAnaly supports CTest testing framework.
mkdir build
cd build/
cmake ../
make
make test
Install static library in /usr/local/lib/StatAnaly_x.x and header files in /usr/local/include/StatAnaly_x.x. Installation may require sudo privilege.
mkdir build
cd build/
cmake ../
sudo make install -j6
Source code is commented in a Doxygen recognizable style.
doxygen doc/Doxyfile
firefox doc/html/index.html
See full documentation -- doc/Documentation/doc.pdf.
StatAnaly is solely developed by Ansel Blumers (mailto: [email protected]).
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.