Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change name of delta argument on mlEstimationTruncDist()? #94

Closed
wleoncio opened this issue Aug 26, 2022 · 1 comment
Closed

Change name of delta argument on mlEstimationTruncDist()? #94

wleoncio opened this issue Aug 26, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@wleoncio
Copy link
Member

According to the function documentation, the delta argument provides, "indirectly, the difference between consecutive iterations to compare with the error tolerance". In contrast, if the user calls the function with print.iter = TRUE, they will see a "delta" number. Internally, that number is actually coming from a variable called delta.L2, which is calculated as follows (see lines 95 and 101):

delta.eta.j.plus.1 <- delta * grad.E.T.inv %*% T.minus.E.T
new_eta <- eta.j + delta.eta.j.plus.1
if (any(is.nan(suppressWarnings(natural2parameters(new_eta))))) {
stop("Failed to converge. Try a smaller delta")
}
eta.j <- new_eta
delta.L2 <- sum(delta.eta.j.plus.1^2)

I find this potentially confusing, since a user could set their own delta and wonder why the "delta" values in the output are completely different.

Therefore, I wonder if we should change the name of the argument (or, alternatively, the name of the output) to something more meaningful or clear.

One suggestion would be to rename the argument to delta.step.size, which is much more descriptive (though I don't really like how long that name is).

@wleoncio wleoncio added the enhancement New feature or request label Aug 26, 2022
@wleoncio wleoncio added this to the MVP 1.2.0 milestone Apr 13, 2023
@wleoncio
Copy link
Member Author

wleoncio commented Nov 14, 2023

Solution:

  • Replace "delta" only on printed output label to "delta.L2"
  • Explain delta.L2 in function documentation (@note, maybe) as "sum of squares of delta.eta.j"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants