Skip to content

A bug in GloWassReg function  #10

@dingyizhe2000

Description

@dingyizhe2000

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions