Linear Regression - Power Grid Optimization

Linear Models DS practice problem on Onlearn.

Difficulty: medium.

Topics: Understanding Linear Regression - Power Grid Optimization, Ordinary Least Squares, Periodic Function Removal, Trend Extrapolation, Safety Margin Calibration, Residual Analysis, Supervised Learning, Time Series Analysis, Numerical Analysis, Statistical Inference, Data Preprocessing, Linear Regression, Signal Decomposition, Feature Engineering, Error Analysis, Predictive Modeling.

It is the year 2157. Mars has its first thriving colony, and energy consumption is steadily on the rise. As the lead data scientist, you have daily power usage measurements (10 days) affected by both a growing linear trend and a daily fluctuation. The fluctuation follows the formula fᵢ = 10 x sin(2π x i / 10), where i is the day number (1 through 10). Your challenge is to remove this known fluctuation from each data point, fit a linear regression model to the detrended data, predict day 15's base consumption, add back the fluctuation for day 15, and finally include a 5% safety margin. The final answer must be an integer, ensuring you meet the colony's future needs.