【发布时间】:2019-06-22 06:23:43
【问题描述】:
我有一组约 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")
【问题讨论】:
-
能否发一个完整数据集的链接?
标签: regression lm least-squares plane