I study computer science and a lot of machine learning algorithms are based on the variance of a set and I was wondering if there are know methods to find a line (or n-dimension plane) such that the line divides the set into two subsets with the minimum or maximum variance.
2026-03-25 06:02:27.1774418547
How to find a line that divides a data set with the minimum or maximum variance
62 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in LINEAR-ALGEBRA
- An underdetermined system derived for rotated coordinate system
- How to prove the following equality with matrix norm?
- Alternate basis for a subspace of $\mathcal P_3(\mathbb R)$?
- Why the derivative of $T(\gamma(s))$ is $T$ if this composition is not a linear transformation?
- Why is necessary ask $F$ to be infinite in order to obtain: $ f(v)=0$ for all $ f\in V^* \implies v=0 $
- I don't understand this $\left(\left[T\right]^B_C\right)^{-1}=\left[T^{-1}\right]^C_B$
- Summation in subsets
- $C=AB-BA$. If $CA=AC$, then $C$ is not invertible.
- Basis of span in $R^4$
- Prove if A is regular skew symmetric, I+A is regular (with obstacles)
Related Questions in COMPUTER-SCIENCE
- What is (mathematically) minimal computer architecture to run any software
- Simultaneously multiple copies of each of a set of substrings of a string.
- Ackermann Function for $(2,n)$
- Algorithm for diophantine equation
- transforming sigma notation into harmonic series. CLRS A.1-2
- Show that if f(n) is O(g(n) and d(n) is O(h(n)), then f(n) + d(n) is O(g(n) + h(n))
- Show that $2^{n+1}$ is $O(2^n)$
- If true, prove (01+0)*0 = 0(10+0)*, else provide a counter example.
- Minimum number of edges that have to be removed in a graph to make it acyclic
- Mathematics for Computer Science, Problem 2.6. WOP
Related Questions in COVARIANCE
- Let $X, Y$ be random variables. Then: $1.$ If $X, Y$ are independent and ...
- Correct formula for calculation covariances
- How do I calculate if 2 stocks are negatively correlated?
- Change order of eigenvalues and correspoding eigenvector
- Compute the variance of $S = \sum\limits_{i = 1}^N X_i$, what did I do wrong?
- Bounding $\text{Var}[X+Y]$ as a function of $\text{Var}[X]+\text{Var}[Y]$
- covariance matrix for two vector-valued time series
- Calculating the Mean and Autocovariance Function of a Piecewise Time Series
- Find the covariance of a brownian motion.
- Autocovariance of a Sinusodial Time Series
Related Questions in VARIANCE
- Proof that $\mathrm{Var}\bigg(\frac{1}{n} \sum_{i=1}^nY_i\bigg) = \frac{1}{n}\mathrm{Var}(Y_1)$
- $\{ X_{i} \}_{i=1}^{n} \thicksim iid N(\theta, 1)$. What is distribution of $X_{2} - X_{1}$?
- Reason generalized linear model
- Variance of $\mathrm{Proj}_{\mathcal{R}(A^T)}(z)$ for $z \sim \mathcal{N}(0, I_m)$.
- Variance of a set of quaternions?
- Is the usage of unbiased estimator appropriate?
- Stochastic proof variance
- Bit of help gaining intuition about conditional expectation and variance
- Variance of $T_n = \min_i \{ X_i \} + \max_i \{ X_i \}$
- Compute the variance of $S = \sum\limits_{i = 1}^N X_i$, what did I do wrong?
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
From a statistics standpoint, this would be called a Linear Modell. Although by itself it doesn't solve this exact problem, with some variation we can fit it for this issue as well.
First, order your data into ascending order. I'll the call elements in this ascending order $X_1, X_2, \ ... \ X_n$.
Now you can plot your data on the $(i, X_i)_{i \in \{1, ...,n\}}$ plane. The Linear Modell would calculate the line of least deviation on this plane, meaning the sum of all variances from this line would be minimal. This is not exactly what we're trying to do, since it's possible that most of the data will be on one side of this line, and only a few will be on the other. So let's try to find equations that would satisfy your criteria.
Let's call the axis with $(i)_{i \in \{1, ...,n\}}$ values the $x$ axis, and the axis with $(X_i)_{i \in \{1, ...,n\}}$ values the $y$ axis. Now we can setup some variables: $a \in \Bbb{R}^+, b \in \Bbb{R}$. So the (yet unknown) best fitting linear equation is: $y = ax+b$.
Now we can setup a criteria for this line to satisfy:
$$\Bigl\lvert\sum_{X_i \le ax+b}1 - \sum_{X_j \ge ax+b}1\Bigr\rvert \le 1$$
So the number of points above the line and below the line are the same, with some deviation, 1 extra point is allowed above or below the line, since if the number of points is odd, this would be unavoidable.
And our objective function is:
$$\min\Bigl(\sum_{i=1}^{n}( X_i - (ai+b))^2 \Bigr)$$
To minimalize the variance of the differences between out line and our data points. (Replace $\min$ to $\max$ if you want to maximalize - although the solution would probably be quite different.)
Now to solve this optimalization modell, I'll use a binary approximation algorithm for the values of $a$ and $b$. I highly recommend for you to draw this on a piece of paper, or else you might get lost.
Calculate the median of your data. If you have an odd number of points, this will be one exact datapoint. If you have an even number of points, this will be the average of two neighbouring points. $$\text{In the first case, this will be}\ M = (\frac{n+1}{2},X_{\frac{n+1}{2}}), \\ \text{in the second case:}\ M = (\frac{n+1}{2}, \frac{X_{\frac{n}{2}} + X_{\frac{n}{2}+1}}{2})$$
Then using M, we'll draw 2 starting lines (2 guesses for $y = ax+b$. We want the optimal line to be somewhere inbetween these). $$\text{First starting line:}\ y=M \ \text{(a horizontal line, let's name it }L_1\text{)}$$
We'll define the second starting line ($L_2$) with 2 points. Its first point is also $M$. It's second point is the one that makes it have a larger $a$ (larger gradient) out of 2 possiblities. (Calculate both of these, write up the equation for the line, and choose the one whose $a$ term is larger. If their $a$ term is equal, they will give the same line.) These possiblities are: $$(1,X_1-1) \text{, or } (n, X_n+1).$$ This gives us 2 lines ($L_1$ and $L_2$) that encompass our data points from 2 directions. We'll now rotate these lines around $M$ and see for which rotation our objective function is lower. This is the part where we'll start our binary approximation.
Calculate the line whose gradient ($a$) is the average of $L_1$'s and $L_2$'s gradients, and that goes through $M$. Call this line $L_3$.
Calculate the objective function for $L_3$, without the $min$ sign. If this is $0$, we've got our optimal line. If not, continue.
Calculate the line whose gradient ($a$) is the average of $L_1$'s and $L_3$'s and goes through $M$. Call it $L_4$. Then calculate the line whose gradient ($a$) is the average of $L_2$'s and $L_3$'s and goes through $M$. Call it $L_5$.
Compare the objective function (without the $min$ sign) for $L_4$ and $L_5$. If any of them are $0$, that's the optimal line. If not, check whether or not $L_4$'s objective function is lower than $L_5$'s. If so, delete $L_2$ and $L_5$, and set the values of $L_2$ to be $L_3$, and $L_3$ to be $L_4$ ($L_1$ stays the same). If $L_4$'s objective function is greater or equal to $L_5$'s, then delete the values of $L_1$ and $L_4$, and set the values of $L_1$ to be $L_3$, and $L_3$ to be $L_5$ ($L_2$ stays the same).
Go back to Step 5 with your new $L_1, L_2, L_3$ lines. If you've reached Step 8 (for e.g.) 100 times, call $L_3$ the solution. (It should be incredibly close to the real solution. $L_3$ is now a line that divides the dataset into 2 parts, with very close to mininal variance.)