def max_marginal(self, new_var_idx, normed=True) -> LDFactor:
    'Eleiminates certain variables by finding maximum.'
    result = self.to_inferlo_factor().max_marginal(new_var_idx)
    result = LDFactor.from_inferlo_factor(result)
    if normed:
        result.p.normalize()
    return result
Eleiminates certain variables by finding maximum.
def max_marginal(self, new_var_idx, normed=True) -> LDFactor:
    
    result = self.to_inferlo_factor().max_marginal(new_var_idx)
    result = LDFactor.from_inferlo_factor(result)
    if normed:
        result.p.normalize()
    return result