Intersection algorithm: Difference between revisions

Content deleted Content added
add reflist
m Method: Added proper list tag
Line 12:
Variables: This algorithm uses ''f'' as number of false tickers, ''endcount'' and ''midcount'' are integers. ''Lower'' and ''upper'' are values of offsets.
 
0)# <li value="0">[initialize best f] Start with ''f''=0, assuming all input intervals are valid. Each time no interval is found f will be incremented until either an interval is found or ''f''&nbsp;&ge;&nbsp;''M''/2.</li>
1)# [initialize] ''endcount''=0 and ''midcount''=0.
 
4)# [determinefind number oflower midpointsendpoint] Start fromat endbeginning of the list and(lowest workoffset) towardsconsider lowereach tuple in offsetsorder. ''endcount''&nbsp;=&nbsp;''endcount''+&minus;''type''. If ''endcount''&nbsp;&ge;&nbsp;''M''&minus;''f'' then ''upperlower''&nbsp;=&nbsp;''offset'', and goto step 53 because the (possible) lower endpoint has been found. If the ''type''&nbsp;=&nbsp;0 then ''midcount''&nbsp;=&nbsp;''midcount''+1. Repeat forwith next tuple. If reach end of list then goto step 6.
1) [initialize] ''endcount''=0 and ''midcount''=0.
3)# [tentative lower endpoint found, initialize to find upper endpoint] set ''endcount''=0.
 
2)# [finddetermine lowernumber endpointof midpoints] Start atfrom beginningend of the list (lowestand offset)work considertowards each tuple inlower orderoffsets. ''endcount''&nbsp;=&nbsp;''endcount''&minus;+''type''. If ''endcount''&nbsp;&ge;&nbsp;''M''&minus;''f'' then ''lowerupper''&nbsp;=&nbsp;''offset'' and, goto step 3 because the (possible) lower endpoint has been found5. If the ''type''&nbsp;=&nbsp;0 then ''midcount''&nbsp;=&nbsp;''midcount''+1. Repeat withfor next tuple. If reach end of list then goto step 6.
5)# if ''lower''&nbsp;&le;&nbsp;''upper'' and ''midcount''&nbsp;&le;&nbsp;''f'' then return interval [''lowerendpoint'',''upperendpoint''] as resulting confidence interval.
 
6) #[increment number of falsetickers] ''f''&nbsp;=&nbsp;''f''+1. If ''f''&nbsp;&ge;&nbsp;''M''/2 then terminate and return FAILED, otherwise goto step 1.
3) [tentative lower endpoint found, initialize to find upper endpoint] set ''endcount''=0.
 
4) [determine number of midpoints] Start from end of list and work towards lower offsets. ''endcount''&nbsp;=&nbsp;''endcount''+''type''. If ''endcount''&nbsp;&ge;&nbsp;''M''&minus;''f'' then ''upper''&nbsp;=&nbsp;''offset'', goto step 5. If ''type''&nbsp;=&nbsp;0 then ''midcount''&nbsp;=&nbsp;''midcount''+1. Repeat for next tuple. If reach end of list then goto step 6.
 
5) if ''lower''&nbsp;&le;&nbsp;''upper'' and ''midcount''&nbsp;&le;&nbsp;''f'' then return interval [''lowerendpoint'',''upperendpoint''] as resulting confidence interval.
 
6) [increment number of falsetickers] ''f''&nbsp;=&nbsp;''f''+1. If ''f''&nbsp;&ge;&nbsp;''M''/2 then terminate and return FAILED, otherwise goto step 1.
 
==References ==