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

Some improvements of the logLik method #4

Merged
merged 3 commits into from
Dec 28, 2020

Conversation

jranke
Copy link
Contributor

@jranke jranke commented Nov 8, 2020

As this is an implementation of the logLik method of base R, and the
base method does not print anything except by the print method of its
return value of class 'logLik', I think this method should also not do any
printing on its own. Therefore this commit removes the corresponding
code.

Also, it is unconventional that the logLik method modifies its argument
in-place if the requested value is not present. Therefore, this commit
adds an option to turn this off. The commented out code after the
comment "OR: .." was used to provide the alternative, which is giving a
message and does not return anything.

In the seealso section, links to the functions that can be used to
add these missing likelihoods were added. In roxygen comments,
simple brackets can be used to specify those links which is much
more readable than \code{\link{xy}}.

Also, match.arg() is used for the 'method' argument for easy argument
matching and validation.

As this is an implementation of the logLik method of base R, and the
base method does not print anything except by the print method of its
return value of class 'logLik', I think this method should also not do
printing on its own. Therefore this commit removes the corresponding
code.

Also, it is unconventional that the logLik method modifies its argument
in-place if the requested value is not present. Therefore, this commit
adds an option to turn this off. The commented out code after the
comment "OR: .." was used to provide the alternative, which is giving a
message and not returning anything.

In the seealso section, links to the functions that can be used to
add these missing likelihoods were added.
As per e-mail discussion of today. Please review. Not tested.
@jranke
Copy link
Contributor Author

jranke commented Dec 1, 2020

Any comments on this PR? I added some simple tests, and also a test setup script creating a basic SaemixObject that can also be used in other tests. The setup script will automatically be run (due to its name and location) by testthat.

@jranke jranke mentioned this pull request Dec 16, 2020
@BelhalK BelhalK merged commit 40bd002 into saemixdevelopment:master Dec 28, 2020
@jranke jranke deleted the logLik branch December 28, 2020 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants