Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
rci rci is offline
external usenet poster
 
Posts: 40
Default A math/algorithm puzzle!

Hi all...

Using VB in a appplication that needs to solve a bit of a math/algorithm
problem, and thought the good people here would have interesting ideas on
how to solve it...

Without going into too much detail, basically the code must find/suggest the
best pairs of numbers from a single list, and be able to exclude "outliers".

Pairing would be the best pairings possible by closest value.

Example:

data:
25
22
31
24
25
22
28
18
23

I would want to be able to adjust the sensitivity of the code to start to
trim outliers from the data, like "18" would seem to be the biggest
troublemaker in creating similar pairs... resulting in a list like this:


31 28
25 25
24 23
22 22
excluded: 18


The largest delta is three in this case... but you can see how the
logic/sorting might become complex, especially when the list of data becomes
much larger.

Thoughts?

Thx,

SMS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A math/algorithm puzzle!


Why not just have VBA sort your data and then compare the differenc
between teh first and second numbers with the difference between th
last and second to last numbers in your list? This would identify you
greatest outlier and it could be handled accordingly

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=38069

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default A math/algorithm puzzle!

rci

At first glance...

Why not work out the mean and standard deviation of your numbers and say...

a) exclude any number greater or less than 3 s.d.'s (as outliers)
b) try pairing numbers by their distance above and below the mean e.g check
for numbers within +/- 0.5 sd of mean and pair them, then look at numbers +/-
0.51 to 1sd from mean, then 1.01 to 1.5sd etc.

Just a preliminary thought...

Alex

"rci" wrote:

Hi all...

Using VB in a appplication that needs to solve a bit of a math/algorithm
problem, and thought the good people here would have interesting ideas on
how to solve it...

Without going into too much detail, basically the code must find/suggest the
best pairs of numbers from a single list, and be able to exclude "outliers".

Pairing would be the best pairings possible by closest value.

Example:

data:
25
22
31
24
25
22
28
18
23

I would want to be able to adjust the sensitivity of the code to start to
trim outliers from the data, like "18" would seem to be the biggest
troublemaker in creating similar pairs... resulting in a list like this:


31 28
25 25
24 23
22 22
excluded: 18


The largest delta is three in this case... but you can see how the
logic/sorting might become complex, especially when the list of data becomes
much larger.

Thoughts?

Thx,

SMS

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default A math/algorithm puzzle!

Another suggestion:

FIrst sort the numbers. This will put close numbers next to each other.
Then calculate the differences, for example A1 to A2, A2 to A3, etc. and
select the smallest differences for the pairs. Outliers would have large
differences from both their neighbors.
--
Gary's Student


"Alex" wrote:

rci

At first glance...

Why not work out the mean and standard deviation of your numbers and say...

a) exclude any number greater or less than 3 s.d.'s (as outliers)
b) try pairing numbers by their distance above and below the mean e.g check
for numbers within +/- 0.5 sd of mean and pair them, then look at numbers +/-
0.51 to 1sd from mean, then 1.01 to 1.5sd etc.

Just a preliminary thought...

Alex

"rci" wrote:

Hi all...

Using VB in a appplication that needs to solve a bit of a math/algorithm
problem, and thought the good people here would have interesting ideas on
how to solve it...

Without going into too much detail, basically the code must find/suggest the
best pairs of numbers from a single list, and be able to exclude "outliers".

Pairing would be the best pairings possible by closest value.

Example:

data:
25
22
31
24
25
22
28
18
23

I would want to be able to adjust the sensitivity of the code to start to
trim outliers from the data, like "18" would seem to be the biggest
troublemaker in creating similar pairs... resulting in a list like this:


31 28
25 25
24 23
22 22
excluded: 18


The largest delta is three in this case... but you can see how the
logic/sorting might become complex, especially when the list of data becomes
much larger.

Thoughts?

Thx,

SMS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Algorithm Challenge Lowkey Excel Worksheet Functions 4 July 20th 05 06:40 PM
Can you help!!!!! New Puzzle Krefty Excel Discussion (Misc queries) 0 June 13th 05 08:13 PM
algorithm creation Gixxer_J_97[_2_] Excel Programming 11 February 11th 05 04:24 PM
help with algorithm dreamer[_3_] Excel Programming 6 January 9th 04 02:14 PM
Need help with algorithm RADO[_3_] Excel Programming 1 November 4th 03 12:37 PM


All times are GMT +1. The time now is 08:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"