绘制最佳拟合线
几何画板及绘图内容加载中,请稍等……
本范例通过视觉辅助,让学生估算最小二乘回归线。它涉及统计学中的核心概念,如线性回归。通过使用 GeoGebra 命令如 Random, Line, Polygon, Intersect, Point, Sequence, Zip, FitLineY, Sum, PMCC,学生可以理解如何构建最佳拟合线。适合高中及以上学生学习线性回归和统计分析。
GeoGebra 命令及参数
Random(0, 1) → list3Line(If[Element[list2, 1] ≟ 1, (0, list3 * 5 + RandomUniform[0, 5]), (RandomUniform[0, 8], list3 * 10)], If[Element[list2, 2] ≟ 1, (16, 5 * (1 - list3) + RandomUniform[0, 5]), (8 + RandomUniform[0, 8], 10 - 10 * list3)]) → fPolygon((-1, -1), (-1, 10), (16, 10), (16, -1)) → poly1, b, c, d, eIntersect(f, poly1) → F, GPoint(poly1) → DPoint(poly1) → ELine(D, E) → gSequence(RandomUniform[x(F) + n, x(G)], t, 1, Random[8, 17]) → list1Zip((A, Slope[f] * A + y(Intersect[f, yAxis]) + RandomUniform[-Random[0, 3] + n, RandomUniform[0, 3]]), A, list1) → list4FitLineY(list4) → hZip((x(A), x(A) * Slope[g] + y(Intersect[g, yAxis])), A, list4) → list5Zip(Segment[A, B], A, list4, B, list5) → list6Zip(Polygon[A, B, 4], A, list4, B, list5) → list7Sum(Zip[Polygon[B, (A, Slope[h] * A + y(Intersect[h, yAxis])), 4], A, list1, B, list4]) → list8PMCC(list4) → r
AI 绘图提示语参考
绘制一条最佳拟合直线,首先生成一些随机点,然后通过这些点画出一条直线。接着,用这些点和直线来估计最佳拟合直线,并绘制出拟合直线与原直线之间的误差段,最后计算这些点的相关系数。
以上提示语为根据原始绘图命令整理而来,仅供参考。