Learn R Programming

PReMiuM (version 3.2.13)

calcDissimilarityMatrix: Calculates the dissimilarity matrix

Description

Calculates the dissimilarity matrix.

Usage

calcDissimilarityMatrix(runInfoObj, onlyLS=FALSE)

Value

Need to write this

disSimRunInfoObj

These are details regarding the run and in the same format as runInfoObj.

disSimMat

The dissimilarity matrix, in vector format. Note that it is diagonal, so this contains the upper triangle diagonal entries.

disSimMatPred

The dissimilarity matrix, again in vector format as above, for the predicted subjects.

lsOptSweep

The optimal partition among those explored by the MCMC, as defined by the least squares method. See Dahl (2006).

onlyLS

Logical. If it set to TRUE the only method available to identify the optimal partition using 'calcOptimalClustering' is least squares.

Arguments

runInfoObj

Object of type runInfoObj.

onlyLS

Logical. It is set to FALSE by default. When it is equal to TRUE the dissimilarity matrix is not returned and the only method available to identify the optimal partition using 'calcOptimalClustering' is least squares. This parameter is to be used for datasets with many subjects, as C++ can compute the dissimilarity matrix but it cannot pass it to R for usage in the function 'calcOptimalClustering'. As guidance, be aware that a dataset with 85,000 subjects will require a RAM of about 26Gb, even if onlyLS=TRUE.

Authors

David Hastie, Department of Epidemiology and Biostatistics, Imperial College London, UK

Silvia Liverani, Department of Epidemiology and Biostatistics, Imperial College London and MRC Biostatistics Unit, Cambridge, UK

Maintainer: Silvia Liverani <liveranis@gmail.com>

References

Silvia Liverani, David I. Hastie, Lamiae Azizi, Michail Papathomas, Sylvia Richardson (2015). PReMiuM: An R Package for Profile Regression Mixture Models Using Dirichlet Processes. Journal of Statistical Software, 64(7), 1-30. tools:::Rd_expr_doi("10.18637/jss.v064.i07").

Examples

Run this code
if (FALSE) {
generateDataList <- clusSummaryBernoulliDiscrete()
inputs <- generateSampleDataFile(generateDataList)
runInfoObj<-profRegr(yModel=inputs$yModel, xModel=inputs$xModel, 
    nSweeps=10, nBurn=20, data=inputs$inputData, output="output", 
    covNames=inputs$covNames,nClusInit=15)

dissimObj<-calcDissimilarityMatrix(runInfoObj)
}

Run the code above in your browser using DataLab