Function to compute fitted values for `bamlss`

models. The function calls
`predict.bamlss`

to compute fitted values from samples.

1 2 3 4 |

`object` |
An object of class |

`model` |
Character or integer, specifies the model for which fitted values should be computed. |

`term` |
Character or integer, specifies the model terms for which fitted values are required.
Note that if |

`type` |
If |

`samples` |
Should fitted values be computed using samples of parameters or estimated parameters
as returned from optimizer functions (e.g., function |

`FUN` |
A function that should be applied on the samples of linear predictors or
parameters, depending on argument |

`nsamps` |
If the fitted |

`...` |
Arguments passed to function |

Depending on arguments `model`

, `FUN`

and the structure of the `bamlss`

model, a list of fitted values or simple vectors or matrices of fitted values.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## Not run: ## Generate some data.
d <- GAMart()
## Model formula.
f <- list(
num ~ s(x1) + s(x2) + s(x3) + te(lon,lat),
sigma ~ s(x1) + s(x2) + s(x3) + te(lon,lat)
)
## Estimate model.
b <- bamlss(f, data = d)
## Fitted values returned from optimizer.
f1 <- fitted(b, model = "mu", samples = FALSE)
## Fitted values returned from sampler.
f2 <- fitted(b, model = "mu", samples = TRUE, FUN = mean)
plot(f1, f2)
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.