gibbs.samp: gibbs.samp

Description Usage Arguments Value Examples

Description

Call a C++ function that runs a Gibbs Sampler algorithm to sample from the distribution of metabolite to compound attribution with the previous assumption that the connected combination of attributions makes more sense.

Usage

1
gibbs.samp(x, y, N, w, p)

Arguments

x

a vector of masses (unique from mass/retention time pairs).

y

a vector of candidate compounds for each mass.

N

number of iterations to sample.

w

matrix of compound connections.

p

matrix of likelihood probabilities.

Value

A list of matrices with attribution indexes and probabilities.

Examples

1
2
3
4
5
6
# Not to run 
# tmp <- which(w==1, arr.ind=TRUE)
# w_sparse <- sparseMatrix(i = tmp[,1], j = tmp[,2],x = rep(1, nrow(tmp)), dims = c(C,C))
 # x <- 1:ncol(wl$wm)
 # y <- 1:nrow(wl$wm)
 # system.time(conn <- gibbs.samp(x, y, 5000 , w_sparse, p))

rsilvabioinfo/ProbMetab documentation built on May 28, 2019, 3:32 a.m.