fitacc: Simulation accuracy.

View source: R/mnems.r

fitaccR Documentation

Simulation accuracy.

Description

Computes the accuracy of the fit between simulated and inferred mixture.

Usage

fitacc(x, y, strict = FALSE, unique = TRUE, type = "ham")

Arguments

x

mnem object

y

simulation object or another mnem object

strict

if TRUE, accounts for over/underfitting, i.e. the number of components

unique

if TRUE, phis of x and y are made unique each (FALSE if strict is TRUE)

type

type of accuracy. "ham" for hamming, "sens" for sensitivity and "spec for Specificity"

Value

plot of EM convergence

Author(s)

Martin Pirkl

Examples

sim <- simData(Sgenes = 3, Egenes = 2, Nems = 2, mw = c(0.4,0.6))
data <- (sim$data - 0.5)/0.5
data <- data + rnorm(length(data), 0, 1)
result <- mnem(data, k = 2, starts = 1)
fitacc(result, sim)
fitacc(result, sim, type = "sens")
fitacc(result, sim, type = "spec")
fitacc(result, sim, strict = TRUE, type = "sens")
fitacc(result, sim, strict = TRUE, type = "spec")

cbg-ethz/mnem documentation built on June 29, 2024, 1:56 p.m.