Skip to content

Commit

Permalink
version 1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Haotian Pang authored and gaborcsardi committed Apr 26, 2015
1 parent 2bf5aa9 commit d772dcc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 73 deletions.
22 changes: 12 additions & 10 deletions DESCRIPTION
@@ -1,18 +1,20 @@
Package: fastclime
Type: Package
Title: A fast solver for parameterized lp problems and constrained l1
minimization approach to sparse precision matrix estimation
Version: 1.2.4
Date: 2013-04-25
Title: A Fast Solver for Parameterized Linear Programming Problems and
Constrained L1 Minimization Approach to Sparse Precision Matrix
Estimation
Version: 1.2.5
Date: 2015-04-26
Author: Haotian Pang, Han Liu and Robert Vanderbei
Maintainer: Haotian Pang <hpang@princeton.edu>
Depends: R (>= 2.15.0), lattice, igraph, MASS, Matrix
Description: The package "fastclime" provides a method of recover the
precision matrix efficiently by applying parametric simplex
method. The computation is based on a linear optimization
solver. It also contains a generic LP solver and a parameterized LP solver using parametric simplex method.
Description: An efficient method of recovering precision matrices
by applying the parametric simplex method is provided in this package.
The computation is based on a linear optimization solver.
It also contains a generic Linear Programming solver and a
parameterized Linear Programming solver based on the parametric simplex method.
License: GPL-2
Repository: CRAN
Packaged: 2014-04-29 19:02:58 UTC; Haotian
Packaged: 2015-04-28 15:09:28 UTC; Haotian
NeedsCompilation: yes
Date/Publication: 2014-04-29 22:09:13
Date/Publication: 2015-04-29 01:00:45
9 changes: 4 additions & 5 deletions MD5
@@ -1,7 +1,7 @@
070ab5a3ccadf297da6d8b28d72dd93c *DESCRIPTION
14f64da498203e5dfa0d0c38e060a879 *DESCRIPTION
91550c718c980cdc013d446f08e2ab43 *NAMESPACE
9e4bf14ea92b98a590d7fa1eac42849f *R/fastclime.R
4371684a2d1351fb9e2367944f3a3884 *R/fastclime.generator.R
72e007d2cb34233ade78ee6e2f1f8b76 *R/fastclime.generator.R
8ef3ee31b65f547317d1462094958e44 *R/fastclime.lambda.R
b3963588ea4d8a6a2cd76260cc1d1e4d *R/fastclime.plot.R
5c3828535b08a0c1788ed23c83861df0 *R/fastlp.R
Expand All @@ -12,7 +12,7 @@ ec90576375b24e35502847bdd1d85b6e *data/stockdata.rda
f98003a926cc707a4151fca574f18949 *inst/doc/vignette.pdf
fecc41afd3b960765e9bb14249608699 *man/fastclime-package.Rd
0de78a40947a13893cc690823524fd3b *man/fastclime.Rd
f13eef1099b8dad1091dd5764e6b6eb5 *man/fastclime.generator.Rd
05bb9eae8a1e4a458d4c9630fd907b8d *man/fastclime.generator.Rd
324d7b637a23e7d94cd740ae71269204 *man/fastclime.lambda.Rd
64307ab02e80b23986e1f4446aa316c6 *man/fastclime.plot.Rd
35a34d4b383d8d9798b754ca6ebd808b *man/fastlp.Rd
Expand All @@ -22,7 +22,6 @@ e45d01c047c1c70cd41af8adb55ec220 *man/paralp.Rd
b196c00bb421f420ddd428008f97458b *man/print.fastclime.Rd
fbb7265b9ba8567834e3a326c7b67247 *man/print.sim.Rd
f584effdd8752b5956fea4ac449e7e33 *man/stockdata.Rd
b10cd7a70f4a0772e49935ad349b56a8 *src/SFGen.c
35a63cab361acbbe913b1ed670d0c13f *src/fastlp.c
3d21bc5d49dee6d81d869301b5adbcb0 *src/heap.c
ad5e9b747ce1895e811d2d2e8052eddc *src/heap.h
Expand All @@ -33,7 +32,7 @@ af36d5dada6396e15a3010c505432213 *src/lu.h
abc0a80ca8d0260b12e96ba9f9df608f *src/macros.h
e1be8277ecf906d37bc71e80fb591490 *src/myalloc.h
f71b04cab340901ada6b838edac84ff9 *src/paralp.c
166e45905eb115b30eac2e29e86da9a2 *src/parametric.c
38e3e602e5d4ef2881e1d209050bf5d2 *src/parametric.c
38e9ff9c3d2f5b3b832010d120069caf *src/tree.c
ebd8db35929bc9a80f444621e0e0f909 *src/tree.h
0dcd4cce00eb3ef52ec58251b0c62ea4 *vignettes/fastclime.pdf
Expand Down
6 changes: 0 additions & 6 deletions R/fastclime.generator.R
Expand Up @@ -88,12 +88,6 @@ fastclime.generator = function(n = 200, d = 50, graph = "random", v = NULL, u =
gc()
}

