getDxx | R Documentation |
These are utility functions for creating penalty matrices for the
fused lasso and trend filtering problems. Most users will not need to
explicitly construct these as they are created internally by the
fusedlasso
or trendfilter
functions. The sparse
variants output sparse matrices, which should be used whenever
possible because of a significant savings in both construction speed
and memory usage.
The function getGraph is an inverse function for fused lasso problems,
returning an igraph
object (from the igraph
package), the
graph corresponding to the passed penalty matrix.
getD1d(n) getD1dSparse(n) getD2d(dim1, dim2) getD2dSparse(dim1, dim2) getDg(graph) getDgSparse(graph) getDtf(n, ord) getDtfSparse(n, ord) getDtfPos(n, ord, pos) getDtfPosSparse(n, ord, pos) getGraph(D)
The arguments for the sparse variants are identical to those for the regular variants, which are described below.
n |
for |
dim1, dim2 |
for |
graph |
for |
ord |
for |
pos |
for |
D |
for |
All functions except getGraph
return a penalty matrix, either
in standard R matrix format or as a sparse matrix of class
dgCMatrix
via the Matrix
package. The function
getGraph
returns an igraph
object from the igraph
package.
fusedlasso
, trendfilter
getD1d(9) getDtfSparse(10,2) graph = getGraph(getD2dSparse(4,4)) plot(graph)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.