I'm working with a statistical linear model where I have a variable, ( N ), representing the percentage of charging of a battery. Based on ( N ), I derive another variable, Charging_level
, with the following conditions:
- If \( N = 0 \), `Charging_level = 0`.
- If \( 0 < N \leq 20 \), `Charging_level = 1`.
- If \( 20 < N \leq 40 \), `Charging_level = 2`.
- If \( 40 < N \leq 80 \), `Charging_level = 3`.
- If \( 80 < N \leq 100 \), `Charging_level = 4`.
I have 4 distinct levels of charging: 1, 2, 3, and 4. The statiscal model use indicator variables (coefficients per level), where one level is set to 1 and the others are set to 0, and hence can provide prediction.
I should note that I am optimizing over N (tradeoff between charging to full and other budget constraints), I'm seeking an efficient way to represent the Charging_level
variable. I've come across the Big-M method, which I know is used for basic if-else conditions, but I'm unsure how to apply it to my scenario with multiple levels.
Is there a straightforward method for representing this multi-level categorical variable using the Big-M method? Or are there alternative approaches that might be more suitable?