conroylau / lpinfer

lpinfer: An R Package for Inference in Linear Programs
GNU General Public License v3.0
3 stars 5 forks source link

fsst does not run with "Object `sigma.return` not found" #36

Closed a-torgovitsky closed 4 years ago

a-torgovitsky commented 4 years ago

Same data as in #30

rfsst <- fsst(data = data,
              lpmodel = lpm,
              beta.tgt = .3,
              R = 10,
              solver = "gurobi",
              cores = 2,
              lambda = .5,
              progress = TRUE)

Gives

Error in fsst(data = data, lpmodel = lpm, beta.tgt = 0.3, R = 10, solver = "gurobi",  : 
  object 'sigma.return' not found
conroylau commented 4 years ago

Done! I have fixed a few places in the fsst code. The sigma.return not found problem was due to a bug in the earlier code and is now fixed. In addition, I have updated the code in calculating the correct number of columns or rows of a vector. I also moved the part of constructing the bootstrap beta.obss outside the for loop, because the function will not be able to recognize the betaobs function inside the b function otherwise (I created a new issue #41 to record this as this problem is also observed in the other testing procedures).

I am able to run the above code now and get a p-value of 0 if I set the seed as 1. I will go ahead to add a unit test for the module. Thanks!