32 #ifndef VSMC_RNG_FISHER_F_DISTRIBUTION_HPP 33 #define VSMC_RNG_FISHER_F_DISTRIBUTION_HPP 44 template <
typename RealType>
47 return m > 0 && n > 0;
54 template <
typename RealType>
73 template <
typename RNGType>
77 return (chi_squared_m_(rng) / m()) / (chi_squared_n_(rng) / n());
82 return (chi_squared_m(rng) / param.
m()) /
83 (chi_squared_n(rng) / param.
n());
90 template <std::
size_t K,
typename RealType,
typename RNGType>
92 RNGType &rng, std::size_t n, RealType *r, RealType df1, RealType df2)
97 mul(n, 1 / df1, s.data(), s.data());
98 mul(n, 1 / df2, r, r);
99 div(n, s.data(), r, r);
111 #endif // VSMC_RNG_FISHER_F_DISTRIBUTION_HPP bool fisher_f_distribution_check_param(RealType m, RealType n)
void mul(std::size_t n, const float *a, const float *b, float *y)
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, p1, v1, p2, v2)
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_2(name, p1, p2)
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_2(T1, m1, T2, m2)
void div(std::size_t n, const float *a, const float *b, float *y)
void chi_squared_distribution(RNGType &rng, std::size_t n, RealType *r, RealType df)
Generating random variates.
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2(Name, name, p1, p2)
std::array with proper alignment
void fisher_f_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType df1, RealType df2)