Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying (using MATLAB) to generate the following image from the Wu Tian Chen research article 'Condition-based Maintenance Optimization Using Neural Network-based Health Condition Prediction':


The model is derived from the equation:

$$L(t) = θ' + β't + ε(t)$$

where $θ'$ is a normal random variable with mean $5$ and variance $1$, and $β'$ also be a normal random variable with mean $5$ and variance $1.5$. $ ε(t) = σW(t) $ is a centered Brownian motion such that the mean of $ε(t)$ is zero and the variance of $ε(t)$ is $σ{^2}t$. The parameters are set according to the article. The MATLAB code I have written is the following:

% Initialization:

Ts = 0;
Te = 150;
Tn = 101;
mu0         = 5;
sigma0      = 1;
mu1         = 5;
sigma1      = 1.5;
sigma       = .5;
D           = 500; % failure threshold
paths = 50; % Number of paths in accordance with the article and graph

figure, hold on, box on, grid off

t = linspace(Ts, Te, Tn)';

for i = 1:paths 
   % Generate θ':
    teta1 = (randn(Tn, 1) * sigma0) + mu0;
   % Generate β':
    beta1 = ((randn(Tn, 1) * sigma1) + mu1) .* t;

   % Generate Brownian path
    dW = sqrt(Te / Tn) * randn(Tn, 1) * 0.5;
    W = cumsum(dW, 1); % cumulative sum
    e_t = W;

   % or maybe like this?:   e_t = sigma * rand(Tn, 1) .* sqrt(sigma^2 * t);

   L = teta1 + beta1 + e_t;   
   plot(t, L);
   xlim([Ts, Te])
   ylim([0, 600])

plot([Ts, Te], [D, D], 'k')

The output of this code is very different from the original one, but I don't understand why. Could anyone help me to understand? I think the problem is around the Brownian path generation, but I cannot figure it out.

Thank you

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.