1
$\begingroup$

I have a set of machines and I am trying to simulate the occurrence of maintenance jobs for the set of machines. I have a fitted Weibull distribution for the time between occurrences of maintenance jobs and for each machine at the start of simulation I know how long since the last occurrence of a maintenance job at that machine. What I would like to know is how to simulate the occurrences of jobs, over the next $n$ timesteps, given the distributions and initial times since last maintenance done. I have identified a couple of approaches.

Approach 1

The survival function $S(t)$ gives a probability that an event has not occurred by time $t$. What I want to calculate is the probability that a machine requires maintenance in the next day given that $t_0$ days have already passed. I.e.

$P(\text{maintenance tomorrow}|t_{0} \text{days since last maintenance})$.

Therefore, I want to calculate

\begin{align} P(\text{maintenance tomorrow}|t_{0} \text{days since last maintenance})=1-\frac{S(t_{0}+1)}{S(t_{0})} \end{align}

for each machine. To incorporate this in a simulation of $n$ timesteps, I calculate the probability for each machine which sets a threshold. Then I use a random number generateor to generate numbers between 0 and 1, if the number is below the threshold then I say an event happens. If an event happens then $t_{0}$ resets to 0. If an event doesn't happen then we say $t_{0}=t_{0}+1$ and repeat the calculation. We do this for all $n$ timesteps.

Is this a valid method and if not what adjustments should I make? By calculating the probabilities and using the random number generator at each timestamp am I artificially increasing the chance of saying a machine needs maintenance, because I am essentially "drawing from a bag" multiple times until I get the result I want?

Approach 2

I draw random samples of lifetimes for the distributions for each machine. If that lifetime $t^{\max}$ lies within the timescale of the simulation, i.e. $t_{0}+n$, then we can say that a maintenance job happens at that machine at at time of $t^{\max}-t_{0}$. My instinct is that this approach isn't correct because it doesn't take account of the time since last maintenance for each machine and it also doesn't allow for multiple occurrences of maintenance at a machine in one simulation length.

Any help on these would be really appreciate. I apologise if this isn't the correct forum for this, any guidance for which one would be much appreciated.

$\endgroup$

1 Answer 1

1
$\begingroup$

I don't see a problem with Approach 1, except that it doesn't allow for multiple events in the same day. I assume that multiple events in a single day have very low probability.

If you "generate numbers between 0 and 1" from a uniform distribution between those limits, you are proceeding is a way consistent with survival simulations in more complex scenarios in continuous time. Then one samples from a uniform distribution in [0,1] and finds the time that corresponds to that survival probability, given the survival model. See for example this page, this page, or the R simsurv vignette.

Here, you are sampling from a uniform distribution in [0,1] and using the result to see whether that probability corresponds, given your model, to an event in the discrete time interval of the next day. You aren't "'drawing from a bag' multiple times until I get the result I want" provided that sampling from the [0,1] range is independent for each time period. Standard survival analysis assumes that the event eventually happens to all machines/individuals, so if finding an event is "the result I want" you certainly should ultimately end up with that result.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.