join_stages: Join stages

View source: R/join_stages.R

join_stagesR Documentation

Join stages

Description

Join two stages in a staged event tree object, updating probabilities and log-likelihood accordingly.

Usage

join_stages(object, var, s1, s2)

join_stages_unsafe(object, var, s1, s2)

join_all(object, var, stages, ignore = NULL)

Arguments

object

an object of class sevt.

var

variable.

s1

first stage.

s2

second stage.

stages

a vector of stage names for variable var.

ignore

vector of stages which will be ignored and left untouched.

Details

This function joins two stages associated to the same variable, updating probabilities and log-likelihood if the object was fitted.

Value

the staged event tree where s1 and s2 are joined.

Examples

model <- full(PhDArticles, lambda = 0)
model <- stages_fbhc(model)
model$stages$Kids
model <- join_stages(model, "Kids", "5", "6")
model$stages$Kids

stagedtrees documentation built on May 29, 2024, 12:33 p.m.