'diammatrix' computes the diameters of certain graphs related to convergence
speed of felm
.
diammatrix(flist, approx = TRUE)
A matrix of dimension K x K where K is length(flist)
.
a list of factors defining the dummies.
logical. Approximate diameters are computed.
Each pair of factors (f1,f2) from flist
defines a bipartite graph in
which the vertices are the levels of the factors, and two vertices are
adjacent if they are observed simultaneously. The connected components of
this graph are important for identification of the coefficients for the
factor levels, i.e. for getfe
. But experience and some trials have
led the author to speculate that the diameter of the graph (or its largest
component) is also important for the convergence rate. Specifically, the
author suspects that under some assumptions, time to convergence goes like
the square of the diameter. At least in the case of two factors. This
function computes the diameter for each pair of factors. If the graph is
disconnected, the largest connected component is used. If accel=TRUE
(the default), the diameter is approximated from below by drawing two sets
of 10 random vertices and finding the maximum length of the shortest paths
between them.