# tsce: Exact solution of the Two-Stage Clonal Expansion Model In msce: Hazard of Multi-Stage Clonal Expansion Models

## Description

For piecewise constant parameters `tsce(t,parameterList)` returns the exact hazard and logarithm of the survival function of the Two-Stage Clonal Expansion Model. All arguments are matrices. Evaluation is performed separately for each row.

## Usage

 `1` ```tsce(t, parameterList) ```

## Arguments

 `t` Each element in a row of `t` defines the endpoint of a time interval. The first time interval starts at time `0`. The last element is the time point for which hazard and survival function are evaluated. Elements in a row have to be in monotonously increasing order. In order to achieve a different number of time intervals for different rows, rows may start with an arbitrary number of zeros (i.e. time intervals of length zero). `parameterList` List of Matrices. Each list member has to be named. Allowed names are `Nnu0`, `alpha`, `gamma`, and `nu1`. Matrices `Nnu0` and `nu1` must be provided. If `alpha` or `gamma` are missing, they are assumed to be zero. For each matrix it has to hold that the number of columns must be equal to the ones in `t`. The number of rows can either equal to the number of rows in `t`, or only one row is provided, which then is applied to all rows of `t`. Values in matrices `Nnu0`, `alpha`, `gamma`, `nu1` correspond to parameters for each time interval, see the figure and explanations in the package vignette. Here, `Nnu0` is the product of N and nu0 and gamma is defined by alpha-beta.

## Details

`msce_numerical`

## Examples

 ```1 2 3 4 5 6 7 8``` ```t <-matrix(data=c(10,20,65,10,20,70),nrow=2,byrow=TRUE) Nnu0 <- matrix(c(0.3,0.7,1),nrow = 1) alpha<- matrix(1,nrow=1,ncol=3) gamma<- matrix(c(0.13,0.13,0.13, 0.15,0.15,0.15),nrow=2,byrow=TRUE) nu1 <- matrix(1e-6,nrow=1,ncol=3) pars = list(Nnu0=Nnu0, alpha=alpha,gamma=gamma,nu1=nu1) tsce(t,pars) ```

### Example output

```\$Nnu0
[,1] [,2] [,3]
[1,]  0.3  0.7    1

\$alpha
[,1] [,2] [,3]
[1,]    1    1    1

\$gamma
[,1] [,2] [,3]
[1,] 0.13 0.13 0.13
[2,] 0.15 0.15 0.15

\$nu1
[,1]  [,2]  [,3]
[1,] 1e-06 1e-06 1e-06

\$hazard
[1] 0.01288352 0.04703408

\$lnSurvival
[1] -0.1080371 -0.4342728
```

msce documentation built on Nov. 10, 2020, 5:09 p.m.