使飞机适合3D的许多点

时间:2019-06-21 16:59:32

标签: regression lm least-squares plane

我有大约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")

See the image here

1 个答案:

答案 0 :(得分:0)

我已经独立验证-根据您的散点图-该数据集是两个平行的平面点云,请参见下图。当我拟合平面方程“ V8 = a +(b * V6)+(c * V7)”时,得到参数a = 8.8327170551088543E + 01,b = -3.0935322191121724E-03,c = -1.4075477287696175E -02

plot