| modelSelection | R Documentation |
Select the best number of breakpoints
modelSelection(rse, n, c = 2.5, lambdas = NULL, method = c("Birge",
"Lebarbier"))
rse |
RSE as output by |
n |
Length of the profile |
c |
Parameter for the model selection |
lambdas |
A list of candidate values for the calibration of the penalty |
method |
Method to calibrate the constant in the penalty for model selection |
This function is not intended to be called directly, but implicitly through
jointSeg or PSSeg.
A list with elements
the best number of breakpoints
A numerical value, the result of an internal model selection function
Morgane Pierre-Jean and Pierre Neuvial
Lebarbier, E. (2005). Detecting multiple change-points in the mean of Gaussian process by model selection. Signal processing, 85(4), 717-736
Birg\'e, L. (2001). Gaussian model selection. J.Eur Math. Soc, 3(3):203-268
jointSeg
PSSeg
## load known real copy number regions affyDat <- acnr::loadCnRegionData(dataSet="GSE29172", tumorFraction=1) sim <- getCopyNumberDataByResampling(1e4, 5, minLength=100, regData=affyDat) Y <- as.matrix(sim$profile[, "c"]) ## Find candidate breakpoints K <- 50 resRBS <- segmentByRBS(Y, K=K) ## Prune candidate breakpoints resDP <- pruneByDP(Y, candCP=resRBS$bkp) selectedModel <- modelSelection(rse=resDP$rse, n=nrow(Y), method="Lebarbier") str(selectedModel) ## breakpoints of the best model bestBkp <- resDP$bkp[[selectedModel$kbest]] print(bestBkp) ## truth print(sim$bkp) ## Note that all of the above can be done directly using 'PSSeg' res <- PSSeg(sim$profile, method="RBS", stat="c", K=K) ## stopifnot(identical(res$bestBkp, bestBkp))