if(graph == "scale-free"){
if(is.null(u)) u = 0.1
if(is.null(v)) v = 0.3
out = .C("SFGen",dd0=as.integer(2),dd=as.integer(d),G=as.integer(theta),package="fastclime")
theta = matrix(as.numeric(out$G),d,d)
}
diag(theta) = 0
omega = theta*v

Expand Down
8 changes: 2 additions & 6 deletions man/fastclime.generator.Rd
Expand Up @@ -6,7 +6,7 @@ Data generator
}

\description{
Implements the data generation from multivariate normal distributions with different graph structures, including \code{"random"}, \code{"hub"}, \code{"cluster"}, \code{"band"} and \code{"scale-free"}.
Implements the data generation from multivariate normal distributions with different graph structures, including \code{"random"}, \code{"hub"}, \code{"cluster"} and \code{"band"}.
}

\usage{
Expand All @@ -22,7 +22,7 @@ The number of observations (sample size). The default value is \code{200}.
The number of variables (dimension). The default value is \code{50}.
}
\item{graph}{
The graph structure with 4 options: \code{"random"}, \code{"hub"}, \code{"cluster"}, \code{"band"} and \code{"scale-free"}.
The graph structure with 4 options: \code{"random"}, \code{"hub"}, \code{"cluster"} and \code{"band"}.
}
\item{v}{
The off-diagonal elements of the precision matrix, controlling the magnitude of partial correlations with \code{u}. The default value is \code{0.3}.
Expand Down Expand Up @@ -50,7 +50,6 @@ Given the adjacency matrix \code{theta}, the graph patterns are generated as bel
(II)\code{"hub"}:The row/columns are evenly partitioned into \code{g} disjoint groups. Each group is associated with a "center" row \code{i} in that group. Each pair of off-diagonal elements are set \code{theta[i,j]=theta[j,i]=1} for \code{i!=j} if \code{j} also belongs to the same group as \code{i} and \code{0} otherwise. It results in \code{d - g} edges in the graph.\cr\cr
(III)\code{"cluster"}:The row/columns are evenly partitioned into \code{g} disjoint groups. Each pair of off-diagonal elements are set \code{theta[i,j]=theta[j,i]=1} for \code{i!=j} with the probability \code{prob}if both \code{i} and \code{j} belong to the same group, and \code{0} other wise. It results in about \code{g*(d/g)*(d/g-1)*prob/2} edges in the graph.\cr\cr
(IV)\code{"band"}: The off-diagonal elements are set to be \code{theta[i,j]=1} if \code{1<=|i-j|<=g} and \code{0} other wise. It results in \code{(2d-1-g)*g/2} edges in the graph.\cr\cr
(V) \code{"scale-free"}: The graph is generated using B-A algorithm. The initial graph has two connected nodes and each new node is connected to only one node in the existing graph with the probability proportional to the degree of the each node in the existing graph. It results in \code{d} edges in the graph.

The adjacency matrix \code{theta} has all diagonal elements equal to \code{0}. To obtain a positive definite precision matrix, the smallest eigenvalue of \code{theta*v} (denoted by \code{e}) is computed. Then we set the precision matrix equal to \code{theta*v+(|e|+0.1+u)I}. The covariance matrix is then computed to generate multivariate normal data.
}
Expand Down Expand Up @@ -100,7 +99,4 @@ L = fastclime.generator(graph = "hub", g = 6, vis = TRUE)
## hub graph with 8 clusters
L = fastclime.generator(graph = "cluster", g = 8, vis = TRUE)

## scale-free graphs
L = fastclime.generator(graph="scale-free", vis = TRUE)

}
43 changes: 0 additions & 43 deletions src/SFGen.c

This file was deleted.

11 changes: 8 additions & 3 deletions src/parametric.c
Expand Up @@ -256,7 +256,7 @@ void solver2(
MALLOC( basics, m, int );
MALLOC( nonbasics, n, int );
MALLOC( basicflag, N, int );
CALLOC( output_vec, N, double );


/****************************************************************
* initialization. *
Expand All @@ -281,6 +281,8 @@ void solver2(
lufac( m, ka, ia, a, basics, 0 );

for (iter=0; iter<lambda; iter++) {

CALLOC( output_vec, N, double );
// count=0;
if(iter>maxiter){
maxiter=iter;
Expand Down Expand Up @@ -309,7 +311,7 @@ void solver2(
output_vec[basics[i]] = x_B[i];
}
for(i=0;i<m/2;i++){
if((output_vec[i]-output_vec[i+m/2])>EPS3){
if(fabs(output_vec[i]-output_vec[i+m/2])>EPS3){
// count++;
icov_mtx[iter][m/2*ColNum+i]=output_vec[i]-output_vec[i+m/2];
}
Expand Down Expand Up @@ -408,9 +410,11 @@ void solver2(
for (k=0; k<ndy_N; k++) {
j = idy_N[k];
y_N[j] -= s *dy_N[k];
y_N[col_in] = s;

}

y_N[col_in] = s;

for (k=0; k<ndx_B; k++) {
i = idx_B[k];
x_B[i] -= t *dx_B[k];
Expand All @@ -436,6 +440,7 @@ void solver2(
* step 8: refactor basis *
*************************************************************/
refactor( m, ka, ia, a, basics, col_out, v );
FREE( output_vec );

}

Expand Down

0 comments on commit d772dcc

Please sign in to comment.