nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
rayleigh.hpp
Go to the documentation of this file.
1
3// toolboxes/stats/include/nk/stats/distributions/rayleigh.hpp
4//
5// Rayleigh distribution. Single scale parameter b > 0.
6
7#pragma once
8
9#include <memory_resource>
10#include <nk/value/value.hpp>
11
12#include <tuple>
13
14namespace nk {
15
18 namespace ops { class RngContext; } }
19
20namespace nk::stats {
21
31Value raylpdf(const Value &x, double b,
32 std::pmr::memory_resource *mr = nullptr);
33
43Value raylcdf(const Value &x, double b,
44 std::pmr::memory_resource *mr = nullptr);
45
55Value raylinv(const Value &p, double b,
56 std::pmr::memory_resource *mr = nullptr);
57
68Value raylrnd(::nk::ops::RngContext &rng, double b, size_t rows = 1, size_t cols = 1,
69 std::pmr::memory_resource *mr = nullptr);
70
78std::tuple<double, double> raylstat(double b);
79
80
82} // namespace nk::stats
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value raylpdf(const Value &x, double b, std::pmr::memory_resource *mr=nullptr)
Rayleigh pdf (y = raylpdf(x, b)).
Value raylinv(const Value &p, double b, std::pmr::memory_resource *mr=nullptr)
Rayleigh inverse cdf (x = raylinv(p, b)).
Value raylrnd(::nk::ops::RngContext &rng, double b, size_t rows=1, size_t cols=1, std::pmr::memory_resource *mr=nullptr)
Rayleigh random samples (r = raylrnd(b, rows, cols)).
std::tuple< double, double > raylstat(double b)
Rayleigh mean and variance ([m, v] = raylstat(b)).
Value raylcdf(const Value &x, double b, std::pmr::memory_resource *mr=nullptr)
Rayleigh cdf (p = raylcdf(x, b)).