cpp/times/lognormal.cpp

19 lines
605 B
C++
Raw Permalink Normal View History

2024-09-16 17:52:51 +00:00
//
// Created by dominik on 8/24/24.
//
#include "lognormal.h"
#include <cmath>
LogNormalDistribution::LogNormalDistribution(const double tau, const double sigma, std::mt19937_64& rng) : Distribution(tau, rng), m_sigma(sigma), m_distribution(std::log(tau), sigma) {}
LogNormalDistribution::LogNormalDistribution(std::mt19937_64& rng) : Distribution(rng) {}
void LogNormalDistribution::initialize() {
m_distribution = std::lognormal_distribution(std::log(m_tau), m_sigma);
m_tau_jump = m_distribution(m_rng);
}
void LogNormalDistribution::draw_tau() {
m_tau_jump = m_distribution(m_rng);
}