07-03-2009 12:06 AM
altenbach wrote:Jeff, I think two loops are enough. 🙂
absolutely true for any one point. I simply solved for the general set and (certainly) without regard to code optimization. The Brute Force method is IMHO, the simplest way to demonstrate and comment on methods (although I seem to have a typo in the Pathogorean theorem [where did the "-" come from])
Almost never would anyone want to solve this problem for EVERY point in the array! The outermost 2 loops could / should be replaced with an array of desired coordinates to solve for. Just as you replaced them with the graphs cursor position which selects only one point for each event.
Additionally, knowing the desired coordinates to solve for and the radius, the inner two loops could / should be indexed from a subset of the array no greater than +/- Ceil of radius in any dimension (so we just trim of the corners instead of waisting time calculating hypotenuses where |A| or |B| is greater than C.) And that assumes that the 2d array is consistent and orthogonal in magnitude per dimension and not a 2d array of (x,y) or (R,T).
You did nail me on the averaging though. A pair of scalars are all that is necessary to calculate average: total and count. The OP did specify the output should be an "average" and my solution was "mean." Again IMHO, mean is a better metric than average for this type of measurement but I didn't want to push the minor mathematical differences.
warm regards
07-03-2009 12:12 AM
Jeff Bohrer wrote:
You did nail me on the averaging though. A pair of scalars are all that is necessary to calculate average: total and count. The OP did specify the output should be an "average" and my solution was "mean." Again IMHO, mean is a better metric than average for this type of measurement but I didn't want to push the minor mathematical differences.
What is the difference between mean and average? What I learned in math was that they are just two different words for the same thing.
07-03-2009 12:35 AM - edited 07-03-2009 12:40 AM
Ravens Fan wrote:
Jeff Bohrer wrote:
You did nail me on the averaging though. A pair of scalars are all that is necessary to calculate average: total and count. The OP did specify the output should be an "average" and my solution was "mean." Again IMHO, mean is a better metric than average for this type of measurement but I didn't want to push the minor mathematical differences.
What is the difference between mean and average? What I learned in math was that they are just two different words for the same thing.
I don't want to get too far off topic but.... Mean, as LV calculates it, is the Greek mu or "population mean" and can have a confidence factor derived from the sample size, and deviation so that you might guess, with predictable reliability, "what is the probability that the average of all of the tested and untested samples matches this value?"
"Average", is exactly what you know sum / count. It is usaully represented by a bar over X (greek chi meaning, "sample mean.") This is a known, deterministic, value that may or may not represent the points you have failed to observe (like the infinite number of other points that could be have been tested between any two array indices)
07-03-2009 12:54 AM
Please come up with an example of data that shows the mean as calculated by LV is different than the "average" of sum/count. I would like to see that.
All the other stuff you are getting into I would consider to be other statistical parameters. Standard deviation (sample vs. population), chi-squared, gaussian distributions, ...
Wikipedia's entry on mean even gets into the terminology you are using, and argues that it is somehow different, but then procedes to say that the mean is the sum of the observations divided by the number of observations. Sure sounds like sum/count to me!
07-03-2009 01:11 AM
The mean in LabVIEW is exactly defined as follows:
There is no difference to my "average".
Yes, we only need to loop over the subset, which would make the code a bit (but not much) more complicated. We don't really know the size of the circular areas as it relates to the total area, and we also don't know the size of the 2D array. I assumed the are relatively similar. Why would we acquire much more "outside" data than actually needed? Once we have more information, we can decide what kind of optimizations are appropriate. 🙂
07-03-2009 01:18 AM
Ravens Fan wrote:Please come up with an example of data that shows the mean as calculated by LV is different than the "average" of sum/count. I would like to see that.
All the other stuff you are getting into I would consider to be other statistical parameters. Standard deviation (sample vs. population), chi-squared, gaussian distributions, ...
Wikipedia's entry on mean even gets into the terminology you are using, and argues that it is somehow different, but then procedes to say that the mean is the sum of the observations divided by the number of observations. Sure sounds like sum/count to me!
OK WAY of topic but I'l bite 'cuz I'm an insomniac
"Sample Mean"(bar over Chi) = sum / count = the average of what has been observed. This is a number that is always right and any grammar school math book can prove to be correct.
"Population Mean" (mu) is a statistic. > damned lies > lies (to paraphrase an English gentelman of fame). Statistics predict how often our measured values are inconsistant with real facts, both those that have, and have not been observed.
A minor point but.... how is Schroedinger's cat doing right now? is it alive, dead or both?
07-03-2009 01:20 AM
07-03-2009 01:56 AM
In statistic you'd like to have the mean as well as standard deviation or variance. Thus a statistics VI will compute the sum of all x and the sum of all (x squared) and the square of the sum of all x. Some more computing effort than just calculating the average value. The value of mu is the same as that of the average.
07-03-2009 02:35 AM
Really, this is a minor point and totally off topic. The "average(WFM)" and the "mean(WFM)" can (and usually do) have the same VALUE. The difference is in the DENOTATIONS of the words "average" and "mean".
To RF-
Nope, I can't show a difference in the values-- but, (pause for effect) mu and bar chi have different representations because the dissimilarities have been evident for > 4K yrs (thank you to Plato)
07-03-2009 04:32 AM
Altenbach
plz go through the bellow link
http://forums.ni.com/ni/board/message?board.id=170&message.id=418029#M418029
i need the pixel index and value of the selected circled area.looking for ur reply.