scoreAdj: Network score

View source: R/mnems.r

scoreAdjR Documentation

Network score

Description

Computes the fit (score of a network) of the data given a network matrix

Usage

scoreAdj(
  D,
  adj,
  method = "llr",
  marginal = FALSE,
  logtype = 2,
  weights = NULL,
  trans.close = TRUE,
  subtopo = NULL,
  prior = NULL,
  ratio = TRUE,
  fpfn = c(0.1, 0.1),
  Rho = NULL,
  dotopo = FALSE,
  P = NULL,
  oldadj = NULL,
  modified = TRUE
)

Arguments

D

data matrix; use modified = FALSE

adj

adjacency matrix of the network phi

method

either llr if D consists of log odds or disc, if D is binary

marginal

logical to compute the marginal likelihood (TRUE)

logtype

log base of the log odds

weights

a numeric vector of weights for the columns of D

trans.close

if TRUE uses the transitive closure of adj

subtopo

optional matrix with the subtopology theta as adjacency matrix

prior

a prior network matrix for adj

ratio

if FALSE uses alternative distance for the model score

fpfn

numeric vector of length two with false positive and false negative rates

Rho

optional perturbation matrix

dotopo

if TRUE computes and returns the subtopology theta (optional)

P

previous score matrix (only used internally)

oldadj

previous adjacency matrix (only used internally)

modified

if TRUE, assumes a prepocessed data matrix

Value

transitively closed matrix or graphNEL

Author(s)

Martin Pirkl

Examples

D <- matrix(rnorm(100*3), 100, 3)
colnames(D) <- 1:3
rownames(D) <- 1:100
adj <- diag(3)
colnames(adj) <- rownames(adj) <- 1:3
scoreAdj(D, adj)

cbg-ethz/mnem documentation built on Feb. 5, 2024, 5:46 a.m.