Closed mirca closed 5 years ago
Regarding task 1, the vec(L)
operator, in matrix form, has been implemented as vecLmat
. It takes an integer as input (the dimension of the Laplacian) and returns the matrix form of vec(L)
.
BTW, that's how I'm solving the QP:
library(spectralGraphTopology)
T <- 100
w <- runif(6)
Lw <- L(w)
Y <- MASS::mvrnorm(T, rep(0, ncol(Lw)), MASS::ginv(Lw))
S <- cov(Y)
Sinv <- MASS::ginv(S)
R <- vecLmat(ncol(Lw))
Dmat <- t(R) %*% R
Amat <- diag(ncol(R))
dvec <- t(R) %*% vec(Sinv)
res <- quadprog::solve.QP(Dmat, dvec, Amat)
# true
w
# naive
Linv(Sinv)
# QP
res$solution
[1] 0.595212401 0.168481220 0.278359942 0.040504643 0.688191644 0.006119159
[1] 0.66981598 0.20586887 0.26314042 0.05221876 0.72999062 -0.03744698
[1] 0.67730537 0.19837948 0.25565102 0.04472936 0.72250123 0.00000000
@dppalomar this is a lot nicer than the approximation we are currently using since it imposes that w >= 0
, thanks!
Vinicius,
As for the initial point, I think the function could have a parameter to indicate whether we want 1) my first simple idea, 2) this QP you are solving now, 3) the graph lasso solution as initial point. This way we can easily compare them later. And also , each may have a different computational complexity so better let the user choose.
D
On Sun, Aug 19, 2018 at 10:40 PM Zé Vinícius notifications@github.com wrote:
- refine initial guess of w by solving the following QP: min w: ||vec(L_naive) - vec(Lw)||^2
- prepare detailed examples for Jiaxi to investigate why Situation 3 doesn't seem to occur
- compare the performance of spectralGraphTopology against glasso ( http://statweb.stanford.edu/~tibs/glasso/)
- look at qgraph or similar packages to draw graphs
- investigate whether there is a hack to render LaTeX's algorithm2e in the HTML version of the vignette
@dppalomar https://github.com/dppalomar please do add more tasks as you see fit.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AVExBYaoXn7rxzmkqJhDxsoJz000NrI1ks5uSXjvgaJpZM4WC_ZP .
Vinicius, you could explain the three initial points in the vignette. For example, for this case formulate the QP problem in math form using Latex.
The code looks good. Of course with T/N=25, the naive is as good as the QP. But if you try with T=20, then you can see the difference.
BTW, the function learnGraphTopology() should return: w, L, U, lambda, etc. Rather than solution (what is solution? w or L?)
Oh, one more question. How do you do it so that I receive these emails? Each of these emails comes from a commit simply? Or only if you mention me in the commit I get it? How do you mention me?
Do you use RStudio as your IDE or you use something else? With RStudio is quite easy, but I suspect you do the whole Git thing with command lines?
D
On Mon, Aug 20, 2018 at 7:22 AM Zé Vinícius notifications@github.com wrote:
BTW, that's how I'm solving the QP:
library(spectralGraphTopology)
T <- 100 w <- runif(6) Lw <- L(w) Y <- MASS::mvrnorm(T, rep(0, ncol(Lw)), MASS::ginv(Lw)) S <- cov(Y) Sinv <- MASS::ginv(S)
R <- vecLmat(ncol(Lw)) Dmat <- t(R) %% R Amat <- diag(ncol(R)) dvec <- t(R) %% vec(Sinv) res <- quadprog::solve.QP(Dmat, dvec, Amat)
true
w
naive
Linv(Sinv)
QP
res$solution
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1#issuecomment-414163340, or mute the thread https://github.com/notifications/unsubscribe-auth/AVExBSJJCylqTD8FcIM_Oqqs7p00Bx34ks5uSfNMgaJpZM4WC_ZP .
As for the initial point, I think the function could have a parameter to indicate whether we want 1) my first simple idea, 2) this QP you are solving now, 3) the graph lasso solution as initial point. This way we can easily compare them later. And also , each may have a different computational complexity so better let the user choose.
Sure!
Vinicius, you could explain the three initial points in the vignette. For example, for this case formulate the QP problem in math form using Latex.
Sounds good!
BTW, the function learnGraphTopology() should return: w, L, U, lambda, etc. Rather than solution (what is solution? w or L?)
On that snippet of code, solution
was just the result from the QP solver.
Currently, learnGraphTopology returns L(w) (which we call Theta), fun
(objective function value on every iteration), loglike (log likelihood
value on every iteration), w, lambda, and U.
Oh, one more question. How do you do it so that I receive these emails? Each of these emails comes from a commit simply? Or only if you mention me in the commit I get it? How do you mention me?
I'm not sure how GitHub handles that, but if I mention you by typing "@dppalomar" anywhere (commit message, issue, pull request), then you get an email. But I think you can disable that if you would like.
Do you use RStudio as your IDE or you use something else? With RStudio is quite easy, but I suspect you do the whole Git thing with command lines?
I don't use RStudio, but I've seen it's very complete! Does it has integration with git? Yes, I mostly use the command line.
On Sun, Aug 19, 2018 at 9:43 PM Daniel P. Palomar notifications@github.com wrote:
Vinicius,
As for the initial point, I think the function could have a parameter to indicate whether we want 1) my first simple idea, 2) this QP you are solving now, 3) the graph lasso solution as initial point. This way we can easily compare them later. And also , each may have a different computational complexity so better let the user choose.
D
On Sun, Aug 19, 2018 at 10:40 PM Zé Vinícius notifications@github.com wrote:
- refine initial guess of w by solving the following QP: min w: ||vec(L_naive) - vec(Lw)||^2
- prepare detailed examples for Jiaxi to investigate why Situation 3 doesn't seem to occur
- compare the performance of spectralGraphTopology against glasso ( http://statweb.stanford.edu/~tibs/glasso/)
- look at qgraph or similar packages to draw graphs
- investigate whether there is a hack to render LaTeX's algorithm2e in the HTML version of the vignette
@dppalomar https://github.com/dppalomar please do add more tasks as you see fit.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1, or mute the thread < https://github.com/notifications/unsubscribe-auth/AVExBYaoXn7rxzmkqJhDxsoJz000NrI1ks5uSXjvgaJpZM4WC_ZP
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1#issuecomment-414168126, or mute the thread https://github.com/notifications/unsubscribe-auth/AMeKO9Mm54lS-973xC1Xzu8xXcq6ABMuks5uSgYsgaJpZM4WC_ZP .
-- webpage: http://mirca.github.io github: @mirca http://www.github.com/mirca twitter: @mircaze http://www.twitter.com/mircaze
Vinicius,
On that snippet of code, solution
was just the result from the QP solver.
Currently, learnGraphTopology returns L(w) (which we call Theta), fun (objective function value on every iteration), loglike (log likelihood value on every iteration), w, lambda, and U.
Theta should not be a return name as it is just an optimization variable. You can use L.
Oh, one more question. How do you do it so that I receive these emails?
Each of these emails comes from a commit simply? Or only if you mention me in the commit I get it? How do you mention me?
I'm not sure how GitHub handles that, but if I mention you by typing "@dppalomar" anywhere (commit message, issue, pull request), then you get an email. But I think you can disable that if you would like.
No, no, it's good. Otherwise I would totally miss those comments you write... I guess you have that feature abled as well, right? Then if I want to drop you a message, instead of writing it in the code I can just commit and include @mirca
I don't use RStudio, but I've seen it's very complete! Does it has
integration with git?
Yes, of course... I just need to click one button to Push and another to Pull. And another to commit.
Yes, I mostly use the command line.
So what editor do you use?
D
On Sun, Aug 19, 2018 at 9:43 PM Daniel P. Palomar < notifications@github.com> wrote:
Vinicius,
As for the initial point, I think the function could have a parameter to indicate whether we want 1) my first simple idea, 2) this QP you are solving now, 3) the graph lasso solution as initial point. This way we can easily compare them later. And also , each may have a different computational complexity so better let the user choose.
D
On Sun, Aug 19, 2018 at 10:40 PM Zé Vinícius notifications@github.com wrote:
- refine initial guess of w by solving the following QP: min w: ||vec(L_naive) - vec(Lw)||^2
- prepare detailed examples for Jiaxi to investigate why Situation 3 doesn't seem to occur
- compare the performance of spectralGraphTopology against glasso ( http://statweb.stanford.edu/~tibs/glasso/)
- look at qgraph or similar packages to draw graphs
- investigate whether there is a hack to render LaTeX's algorithm2e in the HTML version of the vignette
@dppalomar https://github.com/dppalomar please do add more tasks as you see fit.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1, or mute the thread <
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/dppalomar/spectralGraphTopology/issues/1#issuecomment-414168126 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AMeKO9Mm54lS-973xC1Xzu8xXcq6ABMuks5uSgYsgaJpZM4WC_ZP
.
-- webpage: http://mirca.github.io github: @mirca http://www.github.com/mirca twitter: @mircaze http://www.twitter.com/mircaze
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dppalomar/spectralGraphTopology/issues/1#issuecomment-414171778, or mute the thread https://github.com/notifications/unsubscribe-auth/AVExBW7B6VAZi0iGjy81uGvhTcLt9cMdks5uSgzigaJpZM4WC_ZP .
Theta should not be a return name as it is just an optimization variable. You can use L.
Sure!
I guess you have that feature abled as well, right? Then if I want to drop you a message, instead of writing it in the code I can just commit and include @mirca
Exactly!
So what editor do you use?
Oh, I use vim
(https://www.vim.org).
Updating the TODO list since last time we skyped:
learnGraphTopology
against https://github.com/STAC-USC/Graph_LearninglearnGraphTopology
to the (financial) datasets provided in https://arxiv.org/pdf/1609.09010.pdf
w
by solving the following QP:min w: ||vec(L_naive) - vec(Lw)||^2
spectralGraphTopology
againstglasso
~(http://statweb.stanford.edu/~tibs/glasso/)@dppalomar please do add more tasks as you see fit.