Looping through a vector of paired indices (i,j) vs two for loops

57 views
Skip to first unread message

Daeil Kim

unread,
Apr 1, 2016, 4:56:09 PM4/1/16
to Stan users mailing list
I'm looking to do some link prediction on a graph using the Mixed Membership Stochastic Block model. To get AUC scores, I need to loop only through a subset of edges so that I could use my learned latent variables to predict the rest. I'm wondering what the best way of enforcing that would be. Is is possible to loop through a vector containing a list of valid edge indices? Most of the examples I'm seeing show a double for loop to loop through the generation of edges.

Bob Carpenter

unread,
Apr 1, 2016, 5:49:21 PM4/1/16
to stan-...@googlegroups.com
There's an LDA example in the manual, but given your question,
you might find the chapter on sparse and ragged data structures
more helpful.

- Bob

> On Apr 1, 2016, at 4:56 PM, Daeil Kim <daei...@nytimes.com> wrote:
>
> I'm looking to do some link prediction on a graph using the Mixed Membership Stochastic Block model. To get AUC scores, I need to loop only through a subset of edges so that I could use my learned latent variables to predict the rest. I'm wondering what the best way of enforcing that would be. Is is possible to loop through a vector containing a list of valid edge indices? Most of the examples I'm seeing show a double for loop to loop through the generation of edges.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages