本文整理汇总了C++中weibull_distribution类的典型用法代码示例。如果您正苦于以下问题:C++ weibull_distribution类的具体用法?C++ weibull_distribution怎么用?C++ weibull_distribution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了weibull_distribution类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: kurtosis_excess
inline RealType kurtosis_excess(const weibull_distribution<RealType, Policy>& dist)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::kurtosis_excess(const weibull_distribution<%1%>)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
RealType g1, g2, g3, g4, d, g1_2, g1_4;
g1 = boost::math::tgamma(1 + 1 / shape, Policy());
g2 = boost::math::tgamma(1 + 2 / shape, Policy());
g3 = boost::math::tgamma(1 + 3 / shape, Policy());
g4 = boost::math::tgamma(1 + 4 / shape, Policy());
g1_2 = g1 * g1;
g1_4 = g1_2 * g1_2;
d = g2 - g1_2;
d *= d;
result = -6 * g1_4 + 12 * g1_2 * g2 - 3 * g2 * g2 - 4 * g1 * g3 + g4;
result /= d;
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:28,代码来源:weibull.hpp
示例2: pdf
inline RealType pdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::pdf(const weibull_distribution<%1%>, %1%)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
if(false == detail::check_weibull_x(function, x, &result, Policy()))
return result;
if(x == 0)
{
if(shape == 1)
{
return 1 / scale;
}
if(shape > 1)
{
return 0;
}
return policies::raise_overflow_error<RealType>(function, 0, Policy());
}
result = exp(-pow(x / scale, shape));
result *= pow(x / scale, shape - 1) * shape / scale;
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:32,代码来源:weibull.hpp
示例3: mean
inline RealType mean(const weibull_distribution<RealType, Policy>& dist)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::mean(const weibull_distribution<%1%>)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
result = scale * boost::math::tgamma(1 + 1 / shape, Policy());
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:16,代码来源:weibull.hpp
示例4: mode
inline RealType mode(const weibull_distribution<RealType, Policy>& dist)
{
BOOST_MATH_STD_USING // for ADL of std function pow.
static const char* function = "boost::math::mode(const weibull_distribution<%1%>)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
{
return result;
}
result = scale * pow((shape - 1) / shape, 1 / shape);
return result;
}
开发者ID:GDXN,项目名称:fitsliberator,代码行数:17,代码来源:weibull.hpp
示例5: median
inline RealType median(const weibull_distribution<RealType, Policy>& dist)
{
BOOST_MATH_STD_USING // for ADL of std function pow.
static const char* function = "boost::math::median(const weibull_distribution<%1%>)";
RealType shape = dist.shape(); // Wikipedia k
RealType scale = dist.scale(); // Wikipedia lambda
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
{
return result;
}
using boost::math::constants::ln_two;
result = scale * pow(ln_two<RealType>(), 1 / shape);
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:18,代码来源:weibull.hpp
示例6: variance
inline RealType variance(const weibull_distribution<RealType, Policy>& dist)
{
RealType shape = dist.shape();
RealType scale = dist.scale();
static const char* function = "boost::math::variance(const weibull_distribution<%1%>)";
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
{
return result;
}
result = boost::math::tgamma(1 + 1 / shape, Policy());
result *= -result;
result += boost::math::tgamma(1 + 2 / shape, Policy());
result *= scale * scale;
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:18,代码来源:weibull.hpp
示例7: cdf
inline RealType cdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::cdf(const weibull_distribution<%1%>, %1%)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
if(false == detail::check_weibull_x(function, x, &result, Policy()))
return result;
result = -boost::math::expm1(-pow(x / scale, shape), Policy());
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:19,代码来源:weibull.hpp
示例8: quantile
inline RealType quantile(const weibull_distribution<RealType, Policy>& dist, const RealType& p)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::quantile(const weibull_distribution<%1%>, %1%)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
if(false == detail::check_probability(function, p, &result, Policy()))
return result;
if(p == 1)
return policies::raise_overflow_error<RealType>(function, 0, Policy());
result = scale * pow(-boost::math::log1p(-p, Policy()), 1 / shape);
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:22,代码来源:weibull.hpp
示例9: skewness
inline RealType skewness(const weibull_distribution<RealType, Policy>& dist)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::skewness(const weibull_distribution<%1%>)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result = 0;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
{
return result;
}
RealType g1, g2, g3, d;
g1 = boost::math::tgamma(1 + 1 / shape, Policy());
g2 = boost::math::tgamma(1 + 2 / shape, Policy());
g3 = boost::math::tgamma(1 + 3 / shape, Policy());
d = pow(g2 - g1 * g1, RealType(1.5));
result = (2 * g1 * g1 * g1 - 3 * g1 * g2 + g3) / d;
return result;
}
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:24,代码来源:weibull.hpp
示例10: pdf
inline RealType pdf(const weibull_distribution<RealType, Policy>& dist, const RealType& x)
{
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function = "boost::math::pdf(const weibull_distribution<%1%>, %1%)";
RealType shape = dist.shape();
RealType scale = dist.scale();
RealType result;
if(false == detail::check_weibull(function, scale, shape, &result, Policy()))
return result;
if(false == detail::check_weibull_x(function, x, &result, Policy()))
return result;
if(x == 0)
{ // Special case, but x == min, pdf = 1 for shape = 1,
return 0;
}
result = exp(-pow(x / scale, shape));
result *= pow(x / scale, shape) * shape / x;
return result;
}
开发者ID:ANCL,项目名称:autopilot,代码行数:24,代码来源:weibull.hpp
注:本文中的weibull_distribution类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论