Skip to content

Releases

nwsbm 1.0.2

Choose a tag to compare

@thomas-u-grund thomas-u-grund released this 20 Nov 22:12
  • Fixes: the line "Lower bound J" of the header wrapped at set linesize 80; the header of estat icl is shorter and no longer wraps. maxblocks(0) used to mean the default silently; it is now an error, r(198), "maxblocks() must be a positive integer".
  • Help: the printed ICL is the approximation of blockmodels and sbm, icl(exact) can prefer another number of blocks, and the ICL of a given number of blocks depends slightly on the seed.
  • Test cscripts/test_nwsbm_errors.do (maxblocks(0)) and cscripts/test_nwsbm_linesize.do (no wrapped line at linesize 80).

Tested on macOS with Stata 17 BE: the dialog assembly test, test_nwsbm_plots, test_nwsbm_errors and the new test_nwsbm_linesize. On Linux (Ubuntu 22.04) and Windows 11 (both StataNow 19.5 MP): all test files pass. Stata 18 not run.

nwsbm 1.0.1

Choose a tag to compare

@thomas-u-grund thomas-u-grund released this 20 Nov 13:38
  • The dialog test tools/dlg_assembly_test.py checks the command that nwsbmplot.dlg builds (type(), name(), saving(), export()).

Tested on macOS with Stata 17 BE, on Linux (Ubuntu 22.04) and on Windows 11 (both StataNow 19.5 MP): dialog assembly test, test_nwsbm_plots and test_nwsbm_errors. Stata 18 on the Mac: not run.

nwsbm 1.0.0

Choose a tag to compare

@thomas-u-grund thomas-u-grund released this 20 Nov 09:32

First stable release. From 1.0.0 the syntax, the stored results and the options are kept within 1.x.

  • Fixes: the default titles of nwsbmplot types matrix, expected, icl and blocks were drawn with literal quotation marks; a title given with its own options, title("x", size(large)), is black too unless it carries color(). Test in cscripts/test_nwsbm_plots.do (the default title gives the same picture as the same title given explicitly).
  • Fixes: nwsbmplot, export(file, options) failed with "invalid replace"; the options are now passed to graph export (also with name()).
  • nwsbmplot: titles, subtitles, axis titles and legend titles are black by default (a twoway option still overrides); title("") (or a blank title) draws no title, in every plot type; new options blocklabels(list) (names of the blocks on the axes, in the membership legend and on the block-graph nodes), actorlabels(varname) (actor names on the axes of matrix and expected and under the membership bars, up to 40 actors), linecolor() (block lines of matrix and expected, gray gs8 by default instead of red), nolegend (icl, membership); the matrix and expected plots have the default axis titles "block of sender" / "block of receiver" ("block of mode 1" / "block of mode 2"). Tests in cscripts/test_nwsbm_plots.do. The Mata library has the new helper SbmActLab (rebuilt with Stata 17).
  • Fixes: nwsbmplot, type(icl): the legend is drawn with a wider margin (two rows below the plot, or at the right for two-mode fits) so that no label runs over the frame of the legend box (checked in test_nwsbm_plots).
  • Fixes: nwsbmplot, type(matrix) shade drew thin strips instead of shaded block rectangles (every rectangle is now drawn with its own width); the two-mode estat icl header reads "Blocks" (the rows are labelled "Q1 x Q2"); the help file now says that the rows of the two-mode matrix plot are the actors of mode 1 and the columns those of mode 2 (as drawn). Tests in cscripts/test_nwsbm_plots.do.
  • First stable release: the syntax, the stored results and the options are kept from here on within 1.x.
  • nwsbmplot new plot types: type(icl) (ICL against the number of blocks, the selected number marked; with icl(exact) the exact ICL plus the blockmodels ICL on a second axis; two-mode: one line per number of blocks of mode 2), type(expected) (posterior expected tie values T1 pi T2' by block, eight grey levels), type(membership) (stacked bars of the membership probabilities, ordered by block and certainty; two-mode: one panel per mode); aliases type(data) = matrix and type(meso) = blocks as in R sbm.
  • nwsbmplot new options: sort (actors within a block by decreasing certainty, matrix and expected), colors() (block colours: default, gray or a list of colours), export() (graph export by extension). Directed block graphs: arrowheads now end at the rim of the nodes and the two directions of a pair run side by side.
  • Dialog nwsbmplot.dlg has the new plots and options. New test cscripts/test_nwsbm_plots.do.
  • Mata library rebuilt (new helpers sbm_perm, sbm_axes, SbmPlotExpected, SbmPlotMember; SbmPlotMatrix has a sort argument): after merging with other branches that change the library, rebuild it with Stata 17.
  • estat icl stars the cell the fit selected (e(Q), e(Q2)). It used to find the largest ICL itself through a rounded macro value, so with exactly tied cells (common with icl(exact), where a fit with empty blocks has the partition of a fit with fewer blocks; e.g. the degree-corrected model on the Southern women with maxblocks(4 4)) it could star a different cell (4 x 1) than the fit's own table (1 x 1). The tie rule is now one documented rule: cells within 1e-9 of the largest ICL tie and the first row of the table wins (smaller Q, for two-mode networks the smaller Q1 and then the smaller Q2). Fit results are unchanged.
  • Test cscripts/test_nwsbm_icltie.do (data dev/ref/davis_matrix.csv).

nwsbm 0.4.0

Choose a tag to compare

@thomas-u-grund thomas-u-grund released this 20 Nov 06:26

Degree-corrected two-mode model, standard errors of covariate coefficients, faster Bernoulli covariate model, greedy exact-ICL search, blockvar, orderblocks. Tested on macOS (Stata 17, 18), Linux (StataNow 19.5) and Windows 11 (StataNow 19.5). See CHANGELOG.md.

nwsbm 0.3.0

Choose a tag to compare

@thomas-u-grund thomas-u-grund released this 19 Nov 21:59

First release of nwsbm: stochastic block models for networks in Stata (variational EM, ICL), with a native plugin for macOS, Linux and Windows. See CHANGELOG.md.