Math problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rhesus
    Confirmed User
    • Aug 2004
    • 2009

    #1

    Math problem

    One can best-fit a straight line y = ax + b through scattered dots (x,y) using least squares linear regression. One minimises the sum of the squares of the error of the found best-fitting line and the actual dots(/measurements).

    Now I want to weigh each of these errors for distance to the most recent x(/measurement), giving most weight to the most recent point.

    Say, if we observe time on the x axis [I'll use brackets as subscript is no option here],

    c = the number of 'dots' we want to calculate a line from

    y[t] = the observation at x[t], where t = -(c+1),... , -3, -2, -1, 0

    weight w = 0.9^|x[0] - x[t]|

    What formulas should I use to calculate a and b in y = ax + b?

    For someone a little more proficient in math than I am it shouldn't be too hard.

    $25 by epass to the first to correctly post and derive these formulas.

    Thanks in advance!
  • cranki
    Confirmed User
    • Feb 2005
    • 5162

    #2
    hahahahahahhahahaa @ asking this on gfy

    Comment

    • Brother Bilo
      Confirmed User
      • Jun 2007
      • 4193

      #3
      uhhhhhhhhhhhhh

      Comment

      • Rhesus
        Confirmed User
        • Aug 2004
        • 2009

        #4
        Well GFY is full of retards but has some hidden gems as well!

        Comment

        • woj
          <&(©¿©)&>
          • Jul 2002
          • 47882

          #5
          Is this an actual math problem that will be graded by someone? or just something for yourself?
          Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
          Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
          Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

          Comment

          • RedShoe
            赤い靴 call me 202-456-1111
            • Feb 2001
            • 14831

            #6
            Ask Good Will Hunting.

            SPECIALTY COSTUMES • PROPS • FX
            Superheroes • Monsters • Robots
            PM for details


            For any manufacturing needs. Adult or otherwise.

            aka BonsHigh on Insta
            Bonsai weed plants


            Comment

            • noone1
              So Fucking Banned
              • Apr 2007
              • 111

              #7
              Originally posted by Rhesus
              One can best-fit a straight line y = ax + b through scattered dots (x,y) using least squares linear regression. One minimises the sum of the squares of the error of the found best-fitting line and the actual dots(/measurements).

              Now I want to weigh each of these errors for distance to the most recent x(/measurement), giving most weight to the most recent point.

              Say, if we observe time on the x axis [I'll use brackets as subscript is no option here],

              c = the number of 'dots' we want to calculate a line from

              y[t] = the observation at x[t], where t = -(c+1),... , -3, -2, -1, 0

              weight w = 0.9^|x[0] - x[t]|

              What formulas should I use to calculate a and b in y = ax + b?

              For someone a little more proficient in math than I am it shouldn't be too hard.

              $25 by epass to the first to correctly post and derive these formulas.

              Thanks in advance!
              Ugh. Google it. No one does this shit by hand. Grab a TI graphing calculator or a computer program.

              Comment

              • Rhesus
                Confirmed User
                • Aug 2004
                • 2009

                #8
                Originally posted by woj
                Is this an actual math problem that will be graded by someone? or just something for yourself?
                It's for myself, I'm not studying anything math-related.

                Comment

                • Rhesus
                  Confirmed User
                  • Aug 2004
                  • 2009

                  #9
                  Originally posted by noone1
                  Ugh. Google it. No one does this shit by hand. Grab a TI graphing calculator or a computer program.
                  All a google search yields is linear regression weighted for variance which is not what I need.

                  Comment

                  • woj
                    <&(©¿©)&>
                    • Jul 2002
                    • 47882

                    #10
                    hit me up on icq, I can get you an algorithm that will do what you want, icq: 33375924
                    Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                    Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                    Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                    Comment

                    • ADL Josh
                      Confirmed User
                      • Feb 2007
                      • 3026

                      #11
                      we will help you out with your porn sites, but we refuse to do your homework for you...c'mon now!
                      ICQ: 395-433-632

                      Comment

                      • Rhesus
                        Confirmed User
                        • Aug 2004
                        • 2009

                        #12
                        Originally posted by woj
                        hit me up on icq, I can get you an algorithm that will do what you want, icq: 33375924
                        Hello, thank you for your offer, but I want formulas to integrate in other stuff I'm building. I can't work with a seperate algo.

                        Comment

                        • Rhesus
                          Confirmed User
                          • Aug 2004
                          • 2009

                          #13
                          I mean, I can obviously minimise the sum of squares by 'brute force' easily for each a and b and approximate their optimum this way, but I would like help in deriving a and b for the point where [delta]f/[delta]a = [delta]f/[delta]b = 0.

                          Comment

                          • woj
                            <&(©¿©)&>
                            • Jul 2002
                            • 47882

                            #14
                            well, I can get you the "formulas" but really, implementing the formulas involves writing an algorithm to solve this problem... even with simple non-weighted case, you can't just magically get the answer, you have to build an algorithm to solve it...
                            Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                            Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                            Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                            Comment

                            • Rhesus
                              Confirmed User
                              • Aug 2004
                              • 2009

                              #15
                              Originally posted by woj
                              well, I can get you the "formulas" but really, implementing the formulas involves writing an algorithm to solve this problem... even with simple non-weighted case, you can't just magically get the answer, you have to build an algorithm to solve it...
                              I mean to get an equation like this one (for non-weighted cases):

                              a = ( [sum](i=1 to N) (x[i] - x[mean]) (y[i] - y[mean]) ) / ( [sum](i=1 to N) (x[i] - x[mean])^2

                              Annoying I have to resort to this kind of notation.

                              Naturally you need an algorithm to calculate the sums, means, etc but an equation like the one above is what I'm looking for. The rest I can do myself.

                              Comment

                              • D
                                Confirmed User
                                • Jan 2006
                                • 7412

                                #16
                                fun. wish I had the time to play with this one.

                                I'm probably one stats class short of being able to crank something out for ya. Hit me up tonight, after the business day is done, if you're still looking for an answer, bro.
                                -D.
                                ICQ: 202-96-31

                                Comment

                                Working...