+ Reply to Thread
Results 1 to 18 of 18

Smoothing Data

  1. #1
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Smoothing Data

    I have 35 years of temperature data. I have created averages for each day. My data is noisy. I am trying to smooth the data in the columns. The columns I want to smooth are highlighted in yellow.
    Febnmae.xls

  2. #2
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Smoothing Data

    I don't understand what you mean with "smooth the data"

    What I see is: you try to get average value for each row with condition "HIGH" and "LOW",
    if that what you want, you can use this formula:

    on column BW "AVG.HIGH"
    Please Login or Register  to view this content.
    on column BZ :"AVG.LOW"
    Please Login or Register  to view this content.
    Note : the result will be different from your data, because in the end of your formula on "AVG.HIGH", your last column is "BS5+BT5",
    not "BS5+BU5", and on "AVG.LOW" you skip column "AZ" too.


    Regards,
    SDCh
    Last edited by SDCh; 02-16-2013 at 10:01 PM.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Smoothing Data

    Hi.

    I know this doesnt answer your question, but instead of that big =sum()/35 formula you are using - which by the way has an error in HIGH at the end (BT instead of BU), try using this instead (I am assuming you are using 2003)...
    =SUMIF($C$3:$BV$3,"High",C5:BV5)/COUNTIF($C$3:$BV$3,"High")
    if you have 2007> use...
    =AVERAGEIFS(C5:BV5,$C$3:$BV$3,"High").

    Now, what do you mean...you are trying to smooth the data? Perhaps a moving 3-day (or more?) average? In row 7, use this, copied down...
    =SUMIF($C$3:$BV$3,"High",C5:BV7)/COUNTIF($C$3:$BV$3,"High")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    I am using Excell 2010. I am trying to get the numbers in each column to look like this EX: 44, 44, 44, 45, 45, 46. Instead of jumping of jumping around.

  5. #5
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Smoothing Data

    I attach the file, so you can check which one you want to use, I already add version that FDibbins said if you use Excel 2003.
    I also check your formula on last 2 row.


    Regards
    SDCh


    Note : the attach file using Excel 2010.
    Attached Files Attached Files
    Last edited by SDCh; 02-17-2013 at 03:49 AM.

  6. #6
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    Not quite. The data highlighted in yellow (column BW) should look like or similar to whats in column BX. What I have in BX is where I try to smooth the data but I am not sure if it is the correct way.

  7. #7
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    Some one from the National Climate Data sent me this file. It is over my head. I do not understand it. How can I send it to you?

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Smoothing Data

    As I see it, part of this question (if not most of it) isn't really about Excel at all, but more a question for a climatologist/meteorologist/other atmospheric scientist. What you are computing is a simple arithmetic average of the daily high temperatures. For data that is as noisy as weather data, they apparently use some additional analysis beyond a simple arithmetic average. Perhaps after taking the arithmetic average for each date, they then do a curve fit across the month to get the final "averages." I really don't know. If I use the =TREND() function (http://office.microsoft.com/en-us/ma...081.aspx?CTT=1 Usually I would prefer to use the LINEST() function to get the coefficients of the trendline http://office.microsoft.com/en-us/ex...005209155.aspx) to get a linear fit across the month of February, I get values from 39 on Feb 1 to 45 on Feb 29. So maybe this is how they do it, but using data from all 12 months of the year in a single fit. Again, I'm no climate scientist, so I really don't know how climate scientists smooth temperature data.

    This is one of those questions where, if we knew how climate scientists come up with their averages, we could probably easily program it into Excel. Trying to determine how they obtained the average is a much more difficult problem. Are you approaching this problem as a "student" of climatology trying to learn how they do it? Or as someone who wants to challenge the way they do it? In any case, it seems to me that, at this point in the problem, we would benefit greatly from a short course in climatology to understand how temperature data are smoothed.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    Arguez-and-Applequist-Final.pdfArguez-and-Applequist-Final.pdf

    This is the file the National Climatic Center sent me. I really do not understand it.

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Smoothing Data

    Did you expect to understand it? The math they are using is fairly advanced (college level upper class to graduate level). I'm not sure how many of us on here have enough math background to coach you through the math they are using, especially if you lack the math background to understand it. What parts of it do you not understand that you feel you need to understand?

    At its most basic, they appear to be doing as I suggested they might - take the arithmetic averages, then curve fit those averages into an equation that will generate a smooth average for each day of the year. Also as I suspected, the equation that they are using to do this rigorously is fairly complex.

    So I come back to my previous question -- what is your goal or intention here? Are you really out to recreate the calculations they describe in this paper? I believe that, in most cases, understanding the math is a necessary prerequisite to being able to program those equations into a spreadsheet. In this case, it will be absolutely essential to have a solid understanding of the math, because it is quite involved.

    Or is this something for your own personal use, where you will settle for some simple math that will allow you to do something with these data?

    Or are you looking to do something I'm not anticipating?

  11. #11
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    I am looking for something fairly simple that will do the same thing that is in the paper. The other columns that are not labeled are smoothed using the median formula.

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Smoothing Data

    if was that simple why did they use a massive formula? or did they think ah lets look really clever and confuse everybody
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  13. #13
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    Do I need to filter the data and how would I do this?

  14. #14
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: Smoothing Data

    I am confused as to what you are trying to accomplish.
    The data are what they are; how would you "smooth" the data to get an orderly increase in temperature if the actual data contradict it? The only way to get data that supports an increase each day is to look at data over a longer period of years such that the variability per year gets reduced over the larger sample size.

  15. #15
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Smoothing Data

    As martin said, if there was a really simple equivalent, they would use the simpler equation.

    The hardest part of a problem like this really isn't about Excel at all. The hardest part is trying to decide what kind of equation to use to fit the data to. The first part of simplifying this is to decide what kind of simpler equation we want to use -- recognizing that we will not be able to exactly recreate what these guys are describing in their paper.

    The simplest approach might be something that breaks the year up into months, and regress a curve for each month. As I noted in post #8, one could easily use a straight line to fit February's data and be within a few degrees of the more difficult model. If I were generalizing this to other months, I would probably use a 2nd order polynomial rather than a straight line -- especially for months like January and July when one would expect T to go through a max/min. Again, this kind of model is very empirical and not something that will be publishable or really represent what is going on with temperature. It will also require many more parameters than the more theoretical model. The generic implementation of this approach might look like:

    1) Take arithmetic average of temperatures for each date over multiple years.
    2) Regress a polynomial curve for the month from these data. In Excel, I would use the LINEST() function (see help file above) to perform this regression.
    3) Computer smoothed temperatures from the curve to make sure the calculated values are reasonable.

    It should be emphasized that this is not intended to replace the more rigorous models like that presented in the paper. It is a quick and easy way to do these calculations in Excel without needing to go through the higher level math and programming needed to implement the kind of model presented in the paper. Depending on your requirements, it may be adequate, though, for your needs.

  16. #16
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    Can you do this for me so I can see what needs to be done so I can do the other months. I would appreciate it.

  17. #17
    Registered User
    Join Date
    10-29-2007
    Posts
    12

    Re: Smoothing Data

    How do you use the LINEST function. I looked it up and tried it. It did not woek.

  18. #18
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Smoothing Data

    Perhaps an example of how you tried it? In what way did it not work -- incorrect results? failed to return both slope and intercept? error value?

    I'm not in a position to "do it for you." Basic use of the LINEST() function is to create two columns (for a straight line fit) - one column for the y data and one column for the x data. Here's the example from the help file linked to above:

    A B
    Known y Known x
    1 0
    9 4
    5 2
    7 3
    Formula Formula
    =LINEST(A2:A5,B2:B5,,FALSE)

    Note The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range A7:B7 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 2.

    When entered as an array, the slope (2) and the y-intercept (1) are returned.
    I will emphasize the bit at the end -- LINEST() is an array formula. Two cells (for straight line fits) must be selected when entering the function, and the function must be confirmed with ctrl-shift-enter. Perhaps if you explain specifically how LINEST() is not working for you, we can help you understand what you are doing wrong.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1