compiles template and create nll and gradient
1 |
formula |
A formula in expression form of "y ~ model" |
start |
A list of initial values for the parameters |
links |
links function and the model parameter |
parameters |
A list of linear submodels and random effects set.seed(123) x <- runif(20, 1, 10) y <- rnorm(20, mean = 1.8 + 2.4 * x, sd = exp(0.3)) form <- y ~ dnorm(b0 + b1 * x, log_sigma) links <- c(b0 = "identity", b1 = "identity", sigma = "log") start <- list(b0 = 1, b1 = 2, log_sigma = log(sd(y))) TMB_template(form, start = start, links = links, data = list(x = x, y = y)) ff <- TMB_mkfun(form, start = start, links = links, data = list(x = x, y = y)) |
data |
A list of parameter in the formula with values in vectors |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.