Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 416225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:27:33+00:00 2026-05-12T18:27:33+00:00

I have a simple question: given p points (non-collinear) in R^p i find the

  • 0

I have a simple question:
given p points (non-collinear) in R^p i find the hyperplane passing by these points (to help clarify i type everything in R):

p<-2
x<-matrix(rnorm(p^2),p,p)
b<-solve(crossprod(cbind(1,x[,-2])))%*%crossprod(cbind(1,x[,-2]),x[,2])

then, given a p+1^th points not collinear with first p points, i find the direction perpendicular to b:

x2<-matrix(rnorm(p),p,1)
b2<-solve(c(-b[-1],1)%*%t(c(-b[-1],1))+x2%*%t(x2))%*%x2

That is, b2 defines a p dimensional hyperplane perpendicular to b and passing by x2.
Now, my questions are:

The formula comes from my interpretation of this wikipedia entry (“solve(A)” is the R command for A^-1). Why this doesn’t work for p>2 ? What am i doing wrong ?

PS: I have seen this post (on stakeoverflow edit:sorry cannot post more than one link) but somehow it doesn’t help me.

Thanks in advance,

i have a problem implementation/understanding of Liu’s solution when p>2:

shouldn’t the dot product between the qr decomposition of the sweeped matrix and the direction of the hyperplane be 0 ? (i.e. if the qr vectors are perpendicular to the hyperplane)

i.e, when p=2 this

c(-b[2:p],1)%*%c(a1)

gives 0. When p>2 it does not.


Here is my attempt to implement Victor Liu’s solution.

a) given p linearly independent observations in R^p:

p<-2;x<-matrix(rnorm(p^2),p,p);x
      [,1]       [,2]
[1,] -0.4634923 -0.2978151
[2,]  1.0284040 -0.3165424

b) stake them in a matrix and subtract the first row:

a0<-sweep(x,2,x[1,],FUN="-");a0
        [,1]        [,2]
[1,] 0.000000  0.00000000
[2,] 1.491896 -0.01872726

c) perform a QR decomposition of the matrix a0. The vector in the nullspace is the direction im looking for:

qr(a0)
          [,1]       [,2]
[1,] -1.491896 0.01872726
[2,]  1.000000 0.00000000

Indeed; this direction is the same as the one given by application of the formula from wikipedia (using x2=(0.4965321,0.6373157)):

       [,1]
[1,]  2.04694853
[2,] -0.02569464

…with the advantage that it works in higher dimensions.

I have one last question: what is the meaning of the other p-1 (i.e. (1,0) here) QR vector when p>2 ?
-thanks in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:27:34+00:00Added an answer on May 12, 2026 at 6:27 pm

    A p-1 dimensional hyperplane is defined by a normal vector and a point that the plane passes through:

    n.(x-x0) = 0
    

    where n is the normal vector of length p, x0 is a point through which the hyperplane passes, . is a dot product, and the equation must be satisfied for any point x on the plane. We can also write this as

    n.x = p
    

    where p = n.x0 is just a number. This is a more compact representation of a hyperplane, which is parameterized by (n,p). To find your hyperplane, suppose your points are x1, …, xp.
    Form a matrix A with p-1 rows and p columns as follows. The rows of p are xi-x1, laid out as rows vectors, for all i>1 (there are only p-1 of them). If your p points are not “collinear” as you say (they need to be affinely independent), then matrix A will have rank p-1, and a nullspace dimension of 1. The one vector in the nullspace is the normal vector of the hyperplane. Once you find it (call it n), then p = n.x1. In order to find the nullspace of a matrix, you can use a QR decomposition (see here for details).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A little stuck here. I have a simple question I guess. Given the following
simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is
I have simple type Question : public class Question { public string[] Tags {
I have simple question. User supplies URL to my PHP script where I fetch
I have a simple question, but I'm about 80% sure that the answer to
I have a simple question that I am posing mostly for my curiousity. What
i have pretty simple simple question (i hope so). How do i change the
I have a simple question concerning Javascript. I am trying to print in a
I have a simple question how do I remove a \ with regex? Thanks
I have a simple question. I am trying to design a simple Android app,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.