Fix warning in .rhoPrior and trMVNmatrixRcpp - #2
Open
philipptandler wants to merge 4 commits into
Open
Conversation
|
Hi, this is a read only mirror of CRAN, please see the package authors in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During the execution of gjam() in my project, I had two warning that were displayed repeatedly:
In
gjamHfunctions.Rin the.rhoPriorfunction a matrix is initialised. The there is an error if the data (rep(1:M, M*S)) is of unequal length as the number of elements in the matrix (nrow =S*M, ncol =S). To match the length of data with the number of elements, data must berep(1:M, S*S)to getS*M*Selements in the matrix.In
cppFns.cppin thetrMVNmatrixRcppfunction, thesmatmatrix is inverted. In case the xdata used in the input is not normalized, especially if the mean is >> 0, the elements in thesmatmatrix can be very high and low, yielding numerical imprecisions and the functionarma::inv_sympd()returns a warning: given matrix is not symmetric. This can be resolved through either forcing it symmetric or make sure the xdata provided is (roughly) normalized. For the first issue, I force it twice, such that first high and low values are roughly equal (L118) and exactly equal in floating point precision (L119). For the latter option, I would recommend add a step where the.gjamensures the xdata is normalized and add this to the description in the package.