initial implementation

This commit is contained in:
Roland Conybeare 2023-10-18 12:06:07 -04:00
commit 1078c49269
30 changed files with 2131 additions and 0 deletions

View file

@ -0,0 +1,33 @@
/* LogNormalProcess.hpp */
#pragma once
#include "BrownianMotion.hpp"
#include "ExpProcess.hpp"
namespace xo {
namespace process {
/* log-normal process -- i.e. logs follow brownian motion
*/
class LogNormalProcess {
public:
using utc_nanos = xo::time::utc_nanos;
public:
/* log-normal process starting at (t0, x0) */
template<typename RngEngine, typename Seed>
static ref::rp<ExpProcess> make(utc_nanos t0, double x0,
double sdev, Seed const & seed) {
ref::rp<BrownianMotion<RngEngine>> bm
= BrownianMotion<RngEngine>::make(t0, sdev, seed);
return ExpProcess::make(x0 /*scale*/, bm);
} /*make*/
}; /*LogNormalProcess*/
} /*namespace process*/
} /*namespace xo*/
/* end LogNormalProcess.hpp */