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)getD1d, getDtf, and getDtfPos,
the number of points in the 1d sequence.getD2d, the number of rows and columns in the 2d grid,
respectively.getDg, an igraph object from the igraph
package, upon which the penalty matrix should be based (the penalty
matrix is the oriented incidence matrix of the graph, with arbitrary
orientations assigned tgetDtf, and getDtfPos, the order of the
polynomial. E.g., ord=0 is the 1d fused lasso and ord=1 is linear
trend filtering. Hence the returned matrix is the discrete (ord+1)st
derivative operator.getDtfPos, a numeric vector giving the positions of
points in the 1d sequence. Must have length n.getGraph, a fused lasso penalty matrix, the incidence
matrix of an undirected graph, with arbitrary edge orientations.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, trendfiltergetD1d(9)
getDtfSparse(10,2)
graph = getGraph(getD2dSparse(4,4))
plot(graph)Run the code above in your browser using DataLab