[R] fitting plane to 3dim set of data

David Winsemius dwinsemius at comcast.net
Sun Mar 18 18:27:56 CET 2012


On Mar 17, 2012, at 9:45 AM, phi771 wrote:

> Hello!
>
> I have a problem creating a fitting plane through my 3d-data set.  
> here is a
> sample how my set looks like (x,y,z (with z increasing)):
>
>> dataset
>          [,1]             [,2]     [,3]
>  [1,] -1.3712 -3.1551   10
>  [2,] -1.2690 -3.0751   10
>  [3,] -1.1216 -2.9768   10
>  [4,] -0.9875 -2.8987   10
>  [5,] -0.4021 -2.7542   10
>  [6,]  0.0048 -2.6568   10
>  [7,]  0.1642 -2.6071   10
>  [8,]  0.0720 -2.5816   10
>  [9,] -0.2961 -2.5552   10
> [10,] -0.7770 -2.5118   10
> [11,] -1.0970 -2.4508   10
> [12,] -1.2456 -2.3786   10
> [13,] -1.4179 -2.3276   10
> [14,] -1.7759 -2.2667   10
> [15,] -2.2801 -3.4330   11
> [16,] -2.0254 -3.3232   11
> [17,] -1.8960 -3.2282   11
> [18,] -1.7148 -3.1101   11
> [19,] -1.5559 -3.0150   11
> [20,] -0.8677 -2.8460   11
> [21,] -0.3568 -2.7250   11
> [22,] -0.1721 -2.6692   11
> [23,] -0.2951 -2.6373   11
> [24,] -0.7103 -2.5965   11
> [25,] -1.3342 -2.5458   11
> [26,] -1.6955 -2.4662   11
> [27,] -1.8697 -2.3821   11
> [28,] -2.0863 -2.3138   11
> [29,] -2.4981 -2.2376   11
> [30,] -3.0639 -3.6329   12
> [31,] -2.7939 -3.5062   12
> [32,] -2.5782 -3.3798   12
> [33,] -2.3708 -3.2439   12
> [34,] -2.1916 -3.1285   12
> [35,] -1.3914 -2.9368   12
> [36,] -0.7883 -2.7911   12
> [37,] -0.5625 -2.7263   12
> [38,] -0.6858 -2.6882   12
> [39,] -1.2123 -2.6343   12
> [40,] -1.9606 -2.5708   12
> [41,] -2.3586 -2.4765   12
> [42,] -2.5972 -2.3738   12
> [43,] -2.7832 -2.2905   12
> [44,] -3.3004 -2.1983   12
> [45,] -3.8862 -3.8286   13
> [46,] -3.5691 -3.6789   13
> [47,] -3.3333 -3.5338   13
> [48,] -3.0851 -3.3760   13
> [49,] -2.8812 -3.2451   13
> [50,] -1.9070 -3.0168   13
> [51,] -1.2529 -2.8556   13
> [52,] -0.9685 -2.7769   13
> [53,] -1.1275 -2.7322   13
> [54,] -1.7272 -2.6625   13
> [55,] -2.5896 -2.5866   13
> [56,] -3.0374 -2.4728   13
> [57,] -3.3758 -2.3541   13
> [58,] -3.5959 -2.2514   13
> [59,] -4.1466 -2.1419   13
> [60,] -4.8565 -4.0770   14
> [61,] -4.5154 -3.9081   14
> [62,] -4.1926 -3.7312   14
> [63,] -3.8720 -3.5449   14
> [64,] -3.6627 -3.3992   14
> [65,] -2.5851 -3.1462   14
> [66,] -1.7868 -2.9548   14
> [67,] -1.4638 -2.8651   14
> [68,] -1.6493 -2.8082   14
> [69,] -2.3455 -2.7232   14
> [70,] -3.3572 -2.6257   14
> [71,] -3.8678 -2.4903   14
> [72,] -4.1988 -2.3545   14
> [73,] -4.5039 -2.2328   14
> [74,] -5.0707 -2.1091   14
>
> i want to have an analytical expression of a plane, which is smooth  
> and
> connects all data points.

I see that collection of requirements as being mutually exclusive for  
every case except the degenerate case where all points are on the  
plane. Is this homework? What are the requirements if this is a real  
problem?

Answers might involve one or more of these functions:

?lm
?persp
?lattice::wireframe
?rgl::plot3d
?car::scatter3d

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list