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)
 Standard Normal Distributions

Author  Topic 

LopakaB
Starting Member

22 Posts

Posted - 2008-04-08 : 23:14:29
I am trying to create a function to return the standard normal distribution using the following formula:

n=(1/@c)*((1/SQRT(2*ACOS(-1)*@STDEV)*EXP(-0.5*POWER(((@X-@MEAN)/@STDEV), 2))))

*** Using "acos(-1)" instead of pi incase change is needed...:) ***

@x is the current problem...
I am looking for a numerical integrator algorithm to create @X...

Any help would be greatly appreciated...

Thank you :)


Lopaka

LopakaB
Starting Member

22 Posts

Posted - 2008-04-11 : 16:26:22
Since no help with this one...:(
Can anybody suggest a book on Statistical Calc's and SQL?

Thanks again...:)

Lopaka
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-11 : 16:46:39
What are the problem you are experiencing?

SELECT PI() do work on Microsoft SQL Server.


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

LopakaB
Starting Member

22 Posts

Posted - 2008-04-11 : 18:02:52
Problem:
@x=quadratic objective with linear contraints, using bicriterion approach.

I am using the rev cos instead of pi for future changes.



Lopaka
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-11 : 18:08:44
Where is your sample data and expected output?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-11 : 18:08:54
Why do you want to do this inside SQL? Can't you do this from your application instead? If you were using SQL Server 2005 or later, you'd be able to use the CLR which lets you run .NET code from within SQL. CLR would be highly recommended for this type of thing rather than straight SQL.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2008-04-13 : 20:38:37
quote:
Originally posted by PesoSELECT PI() do work on Microsoft SQL Server.


Ummm... yeah... it does.

--Jeff Moden
"Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! "
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row"

For better, quicker answers, click on the following... [url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]
Go to Top of Page

LopakaB
Starting Member

22 Posts

Posted - 2008-04-15 : 19:19:36

Peso: The formula specified in the begining of this blog is the sample data, except @x.tkizer: This needs to be done in SQL because several different applications will be using this function. Plus, the data is in sql and I would return 5 to 10 rows of data versus THOUSANDS of rows of data. Internet is not that fast. Upgrading to 2005 is not an option, yet...:)
Jeff Moden: Not sure what you are saying...

To put it simply, I am breaking the bell shape curve into evenly slices of data and putting a percentage on the pieces.

Lopaka

Lopaka
Go to Top of Page
   

- Advertisement -