rendered paste body System.out.println("Single datapoint example!");
ExponentialState expState = new ExponentialState();
expState.mean.set(new DoubleState(0.0));
expState.datum.set(new DoubleState(10.0));
/* */
RandomSource randomSource = Distributions.randomSource();
/* */
ExponentialDistribution ed =
Distributions.defaultFactory().exponentialWithRate(randomSource);
ScalarContinuousRateDensity scrd = new ScalarContinuousRateDensity(ed);
LetKernel muLetKernel = new LetKernel(new Path().add(new KeyPathElement(expState.mean)));
DoubleDriftKernel muKernel = new DoubleDriftKernel(0.1);
muLetKernel.subkernel.set(muKernel);
// Configure the inference engine and sample
SDK<ExponentialState> sdk = new SDK<ExponentialState>(expState, scrd, muLetKernel);
int NUMSAMPLES = 100;
Walk<ExponentialState> engine = new Walk<ExponentialState>(sdk, Distributions.randomSource(),
new WalkControllerFixedLengthRun<ExponentialState>(NUMSAMPLES));
engine.getSDK().declareQuery(
new PeriodicQuery<ExponentialState>(
new LogDensityReportingQuery<ExponentialState>(), 1));
engine.go();