semopy stands for Structural Equation Models Optimization in Python and is designed to help statisticians that employ SEM techniques to handle their research in a more Pythonic way. We want to fill a niche of SEM tools in Python that is seemed to be empty as we found ourselves and several other researchers to be unsatisfied using either commercial software or dealing with older computer languages.
semopy package provided completely free of charge and everyone is welcome to make contributions to the project. The developers of semopy promise to keep their eye open for bugs and to consider implementing new features on request.
The package was published in "Structural Equation Modeling: A Multidisciplinary Journal" where we showed that semopy outperforms the popular free package lavaan in terms of both performance, optimization process stability and parameter estimates accuracy. Since then, semopy has faced drastic positive changes and has grown new features, therefore a reader can interpret results presented in the article as an expected minimum. As of today, the actual state of semopy 2+ is best explained in a new article, currently available as a preprint.
To give reader a quick example of what kind of SEM models semopy can handle, consider the following model:
# structural part eta3 ~ x1 + x2 eta4 ~ x3 x3 ~ eta1 + eta2 + x1 + x4 x4 ~ eta4 x5 ~ x4 # measurement part eta1 =~ y1 + y2 + y3 eta2 =~ y3 eta3 =~ y4 + y5 eta4 =~ y4 + y6 # additional covariances eta2 ~~ x2 y5 ~~ y6
For a quickstart, see the Tutorial section.
Although the package has found a dozen users worldwide previously, its development and usage have been mostly restricted to the internal affairs of developers' laboratory. The package was a mess with certain design decisions that could appear as bugs to an unprepared user. Furthermore, at one point it became increasingly difficult to implement new features as the semopy 1.0+ structure was not designed really well. In July 2020, the package has been rewritten from scratch, and following the Semantic Versioning paradigm semopy versions will henceforth start with a digit "2".
semopy development was supported by RFBR Grant No. 18-29-13033. Authors are grateful to the staff of the Mathematical Biology & Bionformatics Laboratory at Peter the Great St. Petersburg Polytechnic University.