Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Math problem - Gaussian curves

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-18 : 14:00:16
I've got data representing counts versus time. Starting at T=0, the counts rise very gradually. There's a no clear peak, and the curve drops to zero in a few hours. The data is asymmetric and doesn't look vaguely gaussian.

Gaussian curves are described by: Average and Standard Deviation, but are aggregate functions in SQL.

Is there a better representation of a curve that has a zero point, peak and a long tail?

Sam

Time Count
0 188
5 980
10 1045
15 851
20 692
25 620
30 538
35 518
40 469
45 407
50 376
55 387
60 310
65 281
70 244
75 217
80 192
85 166
90 153
95 138
100 107
105 87
110 103
115 77
120 63
125 50
130 43
135 49
140 40
145 33
150 27
155 26
160 21
165 18
170 16
175 9
180 10
185 6
190 8
195 9
200 2
205 6
210 4
215 3
220 5
225 1
230 5
235 1
240 3
245 3
250 3
255 3
260 2
265 1
270 1
275 2
280 2
290 1
300 1
310 1
355 1

X002548
Not Just a Number

15586 Posts

Posted - 2004-03-18 : 14:34:14
OK, I gotta ask...what he h_ll are you working on?

Spaceflight?





Brett

8-)

EDIT: http://www.duke.edu/~loeb/spring.2000/lab5.html

Still looking....

Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-18 : 14:51:42
Brett,

The numbers represent an event in nature which I cannot disclose.

Did you listen to Groove Salad?
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2004-03-18 : 14:56:09
Looks like LogNormal to me.
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-18 : 15:00:53
A man of few words, but to the point.

Off too Google..

Looks Lognormal to me (too).

So it turns out that Mean and Standard Deviation do apply (to Lognormal curves).

But the additional information to describe the shape is the Skewness and the Kurtosis.

Learning somethin new every day.

Thanks Arnold.

Sam
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-18 : 16:07:11
As your links refer to risk glossary, just out of professional curiosity may I ask what you are working on? Some kind of financial risk management package?


--Frank
http://www.insidesql.de
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-18 : 16:17:15
Nothing financial about the numbers at all. I'm reserved about going into detail about what the numbers actually represent, but I will say the numbers represent "usage". I was looking for a way to characterize the curve verbally (mean, Std Dev, etc.) without using a graphic or visual aids.

Of course, a stored procedure will calculate the curve parameters.

I think I have found what I was after.

Sam
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-18 : 16:26:17
Actually I was not interested in the number you provided.
Just because the terms you've used are quite familiar to my daily work, although I really guess no one outside the ivory tower cares in his investment decisions for such abstract constructions.
But if you are working on a formula that will exactly predict where some stock index will end this year, I'll organize the money, you the formula and we meet on the Cayman's.

OK?



--Frank
http://www.insidesql.de
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-18 : 16:38:37
I'm there good buddy. Margaritas and palm trees. All we need is an *exact* predictor. Should be easy.
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-18 : 16:45:58
Ok, I can liquidate some 1 billion Euro quite easily. That's enough for drinks and aspirine.

--Frank
http://www.insidesql.de
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-19 : 01:52:57
Just for completeness.
Here is some fine TSQL code for skewness and curtosis from SQL Server MVP Steve Kass.

select sum((qty-mean)*square(qty-mean)
/(N*sigma*square(sigma))) as skew,
sum(square(square(qty-mean))
/(N*square(square(sigma))))-3 as ExcessKurtosis
from pubs..sales,
(
select
avg(qty) as mean,
stdev(qty) as sigma,
count(qty) as N
from pubs..sales
) S

skew ExcessKurtosis
----------------------------------------------------- -----------------------------------------------------
1.5653251929405994 2.4599827492380095

(1 row(s) affected)


The original code along with some other very interesting stuff you'll find here
http://www.users.drew.edu/skass/sql/SkewKurtosis.sql.txt


--Frank
http://www.insidesql.de
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-03-19 : 08:22:10
"Skewness" and "Curtosis" are names that are suggestive of personal characterizations. One day, they'll show up on a singles website.

Curtosis is an obvious factor that describes height to girth. You could filter out single candidates using weight and curtosis.

But "Skewness" while it could describe a physical imbalance would be a more appropriate characterization of a psychological element ......

For example, a skewness of zero might be a boring, but the most interesting people have a moderate skewness with solid emotional center. Large variances in skewness could be wierd or scary.

All that's needed is an *exact* equation.
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-19 : 08:27:36



--Frank
http://www.insidesql.de
Go to Top of Page
   

- Advertisement -