Skip to content

Commit

Permalink
not working as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Jan 3, 2024
1 parent 9745b29 commit a975e8c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Data_science/Mathematica/Math/DataFittings/GaussNewtonSolver.vb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Public Class GaussNewtonSolver
Dim temp_rmse As Double
Dim success As Boolean = False
Dim truncate As Double = 100
Dim truncate2 As Double = 5

For i As Integer = 0 To MAX_ITERATIONS - 1
Dim lJ = CalcJacobian(data, beta)
Expand All @@ -79,11 +80,11 @@ Public Class GaussNewtonSolver
beta -= bigJ * rB
End If

For offset As Integer = 0 To beta.ColumnDimension - 1
If beta(offset, 0) > truncate Then
beta(offset, 0) = truncate
ElseIf beta(offset, 0) < -truncate Then
beta(offset, 0) = -truncate
For offset As Integer = 0 To beta.RowDimension - 1
If beta(offset, 0) > truncate2 Then
beta(offset, 0) = truncate2
ElseIf beta(offset, 0) < -truncate2 Then
beta(offset, 0) = eps
End If
Next

Expand Down

0 comments on commit a975e8c

Please sign in to comment.