| Type: | Package |
| Title: | Estimating Regularized Multi-state Models Using L1 Penalties |
| Version: | 0.99 |
| Date: | 2015-01-12 |
| Author: | Holger Reulen |
| Maintainer: | Holger Reulen <hreulen@uni-goettingen.de> |
| Description: | Structured fusion Lasso penalized estimation of multi-state models with the penalty applied to absolute effects and absolute effect differences (i.e., effects on transition-type specific hazard rates). |
| License: | GPL-2 |GPL-3 [expanded from: GPL (≥ 2)] |
| Imports: | Rcpp (≥ 0.11.3) |
| LinkingTo: | Rcpp |
| Packaged: | 2015-01-12 12:43:14 UTC; Holger Reulen |
| NeedsCompilation: | yes |
| Repository: | CRAN |
| Date/Publication: | 2015-01-12 14:41:14 |
Calculation of risksets needed for partial likelihood formulationof multistate models.
Description
This function calculates the risksets needed to calculatethe partial likelihood of a multistate model, and/or it's derivatives.
Usage
buildrisksets(entry, exit, trans, event, trace)Arguments
entry | vector with entry times. |
exit | vector with exit times. |
trans | vector with transition types. |
event | vector with noncensoring event indicators. |
trace | logical triggering printout of status information during the fitting process. |
Details
This function calculates risksets.
Value
A list of length 2 with elementsCi andRi, eachvectors of lengthn.
Author(s)
Holger Reulen
First derivative of the locally quadratic approximated penalty.
Description
This function calculates the first derivative of thelocally quadratic approximated penalty.
Usage
dapproxpenalty(psv, beta, constant)Arguments
psv | penalty structure vector that determines the l-th penalty component when multyplied with |
beta | vector of regression coefficients. |
constant | constant that is needed for the locally (in theneighborhood of 0) quadratical approximation of the absolute value function. |
Details
This function calculates the first derivative of the locallyquadratic approximated penalty.
Value
The value of the derivative.
Author(s)
Holger Reulen
Examples
## Not run: almatrix(psv, beta, constant)ddlpl.
Description
Second partial derivative of the log partial likelihoodwith respect to the linear predictor.
Usage
ddlpl(b, X, Ri, Ci)Arguments
b | vector of regression coefficients. |
X | design matrix. |
Ri | list of length |
Ci | list of length |
Details
This function calculates the second partial derivative of the log partial likelihood.
Value
A vector with second gradients.
Author(s)
Holger Reulen
Examples
## Not run: ddlpl(b, X, Ri, Ci)First derivative of the Log Partial Likelihood.
Description
Calculates the first partial derivative of the log partiallikelihood with respect to the linear predictor.
Usage
dlpl(event, b, X, Ri, Ci)Arguments
event | non-censoring event indicator. |
b | vector of regression coefficients |
X | design matrix |
Ri | list of length |
Ci | list of length |
Details
This function calculates the first derivative of the log partial likelihood of a Coxtype multistate model.
Value
A vector with the values of the partial first derivatives of thelog partial likelihood with respect to the regression effects.
Author(s)
Holger Reulen
Examples
## Not run: dlpl(event, b, X, Ri, Ci)First derivative of the penalty function.
Description
This function implements the first derivative of the penalty function.
Usage
dpenaltyfunction(psv, beta)Arguments
psv | penalty structure vector. |
beta | estimated regression effects. |
Details
This function implements the first derivative of thepenalty function with respect to the penalty.The term 'penalty function' is described in detail on p. 4 in Oelker,Tutz (2013): A General Family of Penalties for Combining DifferingTypes of Penalties in Generalized Structured Models.
Value
Value of the first derivative of the penalty function (note: thisis always 1, since the penalty fucntion p(xi)=xi is just the identity).
Author(s)
Holger Reulen
Examples
## Not run: dpenaltyfunction(psv, beta)Fisher information matrix of the log partial likelihood of amultistate model.
Description
This function provides a fast implementation for the calculation of the Fisher information matrixneeded for the estimation of fusion lasso penalized multi-state models in a piece-wise exponential framework.
Usage
fishercpp(Xcpp, mucpp)Arguments
Xcpp | ... |
mucpp | ... |
Details
...
Value
...
Author(s)
Holger Reulen
Examples
## Not run: fishercpp(Xcpp, mucpp)Fisher information matrix of the log partial likelihood of amultistate model.
Description
This function calculates the Fisher information matrixneeded for the estimation of multistate models using the Fisherscoring algorithm.
Usage
fisherinfo(beta, X, risksetlist, event)Arguments
beta | vector of regression coefficients. |
X | design matrix. |
risksetlist | list of length |
event | non-censoring event indicator. |
Details
This function implements the Fisher scoring matrix (i.e., thesecond partial derivative of the log partial likelihood with respectto the components of the regression effect vectorbeta).
Value
Fisher information matrixinfo.
Author(s)
Holger Reulen
Examples
## Not run: fisherinfo(beta, X, risksetlist, event)Fisher information matrix of the Poisson log likelihood.
Description
This function calculates the Fisher information matrixneeded for the estimation of multistate models using the Fisherscoring algorithm.
Usage
fisherinfoP(mu, X)Arguments
mu | mu. |
X | design matrix. |
Details
This function implements the Fisher scoring matrix (i.e., thesecond partial derivative of the log partial likelihood with respectto the components of the regression effect vectorbeta).
Value
Fisher information matrixinfo.
Author(s)
Holger Reulen
Examples
## Not run: fisherinfo(mu, X)Log Likelihood for Poisson Regression.
Description
Calculates the log likelihood for poisson regression.
Usage
llP(beta, X, event, offset)Arguments
beta | vector of regression coefficients. |
X | design matrix. |
event | non-censoring event indicator. |
offset | offset. |
Details
This function calculates the Poisson log likelihood.
Value
The values of the Poisson log likelihood.
Author(s)
Holger Reulen
Examples
## Not run: llP(beta, X, event, offset)Log Partial Likelihood.
Description
Calculates the log partial likelihood.
Usage
lpl(beta, X, risksetlist, event)Arguments
beta | vector of regression coefficients. |
X | design matrix. |
risksetlist | list of length |
event | non-censoring event indicator. |
Details
This function calculates the log partial likelihood of a Cox-type multistate model.
Value
The values of the spell-specific log partial likelihood contributions.
Author(s)
Holger Reulen
Examples
## Not run: lpl(beta, X, risksetlist, event)penMSM.
Description
L1 penalized estimation of multistate models.
Usage
penMSM(type = "fused", d, X, PSM1, PSM2, lambda1, lambda2, w, betastart, nu = 0.5, tol = 1e-10, max.iter = 50, trace = TRUE, diagnostics = TRUE, family = "coxph", poissonresponse = NULL, poissonoffset = NULL, constant.approx = 1e-8)Arguments
type | character defining the type of penalty, either |
d | data set with variables (mandatory) |
X | design matrix. |
PSM1 | penalty structure matrix containing the penalty structure vectors |
PSM2 | penalty structure matrix containing the penalty structure vectors |
lambda1 | vector with penalty parameters for the respective penaltycomponents (lasso part). |
lambda2 | vector with penalty parameters for the respective penaltycomponents (fusion part). |
w | vector containing weights for the respective penaltycomponents. |
betastart | vector containing starting values for beta. |
nu | numeric value denoting the weight, i.e. a value between 0 and1, of the Fisher scoring updates. |
tol | relative update tolerance for stopping of the estimation algorithm. |
max.iter | number of maximum iterations if tlerance is not reached. |
trace | logical triggering printout of status information during the fitting process. . |
diagnostics | logical triggering that Fisher matrix, score vector, and approximated penalty matrix are returned with the results. |
family | character defining the likelihood to be used. |
poissonresponse | response values for poisson likelihood (if used). |
poissonoffset | offset values for poisson likelihood (if used). |
constant.approx | constant for locally squared approximation of the absolute value penalty function. |
Details
This function is the core function of this package.It implements L1 penalized estimation of multistate models, withthe penalty applied to absolute effects and absolute effectdifferences on transition-type specific hazard rates.
Value
A list with elementsB (matrix with estimatedeffects),aic (Akaike Information Criterion),gcv (GCVcriterion),df (degrees of freedom), and (ifdiagnostics are requested)F (Fisher matrix),s (score vector), andA (approximated penalty matrix).
Author(s)
Holger Reulen
Examples
## Not run: penMSMtype = "fused", d, X, PSM1, PSM2, lambda1, lambda2, w, betastart, nu = 0.5, tol = 1e-10, max.iter = 50, trace = TRUE, diagnostics = TRUE, family = "coxph", poissonresponse = NULL, poissonoffset = NULL, constant.approx = 1e-8)## End(Not run)Penalty matrix for L1 penalized estimation of multistate models.
Description
This builds up a penalty matrix needed for thepenalized estimation of multistate models.
Usage
penaltymatrix(lambda, PSM, beta, w, constant)Arguments
lambda | vector with penalty parameters for the respective penaltycomponents. |
PSM | penalty structure matrix containing the penalty structure vectors |
beta | vector of regression coefficients. |
w | vector containing weights for the respective penalty components. |
constant | constat that is needed for the locally (in theneighborhood of 0) quadratical approximation of the absolute valuefunction. |
Details
This function calculates the penalty matrix needed for thepenalized estimation of multistate models.
Value
A penalty matrixplambda.
Author(s)
Holger Reulen
Examples
## Not run: penaltymatrix(lambda, PSM, beta, w, constant)plmatrix.
Description
This function establishes the single vectors that set upthe penalty matrix in functionpenaltymatrix.
Usage
plmatrix(psv, beta, constant)Arguments
psv | index vector that determines the l-th penalty componentwhen multiplied with |
beta | vector of regression coefficients. |
constant | constant that is needed for the locally (in theneighborhood of 0) quadratical approximation of the absolute valuefunction. |
Details
This function calculates the value of the l-th penaltycomponent, which is a locally (in the neighborhood of 0) quadraticalapproximation of the absolute value of a regression coefficient, orthe difference between two coefficients, respectively.
Value
The objectresult takes the value of the l-th penaltycomponent.
Author(s)
Holger Reulen
Examples
## Not run: plmatrix(psv, beta, constant)Score vector and Fisher information matrix of the Poisson log likelihood.
Description
This function calculates the score vector and the Fisher information matrix needed for theestimation of multistate models using the Fisher scoring algorithm.
Usage
sF(mu, X, event)Arguments
mu | mu. |
X | design matrix. |
event | non-censoring event indicator. |
Details
This function implements the score vector and Fisher information matrix.
Value
s and F.
Author(s)
Holger Reulen
Examples
## Not run: sF(mu, X, event)Score vector of the log partial likelihood of a multistatemodel.
Description
This function calculates the score vector needed for theestimation of multistate models using the Fisher scoring algorithm.
Usage
scorevector(beta, X, risksetlist, event)Arguments
beta | vector of regression coefficients. |
X | design matrix. |
risksetlist | list of length |
event | non-censoring event indicator. |
Details
This function implements the score vector (i.e., thefirst partial derivative of the log partial likelihood with respectto the components of the regression effect vectorbeta).
Value
Score vectorscorevector.
Author(s)
Holger Reulen
Examples
## Not run: scorevector(beta, X, risksetlist, event)Score vector of the Poisson log likelihood.
Description
This function calculates the score vector needed for theestimation of multistate models using the Fisher scoring algorithm.
Usage
scorevectorP(mu, X, event)Arguments
mu | mu. |
X | design matrix. |
event | non-censoring event indicator. |
Details
This function implements the score vector (i.e., thefirst partial derivative of the Poisson log likelihood with respectto the components of the regression effect vectorbeta).
Value
Score vectorscorevector.
Author(s)
Holger Reulen
Examples
## Not run: scorevectorP(beta, X, event)