What Is Mathematical Modeling?Mathematical modeling is the process of using formulas and equations to represent real-world situations. It helps us predict results, understand relationships between variables, and make informed decisions.Linear RegressionRegression is a statistical technique used to understand the relationship between a dependent variable (what we want to predict) and one or more independent variables (the influencing factors).Used to predict continuous values (e.g., the price of a house based on its size). Linear Regression is a statistical technique used to model the relationship between a dependent variable (what you want to predict) and one or more independent variables (the influencing factors). The central idea is to find a straight line that best fits the data, allowing you to predict future values or understand the relationship between the variables. It tries to establish a mathematical relationship between the variables, expressed by the equation:\[ Y = a X + b \]Where:Y: Dependent variable (what we want to predict).X: Independent variable (the influencing factor).a: Angular coefficient (slope of the line).b: Linear coefficient (intercept, where the line crosses the Y-axis).When to Use It?When you want to predict a continuous value (e.g., house price, future sales). When there is an apparent linear relationship between the variables.Linear Regression in ExcelThere are 2 ways to create your linear regression in Excel. The first way uses a chart and the second uses a formula. It uses the sigmoid function to map values into probabilities:Linear Regression Using a ChartIn Excel: Select the data. Go to the Insert tab > Scatter Chart. Right-click the points on the chart. Select Add Trendline. Choose Linear and check the option Display Equation on Chart. In the same window, check the Display R-squared value on chart box.Chart with trendline and R² in ExcelR² (coefficient of determination) is a measure that indicates how well the linear regression model fits the data. It ranges from 0 to 1, where: R² = 1: The model explains 100% of the variability in the data. R² = 0: The model explains none of the variability in the data.The problem with this solution is that it does not show the A and B coefficients of the Linear Regression.Linear Regression Using a FormulaThe LINEST function in Excel returns several regression statistics, including R² (some use Proj.Lin).Linest being used in Google Sheets=LINEST(B2:B10, A2:A10, TRUE, TRUE)Where:B2:B10 is the range of the dependent variable (Y).A2:A10 is the range of the independent variable (X).The third argument (TRUE) indicates that the intercept should be calculated.The fourth argument (TRUE) indicates that additional statistics should be returned.You can choose to select only Y. In this case, it will consider X as a RANGE(LEN(Y)) [1,2,3...]. And if you do not specify other arguments, the third will be considered True and the fourth False. Below is an example explicitly passing all of them:Linest with all argumentsHow to Interpret the Linest Function in ExcelThe Linest function returns a matrix of results. They mean:Slope (a)Intercept (b)Slope error (a)Intercept error (b)R²Y errorFDegrees of freedomRegression sum of squaresResidual sum of squaresIn the example, I have the following values:Slope (a): 535,789312Intercept (b): -17533,79387Slope Error (a): 6,520221579Intercept Error (b): 462,0854858R²: 0,9825390573Y Error: 2536,278195F: 6752,481182Degrees of Freedom: 120Regression Sum of Squares: 43436733514Residual Sum of Squares: 771924849,7ExercisesHouse PricesSize (m²)Price (R$)50150.00060170.00070200.00080220.00090250.000a) What is the equation of the regression line?b) A real estate agent says that a 100 m² house should cost R$ 300,000. Based on the model, is this statement reasonable? Justify.c) What is the meaning of R²?d) If R² were 0.50, what would that mean for the model?Ice Cream SalesTemperature (°C)Sales (R$)2050025800301200351500401800a) What is the equation of the regression line?b) What is the predicted sales value for a temperature of 28 °C?c) What does the angular coefficient (a) represent in this context?Student GradesStudy HoursGrade (0-10)24456788109a) What is the equation of the regression line?b) What is the predicted grade for a student who studies 7 hours?c) What is the meaning of the linear coefficient (b) in this context?d) Does it make sense for a student who does not study (0 hours) to get 2.4? Why?Production CostQuantity ProducedTotal Cost (R$)10050002008000300110004001400050017000a) What is the equation of the regression line?b) What is the predicted cost to produce 450 units?c) What does the angular coefficient (a) represent in this context?d) They are currently producing 500 units. If production increases by 50 units, how much do you expect the cost to increase?
— commentaires 0
, Réactions 1
Soyez le premier à commenter