average

Average User Download Speeds

Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality. I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to start. ...

What's the quickest way to get the mean of a set of numbers from the command line?

Using any tools which you would expect to find on a nix system (in fact, if you want, msdos is also fine too), what is the easiest/fastest way to calculate the mean of a set of numbers, assuming you have them one per line in a stream or file? ...

Can I calculate the average of these numbers?

Hi folks, I was wondering if it's possible to calculate the average of some numbers if I have this: int currentCount = 12; float currentScore = 6.1123 (this is a range of 1 <-> 10). Now, if I receive another score (let's say 4.5), can I recalculate the average so it would be something like: int currentCount now equals 13 float cur...

MySQL autogenerate statistics fram data

Hi! I have a Table containig Dates, Distances, and TimeForDistance... Is there any way to Calculate the average per month velocity using MySQL Statements? Any Help would really be appreciated! ...

calculate exponential moving average in python

I have a range of dates and a measurement on each of those dates. I'd like to calculate an exponential moving average for each of the dates. Does anybody know how to do this? I'm new to python. It doesn't appear that averages are built into the standard python library, which strikes me as a little odd. Maybe I'm not looking in the r...

What is an Average that does not include outliers?

What do you call an Average that does not include outliers? for example if you have a set: {90,89,92,91,5} avg = 73.4 but excluding the outlier (5) we have {90,89,92,91(,5)} avg = 90.5 How do you describe this average in statistics? ...

Finding mean of array of ints

Say you have an array of int (in any language with fixed size ints). How would you calculate the int closest to their mean? Edit: to be clear, the result does not have to be present in the array. That is, for the input array [3, 6, 7] the expected result is 5. Also I guess we need to specify a particular rounding direction, so say ro...

VB.net Average of 3 numbers two different ways. Beginners question.

I have a form that has 3 text boxes for 3 input values, along with a list box for output. I need the user to be able to input 3 different numbers and click a button to find the average. I'm not really sure how to do/approach this. Any help is greatly appreciated. Still Stuck.... Private Sub btnAverage_Click(ByVal sender As System.Objec...

VB.net Can't get output to appear in my listbox. Beginners Question.

Trying to get the user to put 3 numbers in 3 text boxes and get the average. Private Sub btnAverage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAverage.Click Dim a As Integer = CInt(txtone.Text) Dim b As Integer = CInt(txtTwo.Text) Dim c As Integer = CInt(txtThree.Text) Dim average As In...

Clean way to reduce many TimeSpans into fewer, average TimeSpans?

I have a C# Queue<TimeSpan> containing 500 elements. I need to reduce those into 50 elements by taking groups of 10 TimeSpans and selecting their average. Is there a clean way to do this? I'm thinking LINQ will help, but I can't figure out a clean way. Any ideas? ...

Get the most average position of X objects on a path with Y available positions

Hi, Its friday, and in local time the clock is 3.22pm, so my brain wont give me a solution, so i ask: Im trying to write a function/algorithm in Actionscript 3.0 that gives me the most average positions of x number of positions along a path of y number of available positions. Y is always larger than X of course. The background is, I ...

Ruby on Rails field average?

Is there an easy way to obtain the average of an attribute in a collection? For instance, each user has a score. Given a collection of user(s) (@users), how can you get the average score for the group? Is there anything like @users.average(:score)? I think I came across something like this for database fields, but I need it to work f...

T-SQL Time Averaging

I have a table in SQL Server that stores statistics for a piece of hardware, rows in the table represent data for a given second. It contains for example, these columns: timestamp (DateTime) value (int) What I want to do is select the data from the table for a given date/time range but return it in such a way that it averages for a gi...

Exponential Moving Average Sampled at Varying Times

I have a continuous value for which I'd like to calculate an exponential moving average. Normally I'd just use the standard formula for this: Sn = Y + (1-)Sn-1 where Sn is the new average, is the alpha, Y is the sample, and Sn-1 is the previous average. Unfortunately, due to various issues I don't have a consistent sample time. I m...

Linq - calculate multiple averages in one query

I'm trying to convert some SQL queries into Linq to avoid multiple trips to the database. The old SQL I'm trying to convert does: SELECT AVG(CAST(DATEDIFF(ms, A.CreatedDate, B.CompletedDate) AS decimal(15,4))), AVG(CAST(DATEDIFF(ms, B.CreatedDate, B.CompletedDate) AS decimal(15,4))) FROM dbo.A INNER JOIN dbo.B ON B.Par...

Linq to SQL error when doing a Lambda

The following lines of code is producing this error: "Overload resolution failes because no accessible 'Single' can be called with these arguments". I'm not too good with VB, but since the app I've inherited was in VB, I didn't want to rewrite it all: Dim a1 = From rows In db.tPDMLinkUsages _ Where (rows.ACCESSDATE >= DateTime.Today...

What bizarre averaging algorithm is my bike computer using?

My bike computer can show me various figures such as distance travelled, time elapsed, max speed, average speed, current speed etc. I usually have it set to display the current and average speeds. You can reset the distance and time (both together) at any point; the max and average speeds are calculated since the last reset. The distanc...

Average of two angles with wrap around

Possible Duplicate: How do you calculate the average of a set of angles? I have two angles, a=20 degrees and b=350 degrees. The average of those two angles are 185 degrees. However, if we consider that the maximum angle is 360 degrees and allows for wrap around, one could see that 5 degrees is a closer average. I'm having trou...

How do you concisely get the average house price from an array of houses?

Assuming the @houses array is set up as follows: house1.price = 10 house2.price = 20 house3.price = 30 @houses << house1 @houses << house2 @houses << house3 This is the starting point of our calculation and we want to find the average price of a house: total = 0 average = 0 for h in @houses total += h.price end average = total/@hous...

Cumulative sums, moving averages, and SQL "group by" equivalents in R

What's the most efficient way to create a moving average or rolling sum in R? How do you do the rolling function along with a "group by"? ...