Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    82

    Unanswered: Moving/Rolling Average by week

    Hello

    Can anyone help me as I am well and truly stuck

    I work in a company where I am unable to create my own functions or tables whilst using informix

    I need to find out the moving average for the last 6 weeks by ward

    The data in the table I have is

    Admission_date,
    Admission_Time
    Ward,
    PMI_number
    FROM Admissions

    I know that I need to work out the week (But cannot create functions)

    My ultimate aim is to get the moving average by hour (from admission_time) by ward for the last 6 weeks

    Is anyone able to provide any kind of assitance, which would be greatly appreciated

    Kind Regards
    Helen

  2. #2
    Join Date
    Dec 2011
    Posts
    82
    P.S PMI_Number is the unique identifier

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    instead of using a moving average have you considered using exponential smothing. with the correct smoothing factor statistically is virtually indistinguishable to a moving average
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Dec 2011
    Posts
    82
    Hello

    I ahve tried reasrching exponentail smoothing on the net and it looks like complicated formulae

    I have also tried researching forecasting, but have not come across anything I can use

    Are you able to provide further assistance?

    Kind Regards
    Helen

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    actually its not at all complicated. you don't need every value going back to year dot. you just need the last value, the current value and the smoothing factor.it came to notice in the early days of computational work when storing and processing massive amounts fo data could be tricky. where it falls down is if someone keeps adjusting the smoothing factor or decides they want to change the factor. it can take a while for the new smoothed factor to work.
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi Helen,


    the Time Series datablade has such a function. IF you run 11.70 you have this datablade in your distribution. For 11.50, I think you can download it for free.

    TimeSeries is a datablade dedicated to handling data based on timestamps, and contains a lot of functions handling timestamps in an extremely fast way.

    TimeSeries may not be the right solution for your objective, but you can try to find the functions code and get inspired from them.

    About TimeSeries:
    IBM Informix 11.50 information center

Posting Permissions

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