Socket
Book a DemoInstallSign in
Socket

boost_distributions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boost_distributions

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

boost_distribution (Ruby gem)

boost_distribution is a Ruby gem to calculate various statistical properties of distributions supported by boost::math::distributions.

Gem Version Ruby

Installation

Install boost headers

Before gem install, boost headers are required. For well-known platforms, try appropriate one of the followings:

Windows Ruby

(Assumption: Most of users may use Ruby installer.) Please check whether your Ruby has been installed with devkit. If not, please re-install Ruby with devkit, which is found at the top of the page. Then, run Start Command Prompt with Ruby from the start menu to launch the command line interface, and type following commands (each line requires hitting enter after inputs, and hit Y key when you are asked something like "install OK?"):

ridk enable
pacman -Syy
pacman -S mingw-w64-ucrt-x86_64-boost

image

Cygwin

By using setup-x86_64.exe Cygwin GUI installer, select libboost-devel unless the headers have been installed. image

UNIX

$ apt-get install libboost-dev

Install gem

After installation of boost headers, install the gem as:

$ gem install boost_distributions

Note that if your boost headers are not in the standard path, the following alternative are helpful for each method.

$ gem install boost_distributions -- --with-boost-include=/path/to/parent_directory_of_boost_header

Or if you want to include it into your application, add this line to Gemfile:

gem 'boost_distributions'

and execute:

$ bundle install

following

$ bundle config build.boost_distributions --with-boost-include=/path/to/parent_directory_of_boost_header

if your boost headers are in the non-standared path.

Usage

Example usage is as the followings:

require 'boost_distributions'

# Generate normal (Gaussian) distribution instance with mu = 0, sigma = 1
normal = BoostDistributions::Normal::new(0, 1)
normal.mean # => 0
normal.standard_deviation # => 1.0

normal.pdf(0) # => 0.399, Probability density function
normal.cdf(0) # => 0.5, Cumulative distribution function
normal.quantile(0.5) # => 0

List of supported distributions are:

DistributionsRequired minimum boost version
Arcsine Distribution1.58.0
Bernoulli Distribution1.35.0
Beta Distribution1.35.0
Binomial Distribution1.35.0
Cauchy-Lorentz Distribution1.35.0
Chi Squared Distribution1.35.0
Exponential Distribution1.35.0
Extreme Value Distribution1.35.0
F Distribution1.35.0
Gamma (and Erlang) Distribution1.35.0
Geometric Distribution1.46.0
Hyperexponential Distribution1.57.0
Hypergeometric Distribution1.40.0
Inverse Chi Squared Distribution1.45.0
Inverse Gamma Distribution1.45.0
Inverse Gaussian (or Inverse Normal) Distribution1.46.0
Kolmogorov-Smirnov Distribution1.75.0
Laplace Distribution1.40.0
Logistic Distribution1.40.0
Log Normal Distribution1.35.0
Negative Binomial Distribution1.35.0
Noncentral Beta Distribution1.36.0
Noncentral Chi-Squared Distribution1.36.0
Noncentral F Distribution1.36.0
Noncentral T Distribution1.36.0
Normal (Gaussian) Distribution1.35.0
Pareto Distribution1.35.0
Poisson Distribution1.35.0
Rayleigh Distribution1.35.0
Skew Normal Distribution1.50.0
Students t Distribution1.35.0
Triangular Distribution1.35.0
Uniform Distribution1.35.0
Weibull Distribution1.35.0

Development

After checking out the repo, run bundle install to install dependencies. To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

There are some useful commands in developement life-cycle.

CommandDescription
bundle exec rake swigRe-generate wrapper C code
bundle exec rake compilecompile shared library
bundle exec rake specrun tests

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fenrir-naru/ruby-boost_distributions. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the BoostDistributions project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 25 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.