Function to calculate Standard Deviation
Moderator: Rathinagiri
Function to calculate Standard Deviation
Hi
Is there a function to calculate Standard Deviation in HMG ?
On Esgici's wonderful site Vivaclipper.com I found ASTDDEV() function but HMG throws error of undefined function.
Can anyone help me on this.
Thanks
Is there a function to calculate Standard Deviation in HMG ?
On Esgici's wonderful site Vivaclipper.com I found ASTDDEV() function but HMG throws error of undefined function.
Can anyone help me on this.
Thanks
Re: Function to calculate Standard Deviation
Find information in which library this function and include it manually.
This function is defined in SuperLib:
https://vivaclipper.wordpress.com/2013/ ... -superlib/
This function is defined in SuperLib:
https://vivaclipper.wordpress.com/2013/ ... -superlib/
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: Function to calculate Standard Deviation
Hola...
Tal vez este post te ayude:
viewtopic.php?t=5392
Hi...
Maybe this post can help you:
viewtopic.php?t=5392
Tal vez este post te ayude:
viewtopic.php?t=5392
Hi...
Maybe this post can help you:
viewtopic.php?t=5392
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
Re: Function to calculate Standard Deviation
Hi Mol and Claudio
Thanks for your reply.
I have SuperLib sup3552.lib. I tried linking it by putting libs=sup3552.lib in configuration tab of IDE but it doen't work.
I checked the link provided by Claudio where Esgici has advised to read readme.txt file in harbour directory.
The readme.txt file contains
4.) Apply supplied patch to the source using GNU Patch:
patch -lNi superlib.dif
from where do I get patch.exe to patch superlib.dif. Will this produce something like superlib.a library which can be linked to my program using libs=superlib.a
Pls advice.
Many thanks to both of you.
Thanks for your reply.
I have SuperLib sup3552.lib. I tried linking it by putting libs=sup3552.lib in configuration tab of IDE but it doen't work.
I checked the link provided by Claudio where Esgici has advised to read readme.txt file in harbour directory.
The readme.txt file contains
4.) Apply supplied patch to the source using GNU Patch:
patch -lNi superlib.dif
from where do I get patch.exe to patch superlib.dif. Will this produce something like superlib.a library which can be linked to my program using libs=superlib.a
Pls advice.
Many thanks to both of you.
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Function to calculate Standard Deviation
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: Function to calculate Standard Deviation
Hi Daniel
Many thanks for the link. I have downloaded the files mentioned by Vlademiro in the link.
However I still can't link superlib.lib. Can you provide a more detailed guide.
Thanks
Many thanks for the link. I have downloaded the files mentioned by Vlademiro in the link.
However I still can't link superlib.lib. Can you provide a more detailed guide.
Thanks
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: Function to calculate Standard Deviation
This is the function and asociated function:
FUNCTION amStdDev(aArray,nElem,bCondition)
return(sqrt(amVariance(aArray,nElem,bCondition)))
FUNCTION amVariance(aArray,nElem,bCondition)
local nAverage, i
local nVariance := 0
local nCount := 0
local nReturn := 0
if (valtype(nElem) == 'N')
nAverage := amAverage(aArray,nElem,bCondition)
bCondition := iif(valtype(bCondition) == 'B',bCondition,{||.t.})
for i := 1 to len(aArray)
if (eval(bCondition,aArray))
nVariance += ((nAverage-aArray[nElem] )^2)
nCount++
endif
next
nReturn := (nVariance/nCount)
endif
return (nReturn)
Copy and paste in you .prg or create new module into you project and paste into... is all.
Pd Sorry for my bad eng
FUNCTION amStdDev(aArray,nElem,bCondition)
return(sqrt(amVariance(aArray,nElem,bCondition)))
FUNCTION amVariance(aArray,nElem,bCondition)
local nAverage, i
local nVariance := 0
local nCount := 0
local nReturn := 0
if (valtype(nElem) == 'N')
nAverage := amAverage(aArray,nElem,bCondition)
bCondition := iif(valtype(bCondition) == 'B',bCondition,{||.t.})
for i := 1 to len(aArray)
if (eval(bCondition,aArray))
nVariance += ((nAverage-aArray[nElem] )^2)
nCount++
endif
next
nReturn := (nVariance/nCount)
endif
return (nReturn)
Copy and paste in you .prg or create new module into you project and paste into... is all.
Pd Sorry for my bad eng
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: Function to calculate Standard Deviation
Call :
amStdDev (aArray,nElem,bCondition)
or can rename " FUNCTION amStdDev (aArray,nElem,bCondition) " to " FUNCTION ASTDDEV (aArray,nElem,bCondition) "
if your .prg call this function with this name.
amStdDev (aArray,nElem,bCondition)
or can rename " FUNCTION amStdDev (aArray,nElem,bCondition) " to " FUNCTION ASTDDEV (aArray,nElem,bCondition) "
if your .prg call this function with this name.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
Re: Function to calculate Standard Deviation
Hi Claudio
Thanks for the functions.
It requires amAverage(aArray,nElem,bCondition) function while compiling.
Also what is nElem value to be passed ?
Thanks for the functions.
It requires amAverage(aArray,nElem,bCondition) function while compiling.
Also what is nElem value to be passed ?
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Function to calculate Standard Deviation
Se supone que para sacar un promedio necesitamos los valores (aArray) y sobre cuantos elementos (nElements)
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO