Binary variables (Absolute values)

  • #1
Rev. Cheeseman
323
20
TL;DR Summary
The value is from 0 to 1, but what do these 2s represent?
Hello,

According to https://www.fico.com/fico-xpress-op.../mipform/dhtml/chap2s1.html?scroll=ssecabsval the formula for absolute values are :

y = | x1 - x2| for two variables x1, x2 with 0 ≤ xi ≤ U

Introduce binary variables d1, d2 to mean
d1 : 1 if x1 - x2 is the positive value
d2 : 1 if x2 - x1 is the positive value

MIP formulation
0 ≤ xi ≤ U [1.i]
0 ≤ y - (x1-x2) ≤ 2 · U · d2 [2]
0 ≤ y - (x2-x1) ≤ 2 · U · d1 [3]
d1 + d2 = 1 [4]

Notice the bolded 2s above in the MIP formulation section, what do these 2s represent? I thought the range of the value is just 0 to 1.
 
Physics news on Phys.org
  • #2
Consider [tex]
y - (x_1 - x_2) = |x_1 - x_2| - (x_1-x_2) = \begin{cases}
0 & x_1 \geq x_2\quad (d_2 = 0)\\
2|x_1 - x_2| & x_1 < x_2\quad (d_2 = 1).\end{cases}[/tex] Therefore [itex]0 \leq y - (x_1 - x_2) \leq 2Ud_2[/itex].
 
  • #3
pasmith said:
Consider [tex]
y - (x_1 - x_2) = |x_1 - x_2| - (x_1-x_2) = \begin{cases}
0 & x_1 \geq x_2\quad (d_2 = 0)\\
2|x_1 - x_2| & x_1 < x_2\quad (d_2 = 1).\end{cases}[/tex] Therefore [itex]0 \leq y - (x_1 - x_2) \leq 2Ud_2[/itex].

Ok, I'm sorry if I sounds ignorant but the range of value is still 0 to 1, and not from 0 to 1 and then 2. Correct?
 

FAQ: Binary variables (Absolute values)

What is a binary variable?

A binary variable is a type of variable that can take on one of two possible values, typically represented as 0 and 1. These values can also be interpreted as true/false, yes/no, or other dichotomous pairs.

What is the absolute value of a binary variable?

The absolute value of a binary variable is the variable itself because binary variables can only be 0 or 1. The absolute value of 0 is 0, and the absolute value of 1 is 1.

How are binary variables used in statistical analysis?

Binary variables are often used in statistical analysis to represent categorical data with two categories. They are used in logistic regression, decision trees, and other statistical models to analyze relationships and make predictions based on binary outcomes.

Can binary variables be used in machine learning?

Yes, binary variables are frequently used in machine learning, especially in classification problems. They are used to represent features or target outcomes that have two distinct states, enabling algorithms to learn patterns and make predictions based on those states.

How do you handle binary variables in data preprocessing?

In data preprocessing, binary variables are often encoded as 0 and 1. This can be done using techniques like label encoding or one-hot encoding. Ensuring that binary variables are properly encoded helps machine learning models interpret and utilize the data effectively.

Similar threads

Back
Top