cpp/times/lognormal.cpp
2024-09-16 19:52:51 +02:00

19 lines
605 B
C++

//
// 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);
}