Learn R Programming

jointseg (version 1.0.3)

modelSelection: Model selection

Description

Select the best number of breakpoints

Usage

modelSelection(
  rse,
  n,
  c = 2.5,
  lambdas = NULL,
  method = c("Birge", "Lebarbier")
)

Value

A list with elements

lambda

A numerical value, the result of an internal model selection function

Arguments

rse

RSE as output by pruneByDP

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

Author

Morgane Pierre-Jean and Pierre Neuvial

Details

This function is not intended to be called directly, but implicitly through jointSeg or PSSeg.

References

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

See Also

jointSeg

PSSeg

Examples

Run this code

## 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))

Run the code above in your browser using DataLab