Closed a-torgovitsky closed 4 years ago
The first step of estbounds
is callable, but I have written them separately for 1-norm (the function estbounds1_L1
) and 2-norm (the function estbounds1_L2
).
I will use a function mincriterion
to cover both cases and break them out of the estbounds
function.
I am thinking of using S3 style on mincriterion
so that it can present the results in a nice way via print
or summary
, just like the dkqs
or estbounds
functions etc.
May I check with you would it be enough to print the following information from the mincriterion
function?
Thank you!
The first step of
estbounds
is callable, but I have written them separately for 1-norm (the functionestbounds1_L1
) and 2-norm (the functionestbounds1_L2
).I will use a function
mincriterion
to cover both cases and break them out of theestbounds
function.
Ok, just make sure not to duplicate code for the constraints, which are going to be the same for parts of the two problems.
Having the print
function is helpful, but don't include this:
- If the minimum value of the objective function is 0, print an additional information indicating that the actual linear or quadratic program that finds the bounds is feasible and the bounds produced in the second stage of the estimation procedure will be the same as the bounds from the actual problem.
Done! I have added the function mincriterion
for the first stage estimation procedure. The constraints are not duplicated for the 1-norm and the 2-norm problem.
The following is a sample output using the print
function:
Call:
mincriterion(data = data, func_obs = func_two_moment, A_obs = A_obs_twom,
A_tgt = A_tgt, A_shp_eq = A_shp_eq_dkqs, A_shp_ineq = A_shp_ineq_dkqs,
beta_shp_eq = beta_shp_eq_dkqs, beta_shp_ineq = beta_shp_ineq_dkqs,
norm = 2, solver = "gurobi")
< Results from the first stage estimation procedure >
Minimum value: 0
Norm used: L2-norm
Solver used: gurobi
May I know would this be okay? In addition, should I make the summary
function as a wrapper for the print
function as before too?
Thank you!
For now it's fine if they are the same. Later we may want to add information.
print
should look like this:
Minimum value: 0
Norm: 2
Solver: gurobi
Done! I have revised the print
message in the above format and made summary
to be the wrapper of print
for now. Thanks!
Call it
mincriterion
Remember not to duplicate code when breaking this out Edit: now --> not