{(-1,9),(2,9),(5,135)} Write the equation in standard form y=ax^2+bx+c
So we have to fit a quadratic function?
yes
Hey Lahore. long time no C.
so we have the following: \[f(-1)=9 ; f(2)=9 ; f(5)=135\] we need to do some plugin'
\[f(-1)=a-b+c=9\] \[f(2)=4a+2b+c=9\] \[f(5)=25a+5b+c=135\]
solve using gaussian elimination!!
1 0 0 7 0 1 0 -7 0 0 1 -5
a = 7, b = -7, c = 5. or am I mistaken I will draw the graph
It's wrong :(
its alright @agd :) i kinda get it as myininaya is explaining
I will call numpy's quadratic fitting function and find the answer
my numpy implementation is broken (I'/m using a 64 bit platform so it won't work) I will code gradient descent myself!!!
http://en.wikipedia.org/wiki/Polynomial_regression#Matrix_form_and_calculation_of_estimates
thank you agdgdgdgwngo :) that is helpful .extra medal for you
I've found an answer. a = 3.75 b = 0 c = 5.25
It doesn't fit 135 :(
\[a-b+c=9\] \[4a+2b+c=9\] \[25a+5b+c=135\] multiply equation one by 2 and add to equation two giving us the new set of equations \[a-b+c=9\] \[6a+0+3c=27\] \[25a+5b+c=135\] multiply equation one by 5 and add to equation three giving us the new set of equations \[a-b+c=9\] \[6a+0+3c=27\] \[30a+0+6c=180\] lets simplify little before doing anything else \[a-b+c=9\] \[2a+0+c=9\] \[5a+0+c=30\] Ok multiply equation three by -1 and add to equation one and two to get the new set of equations \[-4a-b+0=-21\] \[-3a+0+0=-21\] \[5a+0+c=30\] now simplify again \[-4a-b+0=-21\] \[a+0+0=7\] \[5a+0+c=30\] Ok multiply second equation by 4 and add to equation one \[0-b+0=7\] \[a+0+0=7\] \[5a+0+c=30\] Ok multiply second equation by -5 and add to equation three \[0-b+0=7\] \[a+0+0=7\] \[0+0+c=-5\] now lets simplify alittle \[0+b+0=-7\] \[a+0+0=7\] \[0+0+c=-5\]
wow a lot of work there myininaya :(
lol
a=7; b=-7; c=-5
those don't work either :(
i don't believe you
at least mine fits (1, 9) and (-1, 9)
let me check lol
wow myininaya that was awesome!!!
she used gauss-jordan elimination :-D
:D happy! thankyou so much myininaya and agdgdgdgwngo
wait myininaya is right!!
I wrote 1 instead of 2 :-P
i checked it it works lol
but i guess i'm late in the checking part
you could also just do \[\Theta = (X^TX)^{-1}*X^{T} Y\]
Show off! I think this is just a algebra question?
man you guys are so smart:) keep it up
so agdgd are you going to know me what pseudoinverse means?
sure
lets go to your question
Join our real-time social learning platform and learn together with your friends!