Blyx Nest Blyx language
Registry / Library
library · v0.1.0

BetaUpdate

Update a Beta prior with Bernoulli counts.

Source repository · Package JSON

Use BetaUpdate

use vendor::betaupdate::betaupdate;

Run the example

nest demo betaupdate@0.1.0
blyxc native-run betaupdate-demo/main.blyx
Example source and expected output
use vendor::betaupdate::betaupdate;

fn main() {
    let alpha = 1.0;
    let beta = 1.0;
    let positive = 3.0;
    let negative = 1.0;
    let result = betaupdate_observe(alpha, beta, positive, negative);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

4
2

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIPa0ed98a55c422b4500a4eb928491a3eeee06be2f043dd442ab5a3bb19751a51f716fa95d0d