A company with a fleet of trucks faces increasing maintenance costs as the age and mileage of the trucks increase.
Mininmizing the total cost of maintenance of the trucks and the cost of replacing old trucks
Variables: 1)Number of trucks 2)Replacement cost of a truck 3)Total amount of work required of the fleet. 4)Variables for each truck: age, mileage
Type of loadings on the truck.
Number of trucks in the fleet
Our model at this point is simply modeling the increasing costs of maintaining an aging fleet of vehicles, and trying to minimize that cost. The dependent variables would be the mileage for each truck. The total amount of work required of the fleet would be a constraint, and work would be allocated among trucks of varying age and mileage.
If the maintenance costs are growing increasing,then replacing the truck would make more sense.
I would collect the maintenance cost of each truck and use it to model relationship between age and mileage. The model would give me expected maintenance cost for each truck
In problems 7-12, determine whether the data set supports the stated proportionality model.
\[ y \propto x^3 \]
library(reshape2)
library(ggplot2)
q11data <- data.frame(y=c(0,1,2,6,14,24,37,58,82,114), x=c(1,2,3,4,5,6,7,8,9,10))
q11data$ypred <- q11data$x^3
q11data$k <- q11data$y/q11data$ypred
k <- mean(q11data$k)
kadj <- mean(tail(q11data$k, -1))
q11data$ypredk <- k*(q11data$x^3)
q11data$ypredkadj <- kadj*(q11data$x^3)
q11data
## y x ypred k ypredk ypredkadj
## 1 0 1 1 0.00000000 0.0963571 0.1070634
## 2 1 2 8 0.12500000 0.7708568 0.8565076
## 3 2 3 27 0.07407407 2.6016417 2.8907130
## 4 6 4 64 0.09375000 6.1668545 6.8520605
## 5 14 5 125 0.11200000 12.0446376 13.3829307
## 6 24 6 216 0.11111111 20.8131338 23.1257042
## 7 37 7 343 0.10787172 33.0504856 36.7227618
## 8 58 8 512 0.11328125 49.3348356 54.8164840
## 9 82 9 729 0.11248285 70.2443265 78.0492517
## 10 114 10 1000 0.11400000 96.3571009 107.0634454
library(reshape2)
library(ggplot2)
ggplot(melt(q11data, id=c("x", "k", "ypred", "ypredk")), aes(x=x, y=value, color=variable)) +
geom_point()
This data set supports the stated proportionality model. The graph is based on an adjusted k, where I took the mean of the calculated constant disregarding the first 0 value.
LumberCuttersâLumbercutterswishtousereadilyavailablemeasurementstoestimate the number of board feet of lumber in a tree. Assume they measure the diameter of the tree in inches at waist height. Develop a model that predicts board feet as a function of diameter in inches.
Use the following data for your test:
x <- c(17, 19, 20, 23, 25, 28, 32, 38, 39, 41)
y <- c(19, 25, 32, 57, 71, 113, 123, 252, 259, 294)
data <- data.frame(x, y)
The variable x is the diameter of a ponderosa pine in inches, and y is the number of board feet divided by 10. a. Consider two separate assumptions, allowing each to lead to a model. Completely analyze each model. i. Assume that all trees are right-circular cylinders and are approximately the same height.
The characteristic dimension of a cylinder is the diameter dd. The number of board feet is a function of the volume which is given by V=Ïr2hV=Ïr2h. Assuming that the radius is proportional to the diameter, we derive:
Vâr2âd2 Vâr2âd2
where hh is constant since all trees are the same height.
For this model we assume that all trees are of the same height so the volume is a function of the diameter squared which is the xx variable.
Vâd2 Vâd2 or yâx2 yâx2
where y=boardfeety=boardfeet and x=diameterx=diameter
Using this, we calculate proportionality using:
yâx2yâx2 if and only if y = kx^2 for a constant kk which leads to yâx2yâx2
Calculate the ratio of y/x^2
data$ratio <- data$y/data$x^2
k <- (mean(data$ratio))
data$predicted <- k*data$x^2
df <- rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
data.frame(value = 'Predicted', x = data$x, y = data$predicted))
ggplot(df, aes(x=x, y=y, color=value)) + geom_line()
For this model we assume that the height of the tree is proportional to the diameter. From above, we have volume is proportional to diameter squared (Vâd2Vâd2). In this problem, we are to assume that hh is proportional to the diameter.
Vâd2âhâd3 Vâd2âhâd3
Therefore the volume of each tree is a proportional to the diameter cubed or Vâd3Vâd3.
yâx3 yâx3
where y=boardfeety=boardfeet and x=diameter
x <- c(17, 19, 20, 23, 25, 28, 32, 38, 39, 41)
y <- c(19, 25, 32, 57, 71, 113, 123, 252, 259, 294)
data <- data.frame(x, y)
data$ratio <- data$y/data$x^3
k <- mean(data$ratio)
data$predicted <- k*data$x^3
df <- rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
data.frame(value = 'Predicted', x = data$x, y = data$predicted))
ggplot(df, aes(x=x, y=y, color=value)) + geom_line()
The second model appears to be better. The fit of the model appears to be more accurate than compared to the first.