[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I need to come up with a formula for a personal project to fit

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 33
Thread images: 6

File: 1491607242904-790752821.jpg (3MB, 5312x2988px) Image search: [Google]
1491607242904-790752821.jpg
3MB, 5312x2988px
I need to come up with a formula for a personal project to fit 7 data points that are, most definitely, not in the same quadratic. Is there a reliable method or formula to solve for an equasion where n points is greater than 3? I've looked for a few days, but haven't found anything.
>>
>>8811382
Create a system like you normally would in the form Ax=b where A is your matrix with rows (0,0,1), (1,1,1), (4,2,1),...,(36,6,1), x=(a_2,a_1,a_0) where your desired quadratic is f(x)=a_2x^2+a_1x+a_0 and b=(pi,pi,...,384). However, clearly you're system is overdetermined. Compute the least square quadratic via solving x=(A*A)^(-1)A*b where A* is the transpose matrix. If this does not work, try x=(A*A+eId)^(-1)A*b where e>0 and Id is the identity matrix. Choose an e sufficiently small and you should get something reasonably close to an actual solution. Look up Tikhonov approximation if you're interested. Need functional analysis though.
>>
Y = 1.366exp(0.800X)

R^2 = 0.875

It's an ok fit but not great

Why not just use a 5th degree polynomial if you want a perfect fit?
>>
>>8811382
I'm the same guy here >>8811400. I just reread your question. What I responded with was what you should do if you only want a degree 2 approximation of those data points. If you're fine with any degree then just look up Lagrange interpolation method.
>>
The post about the Lagrange interlopation method seems like something I'll need to look into, so thank you.

I plan on using an nth degree polynomial, but I'm having problems on solving for what the equation would actually be. Hopefully >>8811407 # helps.
>>
>>8811382
you can find a polynomial of the form

[math]c_1x^7+c_2x^6+c_3x^5+c_4x^4+c_5x^3+c_6x^2+c_7x+c_8[/math]

which is guaranteed to fit all those points
>>
>>8811403 #
How would I go about solving for c? I'm somewhat new to solving for polynomials.
>>
>>8811412
I'm the same guy. >>8811407 Polynomial interpolation is pretty simple. All methods will lead to the exact same polynomial, however some representations are more useful than others. If you just look at the wiki I'm sure it will lay out the foundations for you.
>>
>>8811423
Many thanks. I'll look into it and be sure to post what I come up with. It's a decently cool project (in theory).
>>
>>8811418
construct a 7x7 system of equations, using each point. plug in the x value into "x" and y value into "y" for example your first equation would be
[math]c_1\pi^7+c_2\pi^6+c_3\pi^5+c_4\pi^4+c_5\pi^3+c_6\pi^2+c_7\pi+c_8=0[/math]

this is pretty tedious and if all you need is a reasnoble approximation w/ decimals and not closed form you can do a polynomial regression on something like desmos
>>
>>8811428
Hey boss, I think you mixed up your pi and zero.
>>
>>8811431
oh yeah i read it backwards my bad. anyway op is this what you're looking for?

https://www.desmos.com/calculator/qtwugsygr9
>>
>>8811432
As great as it is having the exact decimal answer, I need to solve in terms of pi as my formula needs to fit exactly. I appreciate the help, but it's gonna be a lot of longhand to get it done.
>>
>>8811432
Looking at the actual data, I think op would do better with taking the log of each y and getting a linear best fit. That polynomial is not attractive. What's the project's purpose OP?
>>
>>8811435
I'm working on a formula to go between certain multi dimensional objects. Call me paranoid, but I'd rather not get any more specific than that in case it actually turns out to be a good equation. I've got most of it done. I just have to account for this set of data.
>>
>>8811439
have you used any psychoactive substances within recent times? or ever?
>>
>>8811443
Lol its more sane than it sounds. I'll post the formula and its use when I'm done. I just want to be able to say I did it.
>>
>>8811444
How about the carbon monoxide detectors in your house? How are their battery levels?
>>
>>8811445
Its for use on paper only. Practically useless but theoretically neat.
>>
>>8811443
Lol, I thought that the data looked kind of weird to be related with anything practical (though that is not to say uninteresting). If I had to conjecture, I say it has got something to do with circles and the x-coordinates are dimensions. However I can't make out why the Pi's disappear for higher dimensions. Good luck with your project OP.
>>
>>8811450
You're pretty much on point if I get what you're saying. Believe it or not, it took a few tricks to get pi to appear. Made this part harder, but every other part easier. Thank you for the good wishes.
>>
File: autism equation.png (12KB, 853x202px) Image search: [Google]
autism equation.png
12KB, 853x202px
here you go. the function that maps to those points will have the form

y=bx^6+cx^5+dx^4+ex^3+fx^2+gx+h
>>
>>8811469
Dude. Thank you. Do you have any kind of contact you'd post on here?
>>
>>8811477
uh sure, i guess. you can email me at [email protected]
>>
>>8811382
take the unique polynomial of degree 6 that fits these point.

Jesus christ this isn't magic.
>>
>>8812139
If you read the thread you'd see that's what he settled on. Further, in his OP, it seemed like he wanted a least squares quadratic. That is not the case however.
>>
>>8811469
There's an easier way of doing that.
>>
>>8811382
>>8811382
you have equally spaced points. And the spacing is 1! Use the Newton polynomial.


https://en.wikipedia.org/wiki/Newton_polynomial

Very little calculation is needed.

https://en.wikipedia.org/wiki/Newton_polynomial
>>
>>8812417
Oh yeah I wrote some code for that a little while ago. Of course with so few points it hardly makes a difference.
>>
>>8811413
And have an unbounded error on the interpolated points
>>
>>8812499
It can be large but it is bounded.
>>
Though I guess maybe that's only when the original assumption that the points are from function is true?

Anyway here's an interesting example showing where the error concentrates depending on the clustering of the points.
>>
>>8811382
start with a linear equation, integrate and set your constant to be the next data point and repeat 6 times?
Thread posts: 33
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.