The Member
Registered User.
- Local time
- Today, 05:26
- Joined
- Nov 2, 2001
- Messages
- 21
Dear Young people of this universe,
Is there any one who can demonstrate to me how to do Integration in VBA / Access?? I have the formula but dun know how... it is the normal distribution equation... I need to have the area under curve...
Option Compare Database
Option Explicit
Dim neK As Double 'neK is the Mathematical Constant e, 2.71828
Dim nPiK As Double 'nPiK is the Mathematical Constant, 3.14159
Dim fx As Double 'f(x) is Y, i.e. Value at Y axies
Dim nMu As Double 'nMu is the Mean of the dataset
Dim nSD As Double 'nSD is the Standard Deviation of the dataset
Dim nx As Double 'nx is the testing point.
'Set Mathematical Constants
Public Function NormalDisCRV(nMu As Double, nSD As Double, nx As Double)
Set neK = 2.71828
Set nPiK = 3.14159
fx = (1 / nSD * ((2 * nPiK) ^ (1 / 2))) * (neK ^ ((-1 / 2) * ((nx - nMu) / nSD) ^ 2))
End Function
I would need to intergrate fx with respect to nx from -00 (infinity) to nx...
fx = (1 / nSD * ((2 * nPiK) ^ (1 / 2))) * (neK ^ ((-1 / 2) * ((nx - nMu) / nSD) ^ 2))
many thanks...
JL
Is there any one who can demonstrate to me how to do Integration in VBA / Access?? I have the formula but dun know how... it is the normal distribution equation... I need to have the area under curve...
Option Compare Database
Option Explicit
Dim neK As Double 'neK is the Mathematical Constant e, 2.71828
Dim nPiK As Double 'nPiK is the Mathematical Constant, 3.14159
Dim fx As Double 'f(x) is Y, i.e. Value at Y axies
Dim nMu As Double 'nMu is the Mean of the dataset
Dim nSD As Double 'nSD is the Standard Deviation of the dataset
Dim nx As Double 'nx is the testing point.
'Set Mathematical Constants
Public Function NormalDisCRV(nMu As Double, nSD As Double, nx As Double)
Set neK = 2.71828
Set nPiK = 3.14159
fx = (1 / nSD * ((2 * nPiK) ^ (1 / 2))) * (neK ^ ((-1 / 2) * ((nx - nMu) / nSD) ^ 2))
End Function
I would need to intergrate fx with respect to nx from -00 (infinity) to nx...
fx = (1 / nSD * ((2 * nPiK) ^ (1 / 2))) * (neK ^ ((-1 / 2) * ((nx - nMu) / nSD) ^ 2))
many thanks...
JL
Last edited: