Repository navigation
Releases
nwsbm 1.0.2
- Fixes: the line "Lower bound J" of the header wrapped at
set linesize 80; the header ofestat iclis 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
blockmodelsandsbm,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)) andcscripts/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
- The dialog test
tools/dlg_assembly_test.pychecks the command thatnwsbmplot.dlgbuilds (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
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
nwsbmplottypes 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 carriescolor(). Test incscripts/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 tograph export(also withname()). 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 optionsblocklabels(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, graygs8by 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 incscripts/test_nwsbm_plots.do. The Mata library has the new helperSbmActLab(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 intest_nwsbm_plots). - Fixes:
nwsbmplot, type(matrix) shadedrew thin strips instead of shaded block rectangles (every rectangle is now drawn with its own width); the two-modeestat iclheader 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 incscripts/test_nwsbm_plots.do. - First stable release: the syntax, the stored results and the options are kept from here on within 1.x.
nwsbmplotnew plot types:type(icl)(ICL against the number of blocks, the selected number marked; withicl(exact)the exact ICL plus theblockmodelsICL 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); aliasestype(data)=matrixandtype(meso)=blocksas in Rsbm.nwsbmplotnew options:sort(actors within a block by decreasing certainty, matrix and expected),colors()(block colours:default,grayor 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.dlghas the new plots and options. New testcscripts/test_nwsbm_plots.do. - Mata library rebuilt (new helpers
sbm_perm,sbm_axes,SbmPlotExpected,SbmPlotMember;SbmPlotMatrixhas asortargument): after merging with other branches that change the library, rebuild it with Stata 17. estat iclstars 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 withicl(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 withmaxblocks(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(datadev/ref/davis_matrix.csv).
nwsbm 0.4.0
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
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.