In: Finance
We have been given the history of shipping costs below. You have been asked to calculate a linear trend line for this data.
What is the intermediate solution for the value of b? (Your answer should be an integer)
Week | Costs |
1 | 466965 |
2 | 433500 |
3 | 548436 |
4 | 557338 |
Solution:
The linear trend line for cost forecast is represented by the following equation
y = a + b *x
Where y= Dependent Variable (cost) and x= Independent Variable (week)
And a is the y-intercept of the line and b is the slope of the line.
Formula to calculate the a and b are following
Slop b = (n * Σxy – Σx * Σy) / {n * Σ(x^2) - (Σx) ^2}
Intercept a = (Σy – b * Σx) / n
Where,
n is number of period = 4
Σy is the sum of total costs
Σx is the sum of weeks
Σxy is the sum of total costs * weeks
Σx^2 is the sum of squares of weeks
x | y | xy | x^2 | |
1 | 466965 | 466965 | 1 | |
2 | 433500 | 867000 | 4 | |
3 | 548436 | 1645308 | 9 | |
4 | 557338 | 2229352 | 16 | |
Sum = | 10 | 2006239 | 5208625 | 30 |
n = | 4 | |||
Slop b = (n * Σxy – Σx * Σy) / {n * Σ(x^2) - (Σx)^2} = | 38605.5 | |||
Intercept a = (Σy – b * Σx) / n = | 405046 |
The linear trend line is Y = 405046 + 38605.5X
The intermediate solution for the value of b
Slop b = (n * Σxy – Σx * Σy) / {n * Σ(x^2) - (Σx) ^2}
= (4 * 5208625 – 10 * 2006239) / {4 * 30 - (10) ^2}
= 38605.5