KTBNGenerator.setGuaranteeOrder

KTBNGenerator.setGuaranteeOrder(on)

Force one arc of lag k-1 into the kernel slice, so the generated model’s effective Markov order really equals k (default True). Without this, a random draw may end up with no arc of lag k-1, making the true order lower than k and undetectable from data sampled off the model. No-op when k = 1 or there is no temporal process.

Parameters:

on (bool) – whether to guarantee the effective order

Returns:

self, for chaining

Return type:

pyagrum.ktbn.KTBNGenerator

Example

import pyagrum as gum
import pyagrum.ktbn as ktbn

gum.initRandom(42)
gen = ktbn.KTBNGenerator(3, 2)
gen.setGuaranteeOrder(True)
model = gen.generate()
# at least one arc of lag k-1 = 2 into the last slice
any(tail[1] == 0 and head[1] == 2 for tail, head in model.arcs())
# True

Class

KTBNGenerator