full_indep: Full and independent staged event tree

full_indepR Documentation

Full and independent staged event tree

Description

Build fitted staged event tree from data.

Usage

full(
  data,
  order = NULL,
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

## S3 method for class 'table'
full(
  data,
  order = names(dimnames(data)),
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

## S3 method for class 'data.frame'
full(
  data,
  order = colnames(data),
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

indep(
  data,
  order = NULL,
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

## S3 method for class 'table'
indep(
  data,
  order = names(dimnames(data)),
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

## S3 method for class 'data.frame'
indep(
  data,
  order = colnames(data),
  join_unobserved = TRUE,
  lambda = 0,
  name_unobserved = "UNOBSERVED"
)

Arguments

data

data to create the model, data.frame or table.

order

character vector, order of variables.

join_unobserved

logical, if situations with zero observations should be joined (default TRUE).

lambda

smoothing coefficient (default 0).

name_unobserved

name to pass to join_unobserved.

Details

Functions to create full or independent staged tree models from data. The full (or saturated) staged tree is the model where every situation is in a different stage, and thus the model has the maximum number of parameters. Conversely, the independent staged tree (indep) assigns all the situations related to the same variable to the same stage, thus it is equivalent to the independence factorization.

Examples


## full model
DD <- generate_xor_dataset(4, 100)
model_full <- full(DD, lambda = 1)

## independence model (data.frame)
DD <- generate_xor_dataset(4, 100)
model <- indep(DD, lambda = 1)
model

stagedtrees documentation built on April 29, 2022, 1:06 a.m.