-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improving the efficiency of the Gaussian and (Gaussian) copula methods #366
Improving the efficiency of the Gaussian and (Gaussian) copula methods #366
Conversation
Currently, I have just added an extra file where I have written six versions of the Gaussian method. We need to decide which one to use and replace the
In general, we see in a small 8-dim example that the new versions are between two to four times faster than the old version. Version 3-6 are faster than 1-2. In general number 5 seems to be the fastest (in the setup I looked at). One can probably write more efficient code, too. |
Merge remote-tracking branch 'origin/master' into Lars/Improve_Gaussian # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This is great! I am most in favor v5, which I added a simplification to, using rnorm directly instead of rmvnorm. This is slightly faster. I didn't check, but I think one can then also go directly to the transpose of B so that may help even more. Feel free to try that out if you want. Otherwise, I can give it a go next week. |
I will look at it next week. I agree that using C++ will be beneficial |
…he same as the old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lars: All good except the manual update mentioned above, and the ties-issue mentioned on slack. I will approve the failing tests once that is fixed, and you have confirmed that the tests differences are due to sampling error only.
… as R code when `n_samples` tends to infinity
|
In this pull request, we improve the efficiency of the Gaussian and (Gaussian) copula methods.
The efficiency has been improved by
In this pull request, the following C++ functions replace the equivalent R functions:
prepare_data_gaussian_cpp
replaces the R functionprepare_data_gaussian
.prepare_data_copula_cpp
replaces the R functionprepare_data_copula
.inv_gaussian_transform_cpp
replaces the R functioninv_gaussian_transform
.quantile_type7_cpp
replaces the R functionquantile(..., type = 7)
.Closes #231