R: Plotting BAMLSS

plot.bamlss {bamlss} | R Documentation

## Plotting BAMLSS

### Description

Plotting methods for objects of class `"bamlss"` and `"bamlss.results"`, which can be used for producing effect plots of model terms, trace plots of samples or residual plots. Note that effect plots of model terms with more than two covariates are not supported, for this purpose use function `predict.bamlss`.

### Usage

    ## S3 method for class 'bamlss'
    plot(x, model = NULL, term = NULL,
      which = "effects", parameters = FALSE,
      ask = dev.interactive(), spar = TRUE, ...)

    ## S3 method for class 'bamlss.results'
    plot(x, model = NULL, term = NULL,
      ask = dev.interactive(), scale = 1, spar = TRUE, ...)

### Arguments

`x` | An object of class `"bamlss"` or `"bamlss.results"`.
`model` | Character or integer. For which model should the plots be created?
`term` | Character or integer. For which model term should a plot be created?
`which` | Character or integer, selects the type of plot: `"effects"` produces effect plots of smooth model terms, `"samples"` shows trace plots of samples, `"hist-resid"` shows a histogram of residuals (see also `residuals.bamlss` for the different available types), `"qq-resid"` shows a quantile-quantile plot of residuals, `"scatter-resid"` shows a scatter plot of residuals with fitted values for the distribution mean (if available in the family object), `"max-acf"` shows an `acf` plot of the maximum autocorrelation of all parameter samples.
`parameters` | For trace plots of parameters, should corresponding parameter values as returned from an optimizer function (e.g., `opt_bfit`) be added as horizontal lines?
`ask` | For multiple plots, the user is asked to show the next plot.
`scale` | If set to `1`, effect plots all have the same scale on the y-axis. If set to `0` each effect plot has its own scale for the y-axis.
`spar` | Should graphical parameters be set?
`...` | Arguments to be passed to `plot2d`, `plot3d`, `sliceplot`, `plotblock`, `plotmap` and `residuals.bamlss`.

### See Also

`bamlss`, `results.bamlss.default`, `residuals.bamlss`.

### Examples

    ## Not run: ## Generate some data.
    d <- GAMart()

    ## Model formula.
    f <- list(
      num ~ s(x1) + s(x2) + s(x3) + te(lon,lat),
      sigma ~ s(x2) + te(lon,lat)
    )

    ## Estimate model.
    b <- bamlss(f, data = d)

    ## Effect plots
    plot(b, ask = FALSE)
    plot(b, model = "mu")
    plot(b, model = "sigma", term = "te(lon,lat)")

    ## Trace plots.
    plot(b, which = "samples")

    ## Residual plots.
    plot(b, which = 3:4)

    ## End(Not run)

[Package bamlss version 1.1-7 Index]