Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw hyperplane in R?

Tags:

plot

r

How does one go about drawing an hyperplane (given the equation) in 3D in R ? (i.e. 3d equivalent to "abline")

Thanks in advance,

like image 584
user189035 Avatar asked Nov 01 '09 19:11

user189035


People also ask

How do you plot hyperplane?

Plot Decision Boundary Hyperplane The hyperplane is the decision-boundary deciding how new observations are classified. Specifically, any observation above the line will by classified as class 0 while any observation below the line will be classified as class 1.

What is the hyperplane in R 3?

In R3 hyperplanes are “ordinary” planes. Lines and hyperplanes are two kinds of “flat”subsets of Rn.

What is hyperplane formula?

We all know the equation of a hyperplane is w. x+b=0 where w is a vector normal to hyperplane and b is an offset.

Is hyperplane a 3d?

In geometry, a hyperplane is a subspace whose dimension is one less than that of its ambient space. For example, if a space is 3-dimensional then its hyperplanes are the 2-dimensional planes, while if the space is 2-dimensional, its hyperplanes are the 1-dimensional lines.


2 Answers

You probably want the packages scatterplot3d or HH (function regr2.plot). See, e.g., this example for scatterplot3d.

like image 140
rcs Avatar answered Sep 22 '22 00:09

rcs


Lattice supports 3D charts. See some of the nice examples from Lattice: Multivariate Data Visualization with R on the LearnR blog. For instance, with wireframe():

pl <- wireframe(fit.linear + fit.loess.1 + fit.loess.2 +
+     fit.locfit ~ wind * temperature | radiation, grid,
+     outer = TRUE, shade = TRUE, zlab = "")

like image 39
Shane Avatar answered Sep 21 '22 00:09

Shane