# update

Update posterior parameter distribution of degradation remaining useful life model

## Syntax

``update(mdl,data)``

## Description

example

````update(mdl,data)` updates the posterior estimate of the parameters of the degradation remaining useful life (RUL) model `mdl` using the latest degradation measurements in `data`.```

## Examples

collapse all

Load training data, which is a degradation feature profile for a component.

`load('expRealTime.mat')`

For this example, assume that the training data is not historical data. When there is no historical data, you can update your degradation model in real time using observed data.

Create an exponential degradation model with the following settings:

• Arbitrary $\theta$ and $\beta$ prior distributions with large variances so that the model relies mostly on observed data

• Noise variance of `0.003`

```mdl = exponentialDegradationModel('Theta',1,'ThetaVariance',1e6,... 'Beta',1,'BetaVariance',1e6,... 'NoiseVariance',0.003);```

Since there is no life time variable in the training data, create an arbitrary life time vector for fitting.

`lifeTime = [1:length(expRealTime)];`

Observe the degradation feature for 10 iterations. Update the degradation model after each iteration.

```for i=1:10 update(mdl,[lifeTime(i) expRealTime(i)]) end```

After observing the model for some time, for example at a steady-state operating point, you can restart the model and save the current posterior distribution as a prior distribution.

`restart(mdl,true)`

View the updated prior distribution parameters.

`mdl.Prior`
```ans = struct with fields: Theta: 2.3555 ThetaVariance: 0.0058 Beta: 0.0722 BetaVariance: 3.6362e-05 Rho: -0.8429 ```

## Input Arguments

collapse all

Degradation RUL model, specified as a `linearDegradationModel` object or an `exponentialDegradationModel` object. `update` updates the posterior estimates of the degradation model parameters based on the latest degradation feature measurements in `data`.

For a `linearDegradationModel`, the updated parameters are `Theta` and `ThetaVariance`.

For an `exponentialDegradationModel`, the updated parameters are `Theta`, `ThetaVariance`, `Beta`, `BetaVariance`, and `Rho`.

`update` also sets the following properties of `mdl`:

• `InitialLifeTimeValue` — The first time you call `update`, this property is set to the life time value in the first row of `data`.

• `CurrentLifeTimeValue` — Each time you call `update`, this property is set to the life time value in the last row of `data`.

• `CurrentMeasurement` — Each time you call `update`, this property is set to the feature measurement value in the last row of `data`.

Degradation feature measurements, specified as one of the following:

• Two-column array — The first column contains life time values and the second column contains the corresponding degradation feature measurement.

• `table` or `timetable` object that contains variables with names that match the `LifeTimeVariable` and `DataVariables` properties of `mdl`.

## Version History

Introduced in R2018a