This PR introduces an enhancement to the _simulate_linear_sem() function in the simulator.py file. The changes now allow the function to accept both a single string or a list of strings for the sem_type parameter, providing users with the flexibility to define different SEM types for each variable in the model.
Notably, these changes are backward compatible. Users who wish to continue using a single string for sem_type can do so without any disruption. The single string will still be interpreted as the SEM type for all variables, as in the previous version.
Changes made in this PR include:
Updated the sem_type parameter handling in the _simulate_linear_sem() function to allow for a list of SEM types as well as a single string.
Enhanced the _simulate_single_equation() method to generate variable noise according to the specified sem_type_single.
Updated the docstrings for both _simulate_linear_sem() and _simulate_single_equation() to reflect these changes.
Added robust error checking to ensure that the sem_type parameter is correctly formatted, either as a string or a list of strings of appropriate length.
These updates have been thoroughly tested to ensure correct and expected behavior.
This PR introduces an enhancement to the
_simulate_linear_sem()
function in the simulator.py file. The changes now allow the function to accept both a single string or a list of strings for thesem_type
parameter, providing users with the flexibility to define different SEM types for each variable in the model.Notably, these changes are backward compatible. Users who wish to continue using a single string for
sem_type
can do so without any disruption. The single string will still be interpreted as the SEM type for all variables, as in the previous version.Changes made in this PR include:
sem_type
parameter handling in the_simulate_linear_sem()
function to allow for a list of SEM types as well as a single string._simulate_single_equation()
method to generate variable noise according to the specifiedsem_type_single
._simulate_linear_sem()
and_simulate_single_equation()
to reflect these changes.sem_type
parameter is correctly formatted, either as a string or a list of strings of appropriate length.These updates have been thoroughly tested to ensure correct and expected behavior.