get.W: Get the matrix of weights W for fixed values of the subclones...

Description Usage Arguments Value Examples

View source: R/get.W.R

Description

Optimisation is done by solving a least square problem with inequality constraint thanks to lsei package

Usage

1
get.W(Zt, Y, type = 1L)

Arguments

Zt

The transpose of Z where Z is a matrix with K rows (number of subclones) and M x J columns (number of signal x number of segments)

Y

a matrix with n rows (number of samples) and M x J columns (number of signal x number of segments)

type

integer code determining algorithm to use 1=lsei, 2=solve.QP from R-package quadprog

Value

a matrix with n rows (number of samples) and K columns (number of subclones)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Example with M = 1 signal
J <- 11L  ## Number of segments
K <- 4L   ## Number of subclones
n <- 4L   ## Number of samples

Z <- matrix(1, nrow = K, ncol = J)
Z[2,    2] <- 2
Z[3,  5:6] <- 2
Z[4, 9:10] <- 2

W <- matrix(0, nrow = n, ncol = K)
W[1,1] <- W[2,2] <- W[3,3] <- W[4,4] <- 1

E <- matrix(rnorm(n*J, sd = 0.1), nrow = n, ncol = J)

Y <- W %*% Z + E

What <- c3co:::get.W(t(Z), Y)

pneuvial/c3co documentation built on May 25, 2019, 10:21 a.m.