@@ -860,15 +860,10 @@ def analyze(self,
860860 # boundaries to (None, None) for everything except factor covariances;
861861 # at some point in the future, we may update this to place limits
862862 # on the loading matrix boundaries, too, but the case in R and SAS
863- if bounds is None :
864- bounds = [(None , None ) for _ in range (loading_init .size +
865- error_vars_init .shape [0 ] +
866- factor_vars_init .shape [0 ] +
867- factor_covs_init .shape [0 ])]
868-
869- error_msg = ('The length of `bounds` must equal the length of your '
863+ if bounds is not None :
864+ error_msg = ('The length of `bounds` must equal the length of your '
870865 'input array `x0`: {} != {}.' .format (len (bounds ), len (x0 )))
871- assert len (bounds ) == len (x0 ), error_msg
866+ assert len (bounds ) == len (x0 ), error_msg
872867
873868 # fit the actual model using L-BFGS algorithm;
874869 # the constraints are set inside the objective function,
@@ -896,6 +891,8 @@ def analyze(self,
896891 factor_vars_final = factor_vars if is_factor_vars_fixed else factor_vars_res
897892 factor_covs_final = merge_variance_covariance (factor_vars_final , factor_covs_final )
898893
894+ # if we aren't fixing the first variable to 1, then we need to make sure
895+ # to convert the covariance matrix into a correlation matrix
899896 if not fix_first :
900897 factor_covs_final = covariance_to_correlation (factor_covs_final )
901898
0 commit comments