This is a discussion on how to "Harmonic Mean" manual within the PHP General forums, part of the PHP Programming Forums category; i know stats_harmonic_mean(), but i am not server admin, i can't install PECL, so i need make it by ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
LKSunny wrote:
> i know stats_harmonic_mean(), but i am not server admin, i can't install > PECL, so i need make it by manual, but i have't Statistics knowledge, any > one can help me ? thank you very much !! I doubt anyone is going to write a php version of that function for you. given that you are not the server admin then someone else must be, go to that person and ask them to run the relevant pecl command: pecl install stats if they won't get another hoster. regardless you can still develop with that extension on your local machine. If you really need such a function/extension then you should be able to convince the client that it's less effort to find suitable hosting than it is to waste time reinventing a, potentially complex, wheel. > |
|
|||
|
i know it can make simple function, if have Statistics knowledge...
reference: http://en.wikipedia.org/wiki/Harmonic_Mean "Jochem Maas" <jochem@iamjochem.com> ???????:47628FED.3080701@iamjochem.com... > LKSunny wrote: >> i know stats_harmonic_mean(), but i am not server admin, i can't install >> PECL, so i need make it by manual, but i have't Statistics knowledge, any >> one can help me ? thank you very much !! > > I doubt anyone is going to write a php version of that function for you. > > given that you are not the server admin then someone else must be, go to > that person and ask them to run the relevant pecl command: > > pecl install stats > > if they won't get another hoster. regardless you can still develop with > that extension > on your local machine. > > If you really need such a function/extension then you should be > able to convince the client that it's less effort to find suitable hosting > than it > is to waste time reinventing a, potentially complex, wheel. > >> |
|
|||
|
LKSunny wrote:
> i know it can make simple function, if have Statistics knowledge... ah so you can read a page and therefore determine it's simple even though you have no 'Statistics knowledge' - brilliant deduction. you have 3 choices (given that your to stubborn to ask the sys admin to install the stats extention): 1. get some 'Statistics knowledge' 2. find a statistics/maths forum/mailinglist 3. pray someone with the patience to grok your question has such a function lying around and is willing to share. have !! a !! very !! nice !! day !! > > reference: > http://en.wikipedia.org/wiki/Harmonic_Mean > > "Jochem Maas" <jochem@iamjochem.com> > ???????:47628FED.3080701@iamjochem.com... >> LKSunny wrote: >>> i know stats_harmonic_mean(), but i am not server admin, i can't install >>> PECL, so i need make it by manual, but i have't Statistics knowledge, any >>> one can help me ? thank you very much !! >> I doubt anyone is going to write a php version of that function for you. >> >> given that you are not the server admin then someone else must be, go to >> that person and ask them to run the relevant pecl command: >> >> pecl install stats >> >> if they won't get another hoster. regardless you can still develop with >> that extension >> on your local machine. >> >> If you really need such a function/extension then you should be >> able to convince the client that it's less effort to find suitable hosting >> than it >> is to waste time reinventing a, potentially complex, wheel. >> > |
|
|||
|
LKSunny wrote:
> i know it can make simple function, if have Statistics knowledge... > I don't think you need to know much about statistics - AFAIK, the harmonic mean of a group of numbers is simply the reciprocal of the 'normal' mean: harmonic_mean(3,4,5,6) = 1/mean(3,4,5,6) /Per Jessen, Zürich |
|
|||
|
If I am reading Wikipeadia correctly, you want this:
<?php function stats_harmonic_mean($array){ $count = count($array); $mean = 0; foreach($array as $n){ $mean += 1/$n; } $mean = $count / $mean; return $mean; } ?> No guarantees as to correctness. The *real* function probably takes a variable number of arguments, and you can do that if you need to, but you're on your own for that. On Fri, December 14, 2007 8:38 am, LKSunny wrote: > i know it can make simple function, if have Statistics knowledge... > > reference: > http://en.wikipedia.org/wiki/Harmonic_Mean > > "Jochem Maas" <jochem@iamjochem.com> > ???????:47628FED.3080701@iamjochem.com... >> LKSunny wrote: >>> i know stats_harmonic_mean(), but i am not server admin, i can't >>> install >>> PECL, so i need make it by manual, but i have't Statistics >>> knowledge, any >>> one can help me ? thank you very much !! >> >> I doubt anyone is going to write a php version of that function for >> you. >> >> given that you are not the server admin then someone else must be, >> go to >> that person and ask them to run the relevant pecl command: >> >> pecl install stats >> >> if they won't get another hoster. regardless you can still develop >> with >> that extension >> on your local machine. >> >> If you really need such a function/extension then you should be >> able to convince the client that it's less effort to find suitable >> hosting >> than it >> is to waste time reinventing a, potentially complex, wheel. >> >>> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |
|
|||
|
Per Jessen wrote:
> I don't think you need to know much about statistics - AFAIK, the > harmonic mean of a group of numbers is simply the reciprocal of > the 'normal' mean: > > harmonic_mean(3,4,5,6) = 1/mean(3,4,5,6) Ignore that. /Per Jessen, Zürich |
|
|||
|
i testing ~ it's correct
Thank You Very Much !! ""Richard Lynch"" <ceo@l-i-e.com> ???????:42955.98.193.37.55.1197651098.squirrel@www .l-i-e.com... > If I am reading Wikipeadia correctly, you want this: > > <?php > function stats_harmonic_mean($array){ > $count = count($array); > $mean = 0; > foreach($array as $n){ > $mean += 1/$n; > } > $mean = $count / $mean; > return $mean; > } > ?> > > No guarantees as to correctness. > > The *real* function probably takes a variable number of arguments, and > you can do that if you need to, but you're on your own for that. > > On Fri, December 14, 2007 8:38 am, LKSunny wrote: >> i know it can make simple function, if have Statistics knowledge... >> >> reference: >> http://en.wikipedia.org/wiki/Harmonic_Mean >> >> "Jochem Maas" <jochem@iamjochem.com> >> ???????:47628FED.3080701@iamjochem.com... >>> LKSunny wrote: >>>> i know stats_harmonic_mean(), but i am not server admin, i can't >>>> install >>>> PECL, so i need make it by manual, but i have't Statistics >>>> knowledge, any >>>> one can help me ? thank you very much !! >>> >>> I doubt anyone is going to write a php version of that function for >>> you. >>> >>> given that you are not the server admin then someone else must be, >>> go to >>> that person and ask them to run the relevant pecl command: >>> >>> pecl install stats >>> >>> if they won't get another hoster. regardless you can still develop >>> with >>> that extension >>> on your local machine. >>> >>> If you really need such a function/extension then you should be >>> able to convince the client that it's less effort to find suitable >>> hosting >>> than it >>> is to waste time reinventing a, potentially complex, wheel. >>> >>>> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/from/lynch > Yeah, I get a buck. So? |