diff options
Diffstat (limited to 'graphics/asymptote/examples/linearregression.asy')
-rw-r--r-- | graphics/asymptote/examples/linearregression.asy | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/graphics/asymptote/examples/linearregression.asy b/graphics/asymptote/examples/linearregression.asy index a1cc6ff6bc..7ec50d8fb0 100644 --- a/graphics/asymptote/examples/linearregression.asy +++ b/graphics/asymptote/examples/linearregression.asy @@ -28,13 +28,13 @@ while (!eof(duncan)) { real[] coeffs = leastsquares(independentvars, dependentvars, warn=false); if (coeffs.length == 0) { abort("Unable to find regression: independent variables are " - + "linearly dependent."); + + "linearly dependent."); } real f(pair xy) { return coeffs[0] * xy.x // income - + coeffs[1] * xy.y // education - + coeffs[2]; // residue + + coeffs[1] * xy.y // education + + coeffs[2]; // residue } real xmin = infinity, xmax = -infinity, ymin = infinity, ymax = -infinity; @@ -52,7 +52,7 @@ draw(surface(f, (xmin, ymin), (xmax, ymax)), for (int ii = 0; ii < independentvars.length; ++ii) { triple pt = (independentvars[ii][0], independentvars[ii][1], - dependentvars[ii]); + dependentvars[ii]); draw(shift(pt) * unitsphere, material(yellow, emissivepen=0.2*yellow)); real z = f((pt.x, pt.y)); if (pt.z > z) draw (pt -- (pt.x, pt.y, z), green); |