updated new functions and tests#7
Conversation
AlexisDerumigny
left a comment
There was a problem hiding this comment.
Thanks for the pull request, very nice! I have a few comments that I put in as well.
Could you do the changes, and before this, could you also merge the current main branch in your branch so as to avoid the current merge conflict? Then you can update this PR.
If this is not clear, please feel free to let me know
| * New functions: | ||
|
|
||
| - `CondMeanEst`: nonparametric estimation of the conditional mean. | ||
| (#2, thanks to Rutger van der Spek) |
| ^ (d/2) ) ^ (2/d) ) | ||
| if (dopb){ pbapply::setpb(pb, i) } | ||
| for (i in 1:n) { | ||
| x_quad = Rmpfr::mpfr(as.numeric((X[i,] - mu) %*% Sigma_m1 %*% (X[i,] - mu)), |
There was a problem hiding this comment.
Here I think you can just write
x_quad = Rmpfr::mpfr( (X[i,] - mu) %*% Sigma_m1 %*% (X[i,] - mu),
so without the as.numeric
| gridZ = seq(0, 1, length.out = 4) | ||
| h = 0.5 | ||
|
|
||
| est = CondCovEst(X, Z, gridZ, h) |
There was a problem hiding this comment.
Could you update this test with the three different types of estimators?
| expect_equal(dim(gEst), c(length(grid), length(gridZ))) | ||
| }) | ||
|
|
||
| test_that("CondEllGenEst produces finite, non-negative values for simple Gaussian data", { |
There was a problem hiding this comment.
Could you add a test that the mpfr version gives similar results in this simple case?
|
|
||
| mu = rbind(gridZ, gridZ) | ||
| sigma = array(0, dim = c(2,2,2)) | ||
| sigma[,,] = diag(2) |
There was a problem hiding this comment.
Could you also add one more test where the covariance matrix is not the identity? Just to test whether this work also (this is also linked with the standardization of the generator that we discussed, in relation with commit fae2f25 )
|
Hi Alexis,
I updated the test files as described, but didn't change the x_quad line.
The as.numeric is needed because mpfr cannot directly handle a 1x1 matrix
in recent R versions. Converting to numeric ensures a scalar is passed,
preventing warnings when running all tests.
When trying to create a pull request, I'm failing the Github checks.The
first failure isn't clear to me, and the second seems odd since I added
rmpfr, and dopb in the documentation of CondEllGenEst, similar to
EllDistrEst. Do you have any advice on how to fix these issues?
Best,
Rutger
|
|
Hi Rutger, Thanks for the update. The GitHub checks are done on several machines and OS. I see that the macOS check fails with the error Both the Windows and Linux checks fails because of a warning: I have seen that you have added the documentation for these arguments in the R file using the template, which is good. But they are not in the corresponding Best, |
No description provided.