Learn R Programming

stagedtrees (version 2.1.0)

path_probability: Compute probability of a path from root

Description

Internal function to compute probability of a path. It does not check the validity of the path.

Usage

path_probability(object, x, log = FALSE)

Arguments

object

An object of class sevt.

x

the path, expressed as a character vector containing the sequence of the value of the variables.

log

logical, if TRUE log-probability is returned.

Value

The probability of the given path or its logarithm if log=TRUE.

Details

Computes the probability of following a given path (x) starting from the root. Can be a full path from the root to a leaf or a shorter path.