Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 6ac7ac6

Browse files
authored
update constraints array doc
1 parent bcf8533 commit 6ac7ac6

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

diffxpy/fit/fit.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ def model(
8080
:param constraints_loc: Constraints for location model. Can be one of the following:
8181
8282
- np.ndarray:
83-
Array with constraints in rows and model parameters in columns.
84-
Each constraint contains non-zero entries for the a of parameters that
85-
has to sum to zero. This constraint is enforced by binding one parameter
83+
Array with constraints in columns and model parameters in rows.
84+
Each constraint contains non-zero entries for the constrained parameters that
85+
have to sum to zero. For a non-constrained parameter the revelant constraint column
86+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
8687
to the negative sum of the other parameters, effectively representing that
8788
parameter as a function of the other parameters. This dependent
8889
parameter is indicated by a -1 in this array, the independent parameters
@@ -113,9 +114,10 @@ def model(
113114
:param constraints_scale: Constraints for scale model. Can be one of the following:
114115
115116
- np.ndarray:
116-
Array with constraints in rows and model parameters in columns.
117-
Each constraint contains non-zero entries for the a of parameters that
118-
has to sum to zero. This constraint is enforced by binding one parameter
117+
Array with constraints in columns and model parameters in rows.
118+
Each constraint contains non-zero entries for the constrained parameters that
119+
have to sum to zero. For a non-constrained parameter the revelant constraint column
120+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
119121
to the negative sum of the other parameters, effectively representing that
120122
parameter as a function of the other parameters. This dependent
121123
parameter is indicated by a -1 in this array, the independent parameters
@@ -289,9 +291,10 @@ def residuals(
289291
:param constraints_loc: Constraints for location model. Can be one of the following:
290292
291293
- np.ndarray:
292-
Array with constraints in rows and model parameters in columns.
293-
Each constraint contains non-zero entries for the a of parameters that
294-
has to sum to zero. This constraint is enforced by binding one parameter
294+
Array with constraints in columns and model parameters in rows.
295+
Each constraint contains non-zero entries for the constrained parameters that
296+
have to sum to zero. For a non-constrained parameter the revelant constraint column
297+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
295298
to the negative sum of the other parameters, effectively representing that
296299
parameter as a function of the other parameters. This dependent
297300
parameter is indicated by a -1 in this array, the independent parameters
@@ -322,9 +325,10 @@ def residuals(
322325
:param constraints_scale: Constraints for scale model. Can be one of the following:
323326
324327
- np.ndarray:
325-
Array with constraints in rows and model parameters in columns.
326-
Each constraint contains non-zero entries for the a of parameters that
327-
has to sum to zero. This constraint is enforced by binding one parameter
328+
Array with constraints in columns and model parameters in rows.
329+
Each constraint contains non-zero entries for the constrained parameters that
330+
have to sum to zero. For a non-constrained parameter the revelant constraint column
331+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
328332
to the negative sum of the other parameters, effectively representing that
329333
parameter as a function of the other parameters. This dependent
330334
parameter is indicated by a -1 in this array, the independent parameters
@@ -548,9 +552,10 @@ def model(
548552
:param constraints_loc: Constraints for location model. Can be one of the following:
549553
550554
- np.ndarray:
551-
Array with constraints in rows and model parameters in columns.
552-
Each constraint contains non-zero entries for the a of parameters that
553-
has to sum to zero. This constraint is enforced by binding one parameter
555+
Array with constraints in columns and model parameters in rows.
556+
Each constraint contains non-zero entries for the constrained parameters that
557+
have to sum to zero. For a non-constrained parameter the revelant constraint column
558+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
554559
to the negative sum of the other parameters, effectively representing that
555560
parameter as a function of the other parameters. This dependent
556561
parameter is indicated by a -1 in this array, the independent parameters
@@ -581,9 +586,10 @@ def model(
581586
:param constraints_scale: Constraints for scale model. Can be one of the following:
582587
583588
- np.ndarray:
584-
Array with constraints in rows and model parameters in columns.
585-
Each constraint contains non-zero entries for the a of parameters that
586-
has to sum to zero. This constraint is enforced by binding one parameter
589+
Array with constraints in columns and model parameters in rows.
590+
Each constraint contains non-zero entries for the constrained parameters that
591+
have to sum to zero. For a non-constrained parameter the revelant constraint column
592+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
587593
to the negative sum of the other parameters, effectively representing that
588594
parameter as a function of the other parameters. This dependent
589595
parameter is indicated by a -1 in this array, the independent parameters
@@ -705,9 +711,10 @@ def residuals(
705711
:param constraints_loc: Constraints for location model. Can be one of the following:
706712
707713
- np.ndarray:
708-
Array with constraints in rows and model parameters in columns.
709-
Each constraint contains non-zero entries for the a of parameters that
710-
has to sum to zero. This constraint is enforced by binding one parameter
714+
Array with constraints in columns and model parameters in rows.
715+
Each constraint contains non-zero entries for the constrained parameters that
716+
have to sum to zero. For a non-constrained parameter the revelant constraint column
717+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
711718
to the negative sum of the other parameters, effectively representing that
712719
parameter as a function of the other parameters. This dependent
713720
parameter is indicated by a -1 in this array, the independent parameters
@@ -738,9 +745,10 @@ def residuals(
738745
:param constraints_scale: Constraints for scale model. Can be one of the following:
739746
740747
- np.ndarray:
741-
Array with constraints in rows and model parameters in columns.
742-
Each constraint contains non-zero entries for the a of parameters that
743-
has to sum to zero. This constraint is enforced by binding one parameter
748+
Array with constraints in columns and model parameters in rows.
749+
Each constraint contains non-zero entries for the constrained parameters that
750+
have to sum to zero. For a non-constrained parameter the revelant constraint column
751+
contains 1 in the parameter row. This constraint is enforced by binding one parameter
744752
to the negative sum of the other parameters, effectively representing that
745753
parameter as a function of the other parameters. This dependent
746754
parameter is indicated by a -1 in this array, the independent parameters

0 commit comments

Comments
 (0)