Changeset 3036


Ignore:
Timestamp:
Sep 21, 2010 3:56:22 PM (11 years ago)
Author:
jwatson
Message:

Forgot to add gbar (the base offset) to the confidence interval width computation!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/scripts/computeconf

    r3035 r3036  
    270270      xstar_obj = float(ef_results.solution(0).objective['f'].value)  ## DLW to JPW: we need the gap too, and to add/subtract is as necessary.
    271271      xstar_obj_gap = ef_results.solution(0).gap # assuming this is the absolute gap
    272       xstar_obj_bound = xstar_obj - xstar_obj_gap # HERE - watch for signs on gap - is it absolute, or can it be negative?     
     272      print "xstar_obj_gap=",xstar_obj_gap
     273      xstar_obj_bound = xstar_obj - xstar_obj_gap
    273274      print "Extensive form objective value given xstar="+str(xstar_obj)+"; gap="+str(xstar_obj_gap)+"."
     275      # TBD: ADD VERBOSE OUTPUT HERE
    274276
    275277      # to get f(xhat) for this sample, fix the first-stage variables and re-solve the extensive form.
     
    310312      t_table_entries = t_table_values[n_g]
    311313      for key in sorted(t_table_entries.keys()):
    312          print "Confidence interval width for alpha="+str(key)+" is "+str(t_table_entries[key] * math.sqrt(g_var) / math.sqrt(n_g))
     314         print "Confidence interval width for alpha="+str(key)+" is "+str(g_bar + (t_table_entries[key] * math.sqrt(g_var) / math.sqrt(n_g)))
    313315   else:
    314316      print "No built-in t-table entries for "+str(n_g)+" degrees of freedom - cannot calculate confidence interval width"
     
    332334         t_table_entries = t_table_values[n_g]
    333335         for key in sorted(t_table_entries.keys()):
    334             print >>output_file, " , alpha="+str(key)+" , "+str(t_table_entries[key] * math.sqrt(g_var) / math.sqrt(n_g)),
     336            print >>output_file, " , alpha="+str(key)+" , "+str(g_bar + (t_table_entries[key] * math.sqrt(g_var) / math.sqrt(n_g))),
    335337
    336338      if options.write_xhat_solution is True:
     
    413415      else:
    414416         ef_solver.mipgap = options.ef_mipgap
     417   if options.keep_solver_files is True:
     418      ef_solver.keepFiles = True                   
    415419
    416420   ef_solver_manager = SolverManagerFactory(options.solver_manager_type)
Note: See TracChangeset for help on using the changeset viewer.