JPhrases/Approximation

From J Wiki
Jump to: navigation, search

10E. Approximation

d0=: ^.@] ^@(] +/ .* %.) 1:,.[ Exponential fit of x and y
d1=: ] (] +/ .* %.) 1: ,. [ Linear least squares fit of x and y
d2=: [: ^ 1&,.@[ %.~ ^.@] a and b such that y is approx. a * b^x^
d3=: 1&,.@[ %.~ ] a and b such that y is approx. a + b*x