散点图与残差

散点图与残差
几何画板及绘图内容加载中,请稍等……
2016-02-07 20:42
该范例演示了如何绘制散点图,并通过最小化平方误差来拟合线性回归。核心数学概念包括线性回归、残差分析。使用了GeoGebra中的多项构造命令,如Textfield、Line、Intersect等。适合高中数学教学和学习。

GeoGebra 命令及参数

  1. Textfield(n) → inputBox1
  2. Textfield(P1) → inputBox2
  3. Textfield(P2) → inputBox3
  4. Textfield(P3) → inputBox4
  5. Max(listX) → xMax
  6. Min(listX) → xMin
  7. Max(listY) → yMax
  8. Min(listY) → yMin
  9. Textfield(P4) → inputBox5
  10. Textfield(P5) → inputBox6
  11. Textfield(P6) → inputBox7
  12. Textfield(P7) → inputBox8
  13. Textfield(P8) → inputBox9
  14. Textfield(P9) → inputBox10
  15. Textfield(P10) → inputBox11
  16. Line(A, B) → a
  17. Intersect(a, yAxis) → yInt
  18. OrthogonalLine(P1, xAxis) → v1
  19. OrthogonalLine(P2, xAxis) → v3
  20. OrthogonalLine(P3, xAxis) → v2
  21. OrthogonalLine(P4, xAxis) → v4
  22. OrthogonalLine(P5, xAxis) → v5
  23. OrthogonalLine(P6, xAxis) → v6
  24. OrthogonalLine(P7, xAxis) → v7
  25. Intersect(a, v1) → C
  26. Intersect(a, v3) → D
  27. Intersect(a, v2) → E
  28. Intersect(a, v4) → F
  29. Intersect(a, v5) → G
  30. Intersect(a, v6) → H
  31. Intersect(a, v7) → I
  32. OrthogonalLine(P8, xAxis) → v8
  33. OrthogonalLine(P9, xAxis) → v9
  34. OrthogonalLine(P10, xAxis) → v10
  35. Intersect(a, v8) → J
  36. Intersect(a, v9) → K
  37. Intersect(a, v10) → L
  38. Segment(C, P1) → q
  39. Segment(D, P2) → r
  40. Segment(E, P3) → s
  41. Segment(F, P4) → t
  42. Segment(G, P5) → a_1
  43. Segment(H, P6) → b_1
  44. Segment(I, P7) → c_1
  45. Segment(J, P8) → d_1
  46. Segment(K, P9) → e_1
  47. Segment(L, P10) → f_1
  48. Sum(B1:B2) → C2
  49. Min(listYS) → yMinS
  50. Max(listYS) → yMaxS
  51. Corner(1, 5) → corner5
  52. Polygon(E, P3, (x(P3) - (y(P3) - y(E)) / xycratio / xysratio, y(P3)), (x(P3) - (y(P3) - y(E)) / xycratio / xysratio, y(E))) → poly3T, e_2, p3, k_1, l_1
  53. Polygon(D, P2, (x(P2) - (y(P2) - y(D)) / xycratio / xysratio, y(P2)), (x(P2) - (y(P2) - y(D)) / xycratio / xysratio, y(D))) → poly2T, d_2, p2, m_1, n_1
  54. Polygon(C, P1, (x(P1) - (y(P1) - y(C)) / xycratio / xysratio, y(P1)), (x(P1) - (y(P1) - y(C)) / xycratio / xysratio, y(C))) → poly1T, c_2, p1, p_1, q_1
  55. Polygon(F, P4, (x(P4) - (y(P4) - y(F)) / xycratio / xysratio, y(P4)), (x(P4) - (y(P4) - y(F)) / xycratio / xysratio, y(F))) → poly4T, f_2, p4, r_1, s_1
  56. Polygon(G, P5, (x(P5) - (y(P5) - y(G)) / xycratio / xysratio, y(P5)), (x(P5) - (y(P5) - y(G)) / xycratio / xysratio, y(G))) → poly5T, g_2, p5, t_1, a_2
  57. Polygon(H, P6, (x(P6) - (y(P6) - y(H)) / xycratio / xysratio, y(P6)), (x(P6) - (y(P6) - y(H)) / xycratio / xysratio, y(H))) → poly6T, h_2, p6, b_2, i_2
  58. Polygon(I, P7, (x(P7) - (y(P7) - y(I)) / xycratio / xysratio, y(P7)), (x(P7) - (y(P7) - y(I)) / xycratio / xysratio, y(I))) → poly7T, i_3, p7, j_2, k_2
  59. Polygon(J, P8, (x(P8) - (y(P8) - y(J)) / xycratio / xysratio, y(P8)), (x(P8) - (y(P8) - y(J)) / xycratio / xysratio, y(J))) → poly8T, j_3, p8, l_2, m_2
  60. Polygon(K, P9, (x(P9) - (y(P9) - y(K)) / xycratio / xysratio, y(P9)), (x(P9) - (y(P9) - y(K)) / xycratio / xysratio, y(K))) → poly9T, k_3, p9, n_2, p_2
  61. Polygon(L, P10, (x(P10) - (y(P10) - y(L)) / xycratio / xysratio, y(P10)), (x(P10) - (y(P10) - y(L)) / xycratio / xysratio, y(L))) → poly10T, l_3, p10, q_2, r_2
  62. FitLineY(listP) → bf
  63. Intersect(bf, v1) → BF1
  64. Intersect(bf, v3) → BF2
  65. Intersect(bf, v2) → BF3
  66. Intersect(v4, bf) → BF4
  67. Intersect(bf, v5) → BF5
  68. Intersect(v6, bf) → BF6
  69. Intersect(v7, bf) → BF7
  70. Intersect(v8, bf) → BF8
  71. Intersect(v9, bf) → BF9
  72. Intersect(v10, bf) → BF10
  73. Polygon(BF1, P1, (x(P1) - (y(P1) - y(BF1)) / xycratio / xysratio, y(P1)), (x(P1) - (y(P1) - y(BF1)) / xycratio / xysratio, y(BF1))) → poly1B, bf1, p1_1, h_1, i_1
  74. Polygon(BF2, P2, (x(P2) - (y(P2) - y(BF2)) / xycratio / xysratio, y(P2)), (x(P2) - (y(P2) - y(BF2)) / xycratio / xysratio, y(BF2))) → poly2B, bf2, p2_1, j_1, s_2
  75. Polygon(BF3, P3, (x(P3) - (y(P3) - y(BF3)) / xycratio / xysratio, y(P3)), (x(P3) - (y(P3) - y(BF3)) / xycratio / xysratio, y(BF3))) → poly3B, bf3, p3_1, t_2, a_3
  76. Polygon(BF4, P4, (x(P4) - (y(P4) - y(BF4)) / xycratio / xysratio, y(P4)), (x(P4) - (y(P4) - y(BF4)) / xycratio / xysratio, y(BF4))) → poly4B, bf4, p4_1, b_3, c_3
  77. Polygon(BF5, P5, (x(P5) - (y(P5) - y(BF5)) / xycratio / xysratio, y(P5)), (x(P5) - (y(P5) - y(BF5)) / xycratio / xysratio, y(BF5))) → poly5B, bf5, p5_1, d_3, e_3
  78. Polygon(BF6, P6, (x(P6) - (y(P6) - y(BF6)) / xycratio / xysratio, y(P6)), (x(P6) - (y(P6) - y(BF6)) / xycratio / xysratio, y(BF6))) → poly6B, bf6, p6_1, f_3, g_3
  79. Polygon(BF7, P7, (x(P7) - (y(P7) - y(BF7)) / xycratio / xysratio, y(P7)), (x(P7) - (y(P7) - y(BF7)) / xycratio / xysratio, y(BF7))) → poly7B, bf7, p7_1, h_3, m_3
  80. Polygon(BF8, P8, (x(P8) - (y(P8) - y(BF8)) / xycratio / xysratio, y(P8)), (x(P8) - (y(P8) - y(BF8)) / xycratio / xysratio, y(BF8))) → poly8B, bf8, p8_1, n_3, p_3
  81. Polygon(BF9, P9, (x(P9) - (y(P9) - y(BF9)) / xycratio / xysratio, y(P9)), (x(P9) - (y(P9) - y(BF9)) / xycratio / xysratio, y(BF9))) → poly9B, bf9, p9_1, q_3, r_3
  82. Polygon(BF10, P10, (x(P10) - (y(P10) - y(BF10)) / xycratio / xysratio, y(P10)), (x(P10) - (y(P10) - y(BF10)) / xycratio / xysratio, y(BF10))) → poly10B, bf10, p10_1, s_3, t_3