Skip to content
Snippets Groups Projects
Commit 7cfed1d9 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

DistributionCosine: normalize pdf

parent 36cc687c
No related branches found
No related tags found
1 merge request!1435Allow relSamplingWidth = 0
Pipeline #91526 passed
...@@ -406,7 +406,7 @@ double DistributionCosine::probabilityDensity(double x) const ...@@ -406,7 +406,7 @@ double DistributionCosine::probabilityDensity(double x) const
return DoubleEqual(x, m_mean) ? 1.0 : 0.0; return DoubleEqual(x, m_mean) ? 1.0 : 0.0;
if (std::abs(x - m_mean) > M_PI * m_hwhm) if (std::abs(x - m_mean) > M_PI * m_hwhm)
return 0.0; return 0.0;
return (1.0 + std::cos(((x - m_mean) / m_hwhm) * (M_PI / 2))) / 2; return (1.0 + std::cos(((x - m_mean) / m_hwhm) * (M_PI / 2))) / (4 * m_hwhm);
} }
bool DistributionCosine::isDelta() const bool DistributionCosine::isDelta() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment