Help us understand the problem. What is going on with this article?

# R: dlmMLE usage

More than 5 years have passed since last update.

This is the tool to help us with the M step.
This is connected to optim, so we can use that as well.
We are still using the model

```x_0 ~ N(m0, C0)
x_t = GG x_{t-1} + w_t v_t ~ N(0, W)
Y_t = FF x_t + v_t w_t ~ N(0, V)
```

function dlmMLE

```Input:

Data:
The time series data.

Parameters:
The parameters subject to the Likelihood optimization

build:
function that returns a dlm object. That is,
build=function(x) will make the objective       function the likelihood function of the dlm governed by parameter x.
```

Example:

```buildTest <- function(x){
m <- dlmModPoly(1, dV = exp(x[1]))
m\$JW  <- matrix(1)
m\$X <- matrix(exp(x[2]), nc = 1, nr = length(Nile))
j <- which(time(Nile) == 1899)
m\$X[j,1] <- m\$X[j,1] * (1+ exp(x[3]))
return(m)
}
```

buildTest will give me dlm dependent on three parameters, in which W is given by
exp(x[2])*(1+ exp(x[3])).

Why not register and get more from Qiita?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away