Math - weighted average?

posted by .

I need to create some type of formula that will allow me to interpolate values at specific points in a data set. My data is something like this: I have a list of times, and there are values associated with those times like this:

T Readings
1 100 103 105
2 103 101 107
3 102 104 108
4.5 107 107 105
7 105 106 104


I need to correct the times (and the corresponding values) so that each timestamp is one second apart. My professor said that the best way to do this would be with a weighted average.

I'm finding it difficult to find a formula that seems correct. I tried solving for the correct time value, ie:

4 = ((3+4.5)/2)x
Where x= the unknown weight, 4 is the corrected timestamp value, and 3 and 4.5 are the known time values. This gives me an X of 16/15. This process works when I know what the value should be (as with the timestamps), but I don't know what the interpolated reading values should be. I thought that maybe once I found the "weight" from the timestamps I could use it to interpolate the readings, but this doesn't seem to provide a reasonable answer. (ie, plugging in 16/15 for x in the equation ((102+107)/2)x provides a value of 111.47, which doesn't make sense). I also thought about multiplying the average by some sort of percent difference from the target value, but this doesn't seem to work either.

The dataset I have is very large so ideally I'd like to find a formula that I can use in a program to do the calculations for me, rather than doing each calculation by hand. Any help or insight would be appreciated.

  • Math - weighted average? -

    if you understand interpolation, and you seem to, just think of it this way.

    If the value you want is, say, 2/3 of the way from one known value to the next, the readings will also be 2/3 of the way from one value to the next.

    so, if you want to place values at 1-unit intervals, you need to step through the given timestamps and whenever you find two timestamps greater than one unit apart, interpolate.

    3 and 4.5 are greater than 1 unit apart, so, since 4 is 2/3 of the way between 3 and 4.5, you will generate values 2/3 of the way between those at 3, and those at 4.5.

    Since 7 is more than 1 unit away from 4.5, you need to generate data points for times of 5 and 6.

    5 is 1/5 of the way from 4 to 7.5
    6 is 3/5 of the way.

    so, given x-values and y-values,

    if xn+1 - xn > 1,
    for each number xk between xn and xn+1,
    yk = yn + (xk-xn)/(xn+1-xn) * (yn+1-yn)

  • Math - weighted average? -

    small oops. 5 is 2/7 of the way from 4 to 7.5, and 6 is 4/7, and 7 is 6/7.

  • Math - weighted average? -

    This made a lot of sense, thank you for responding! It was able to incorporate it into my program and it seems to work.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. math question

    hi, i have a math question that i need help with: when data are non-numerical but can be ordered, such as letter grades, the mean cannot be calculated directly; but both the median and mode can be found. Last year in Ms. Flag's history …
  2. math

    What is outliers? how do you solve this problem?
  3. statistics

    Job Sat. INTR. EXTR. Benefits 5.2 5.5 6.8 1.4 5.1 5.5 5.5 5.4 5.8 5.2 4.6 6.2 5.5 5.3 5.7 2.3 3.2 4.7 5.6 4.5 5.2 5.5 5.5 5.4 5.1 5.2 4.6 6.2 5.8 5.3 5.7 2.3 5.3 4.7 5.6 4.5 5.9 5.4 5.6 5.4 3.7 6.2 5.5 6.2 5.5 5.2 4.6 6.2 5.8 5.3 5.7 …
  4. math

    4. For Questions 4-7, use the following data: The number of file conversions performed by a processor per day for 10 days was: 15, 27, 25, 28, 30, 31, 22, 25, 27, 29 What is the arithmetic mean of the data?
  5. college math

    10. For questions 10-13, use the following data: 13 29 41 60 89 14 26 53 7 14 What is the arithmetic mean of the data?
  6. math

    10. For questions 10-13, use the following data: 13 29 41 60 89 14 26 53 7 14 What is the arithmetic mean of the data?
  7. Math

    In Example 2, find the percent of the total and the number of degrees in each sector for mountains, theme parks, relatives, and other. Find the median of the data set in Example 3. In which category does it fall?
  8. Math

    Assume a data set is normally distributed with mean 11 and standard deviation 3. If the data set contains 30 data values, approximately how many of the data values will fall within the range 8 to 14?
  9. Math

    Assume a data set is normally distributed with mean 182 and standard deviation 30. If the data set contains 600 data values, approximately how many of the data values will fall within the range 122 to 242?
  10. Business

    A frequency distribution is obtained by A. listing the values in sets of data individually. B. taking the difference between the highest and the lowest value in each set of data. C. summing the values of a set of data and dividing …

More Similar Questions