我有大约700个点,正在尝试寻找一个到所有点的距离都最小的飞机。
head(data)
V6 V7 V8
10664 16.80 10.00 107.28
10714 24.15 5.07 108.32
10764 26.37 27.91 68.55
10814 64.15 110.30 108.90
10864 110.31 103.40 107.79
10914 105.08 99.12 69.36
plot <- scatterplot3d(data, type="p", highlight.3d=TRUE, angle=55,
scale.y=0.7, pch=16, main="Fitting a plane to N points")
reg <- lm(data)
summary(reg)返回以下输出:
Call:
lm(formula = data)
Residuals:
Min 1Q Median 3Q Max
-80.572 -38.094 -0.155 39.212 77.469
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.82248 8.20208 9.610 <2e-16 ***
V7 -0.01363 0.03754 -0.363 0.717
V8 -0.01541 0.08503 -0.181 0.856
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 44.51 on 689 degrees of freedom
Multiple R-squared: 0.0002333, Adjusted R-squared: -0.002669
F-statistic: 0.08037 on 2 and 689 DF, p-value: 0.9228
如果我将飞机添加到散点图中,则似乎无法正确安装,看起来不正确:
plot$plane3d(78.82248, -0.01363, -0.01541, lty.box = "solid")