gapsMapTestRun
calls the C++ MCMC code and performs Bayesian
matrix factorization returning the two matrices that reconstruct
the data matrix; as opposed to gapsRun, this method takes an
additional input specifying set patterns in the P matrix.
Test procedures allow for the returning of the matrix
and atomic information for A and P during each step of the equilibration and sampling.gapsMapTestRun
calls the C++ MCMC code and performs Bayesian
matrix factorization returning the two matrices that reconstruct
the data matrix; as opposed to gapsRun, this method takes an
additional input specifying set patterns in the P matrix.
Test procedures allow for the returning of the matrix
and atomic information for A and P during each step of the equilibration and sampling. .gapsMapTestRun(D, S, FP, ABins = data.frame(), PBins = data.frame(), nFactor = 7,
simulation_id = "simulation", nEquil = 1000, nSample = 1000,
nOutR = 1000, output_atomic = FALSE, fixedMatrix="P", fixedBinProbs = FALSE,
fixedDomain = "N", alphaA = 0.01, nMaxA = 1e+05, max_gibbmass_paraA = 100,
alphaP = 0.01, nMaxP = 1e+05, max_gibbmass_paraP = 100)
CoGAPS
## Load data
data('SimpSim')
## Specify the fixed pattern
mapP <- matrix(0,nrow=2,ncol=20)
mapP[1,1:10] <- 1
mapP[2,11:20] <- 1
## Run the GAPS matrix decomposition
nIter <- 10
testmap <- gapsMapTestRun(SimpSim.D, SimpSim.S, FP=mapP,
nFactor=3,nEquil = nIter,nSample = nIter)
## Compare fixed patterns to input patterns (after scaling)
summary(t(testmap$Pmean[2:3,] - sweep(mapP,1,apply(mapP,1,sum),FUN="/")))
Run the code above in your browser using DataLab