nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
students_t.hpp
Go to the documentation of this file.
1
3// toolboxes/stats/include/nk/stats/distributions/students_t.hpp
4//
5// Student's t-distribution.
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
33Value tpdf(const Value &x, double nu, std::pmr::memory_resource *mr = nullptr);
34
46Value tcdf(const Value &x, double nu, std::pmr::memory_resource *mr = nullptr);
47
57Value tinv(const Value &p, double nu, std::pmr::memory_resource *mr = nullptr);
58
69Value trnd(::nk::ops::RngContext &rng, double nu, size_t rows = 1, size_t cols = 1, std::pmr::memory_resource *mr = nullptr);
70
79std::tuple<double, double> tstat(double nu);
80
98Value nctpdf(const Value &x, double nu, double delta,
99 std::pmr::memory_resource *mr = nullptr);
100
119Value nctcdf(const Value &x, double nu, double delta, bool upper = false,
120 std::pmr::memory_resource *mr = nullptr);
121
135Value nctinv(const Value &p, double nu, double delta,
136 std::pmr::memory_resource *mr = nullptr);
137
148std::tuple<double, double> nctstat(double nu, double delta);
149
164Value nctrnd(::nk::ops::RngContext &rng, double nu, double delta, std::size_t rows = 1, std::size_t cols = 1,
165 std::pmr::memory_resource *mr = nullptr);
166
167
169} // namespace nk::stats
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
std::tuple< double, double > tstat(double nu)
Student's t mean and variance ([m, v] = tstat(nu)).
Value tcdf(const Value &x, double nu, std::pmr::memory_resource *mr=nullptr)
Student's t cdf (F = tcdf(x, nu)).
Value nctrnd(::nk::ops::RngContext &rng, double nu, double delta, std::size_t rows=1, std::size_t cols=1, std::pmr::memory_resource *mr=nullptr)
Noncentral Student's t random samples (r = nctrnd(nu, delta, rows, cols)).
Value tpdf(const Value &x, double nu, std::pmr::memory_resource *mr=nullptr)
Student's t pdf (y = tpdf(x, nu)).
Value tinv(const Value &p, double nu, std::pmr::memory_resource *mr=nullptr)
Student's t inverse cdf (x = tinv(p, nu)).
Value nctinv(const Value &p, double nu, double delta, std::pmr::memory_resource *mr=nullptr)
Noncentral t inverse cdf (x = nctinv(p, nu, delta)).
std::tuple< double, double > nctstat(double nu, double delta)
Noncentral t mean and variance ([m, v] = nctstat(nu, delta)).
Value nctcdf(const Value &x, double nu, double delta, bool upper=false, std::pmr::memory_resource *mr=nullptr)
Noncentral Student's t cdf (p = nctcdf(x, nu, delta)).
Value nctpdf(const Value &x, double nu, double delta, std::pmr::memory_resource *mr=nullptr)
Noncentral Student's t pdf (y = nctpdf(x, nu, delta)).
Value trnd(::nk::ops::RngContext &rng, double nu, size_t rows=1, size_t cols=1, std::pmr::memory_resource *mr=nullptr)
Student's t random samples (r = trnd(nu, rows, cols)).