conroylau / lpinfer

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

estbounds shouldn't necessarily need `data` #66

Closed a-torgovitsky closed 4 years ago

a-torgovitsky commented 4 years ago

Currently, data is a required input But if the lpmodel that is passed has beta.obs as a vector, then I don't think data is used anywhere, is it?

conroylau commented 4 years ago

Yes, thats right! I have revised the code so that whenever beta.obs is a vector, or a list of a vector and a matrix (so the code will pick the vector), data will not be required in estbounds.

As an example, in the sample data posted in issue #44, the following results are the same if I specify beta.obs explicitly (where I called the lpmodel object as lpm2 in this case):

> lpm2 <- lpm
> lpm2$beta.obs <- lpm$beta.obs(data)
> estbounds(lpmodel = lpm2)
Estimated bounds: [0.13121, 0.1371] 
> 
> estbounds(data = data, lpmodel = lpm)
Estimated bounds: [0.13121, 0.1371] 

Thanks!