You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solves the algebraic system, given an initial guess, using Newton's method.
64
66
{{< since 2.31 >}}
65
67
68
+
<!-- vector; solve_newton_tol; (function algebra_system, vector y_guess, data real scaling_step, data real f_tol, int max_steps, ...); -->
69
+
\index{{\tt \bfseries solve\_newton\_tol }!{\tt (function algebra\_system, vector y\_guess, data real scaling\_step, data real f\_tol, int max\_steps, ...): vector}|hyperpage}
66
70
`vector`**`solve_newton_tol`**`(function algebra_system, vector y_guess, data real scaling_step, data real f_tol, int max_steps, ...)`<br>\newline
67
71
Solves the algebraic system, given an initial guess, using Newton's method with additional control parameters for the solver.
Solves the algebraic system, given an initial guess, using Powell's hybrid method.
72
78
{{< since 2.31 >}}
73
79
80
+
<!-- vector; solve_powell_tol; (function algebra_system, vector y_guess, data real rel_tol, data real f_tol, int max_steps, ...); -->
81
+
\index{{\tt \bfseries solve\powell\_tol }!{\tt (function algebra\_system, vector y\_guess, data real rel\_tol, data real f\_tol, int max\_steps, ...): vector}|hyperpage}
74
82
`vector`**`solve_powell_tol`**`(function algebra_system, vector y_guess, data real rel_tol, data real f_tol, int max_steps, ...)`<br>\newline
75
83
Solves the algebraic system, given an initial guess, using Powell's hybrid method with additional control parameters for the solver.
Copy file name to clipboardExpand all lines: src/stan-users-guide/algebraic-equations.qmd
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -142,17 +142,17 @@ do so, the current Metropolis proposal gets rejected.
142
142
## Control parameters for the algebraic solver {#algebra-control.section}
143
143
144
144
The call to the algebraic solver shown previously uses the default control settings. The `_tol` variant of the solver function
145
-
allows three additional parameters, all of which must be supplied.
145
+
allows three additional parameters, all of which must be supplied before the variadic arguments.
146
146
147
147
```stan
148
-
y = solve_newton_tol(system, y_guess, theta, x_r, x_i,
149
-
scaling_step, f_tol, max_steps);
148
+
y = solve_newton_tol(system, y_guess, scaling_step, f_tol, max_steps,
149
+
theta, x_r, x_i);
150
150
```
151
151
152
152
For the Newton solver the three control arguments are scaling step, function tolerance, and maximum number of steps. For the Powell's hybrid method the three control arguments are relative tolerance, function tolerance, and maximum number of steps. If a Newton step is smaller than the scaling step tolerance, the code breaks, assuming the solver is no longer making significant progress. If set to 0, this constraint is ignored. For Powell's hybrid method the relative tolerance is the estimated relative error of the solver and serves to test if a satisfactory solution has been found. After convergence of the either solver, the proposed solution
153
153
is plugged into the algebraic system and its norm is compared to the function tolerance. If the norm is below the function tolerance, the solution is deemed acceptable. If the solver solver reaches the maximum number of steps, it stops and returns an error message. If one of the criteria is not met, the
154
154
Metropolis proposal gets rejected with a warning message explaining which criterion
155
-
was not satisfied.
155
+
was not satisfied.
156
156
157
157
158
158
The default values for the control arguments are respectively
0 commit comments