Polynomial regression I: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (New page: <jsxgraph width="700" height="500"> data = "406.60 428.50 429.30 426.30 434.70 415.90 419.00 408.80 410.10 408.30 420.40 415.20 409.70 408.90 411.00 410.60 409.60 409.50 409.80 413.00...) |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 18: | Line 18: | ||
for(i=0;i<len;i++) { this.dataY[i] = s.Value()*data[i]; } | for(i=0;i<len;i++) { this.dataY[i] = s.Value()*data[i]; } | ||
} | } | ||
regressionPolynomial = JXG.Math.Numerics.regressionPolynomial(deg,datax,curve.dataY); // generateFunction(); | |||
reg = brd.createElement('functiongraph',[regressionPolynomial],{strokeColor:'black'}); | |||
brd.createElement('glider',[100,30,reg],{strokeColor:'black'}); | |||
regD = brd.createElement('functiongraph',[brd.D(regressionPolynomial)],{strokeColor:'red'}); | |||
t = brd.createElement('text',[20,40, | |||
function(){ return "r(x) = " + regressionPolynomial.getTerm();} | |||
], | |||
{strokeColor:'black',fontSize:'14px'}); | |||
</jsxgraph> | </jsxgraph> | ||
===The underlying JavaScript code=== | |||
<source lang="xml"> | |||
</source> | |||
[[Category:Examples]] |