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

A bug in GloWassReg function #10

Open
dingyizhe2000 opened this issue Nov 7, 2022 · 1 comment
Open

A bug in GloWassReg function #10

dingyizhe2000 opened this issue Nov 7, 2022 · 1 comment

Comments

@dingyizhe2000
Copy link

Hi,

When I was trying to reproduce the experiment in section 6.3 of the paper FRECHET REGRESSION FOR RANDOM OBJECTS WITH
EUCLIDEAN PREDICTORS, using this package v0.2.0, I was unable to get the R^2, even if I have included Rsquared=TRUE in the control options. A short reproducible example is put as below, which should give Error in is.data.frame(x) : object 'qin.est' not found.

library("frechet")
xin = seq(0,1,0.05)
yin = lapply(xin, function(x) {rnorm(100, rnorm(1,x,0.005), 0.05)})
res1 <- GloDenReg(xin=xin, yin=yin, optns = list(Rsquared=TRUE))

With some attempts, it seems that the bug comes from the "if block" at line 77-80 in GloWassReg.R. When (k == n) is true, yet the condition (sum(abs(xout-xin)) > 1e-10*length(xout)) is false, qin.est shall not be assigned.

By replicating "else" operations to here, I am able to get the R-square. I hope you can fix this bug.

@hango1996
Copy link
Collaborator

Hi,

Thanks for your interest in the frechet package and providing the detailed bug information. We will fix it in our later version update.

Best,
Han

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

No branches or pull requests

2 participants