mcs_mileage.default {weibulltools} | R Documentation |
Simulation of Unknown Covered Distances using a Monte Carlo Approach
Description
This function simulates distances for units where these are unknown.
First, random numbers of the annual mileage distribution, estimated by dist_mileage, are drawn. Second, the drawn annual distances are converted with respect to the actual operating times (in days) using a linear relationship. See 'Details'.
Usage
## Default S3 method:
mcs_mileage(
x,
time,
status = NULL,
id = paste0("ID", seq_len(length(time))),
distribution = c("lognormal", "exponential"),
...
)
Arguments
x |
A numeric vector of distances covered. Use |
time |
A numeric vector of operating times. Use |
status |
Optional argument. If used, it must contain binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1). If |
id |
Identification of every unit. |
distribution |
Supposed distribution of the annual mileage. |
... |
Further arguments passed to or from other methods. Currently not used. |
Details
Assumption of linear relationship: Imagine the distance of the vehicle is unknown. A distance of 3500.25 kilometers (km) was drawn from the annual distribution and the known operating time is 200 days (d). So the resulting distance of this vehicle is
Value
A list with class wt_mcs_mileage
containing the following elements:
-
data
: Atibble
returned by mcs_mileage_data where two modifications has been made:If the column
status
exists, thetibble
has additional classeswt_mcs_data
andwt_reliability_data
. Otherwise, thetibble
only has the additional classwt_mcs_data
(which is not supported by estimate_cdf).The column
mileage
is renamed tox
(to be in accordance with reliability_data) and contains simulated distances for incomplete observations and input distances for the complete observations.
-
sim_data
: Atibble
with columnsim_mileage
that holds the simulated distances for incomplete cases and0
for complete cases. -
model_estimation
: A list returned by dist_mileage.
See Also
dist_mileage for the determination of a parametric annual mileage distribution and estimate_cdf for the estimation of failure probabilities.
Examples
# Example 1 - Reproducibility of drawn random numbers:
set.seed(1234)
mcs_distances <- mcs_mileage(
x = field_data$mileage,
time = field_data$dis,
status = field_data$status,
id = field_data$vin,
distribution = "lognormal"
)
# Example 2 - MCS for distances with exponential annual mileage distribution:
mcs_distances_2 <- mcs_mileage(
x = field_data$mileage,
time = field_data$dis,
status = field_data$status,
id = field_data$vin,
distribution = "exponential"
)
# Example 3 - MCS for distances with downstream probability estimation:
## Apply 'estimate_cdf()' to *$data:
prob_estimation <- estimate_cdf(
x = mcs_distances$data,
methods = "kaplan"
)
## Apply 'plot_prob()':
plot_prob_estimation <- plot_prob(prob_estimation)