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.

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

# S3 method for 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?

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.

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

## Examples

if (FALSE) ## 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)
#> Error in bamlss.model.frame(formula, data, family, weights, subset, offset,     na.action, specials, contrasts): object 'd' not found

## Effect plots
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'b' not found
plot(b, model = "mu")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'b' not found
plot(b, model = "sigma", term = "te(lon,lat)")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'b' not found

## Trace plots.
plot(b, which = "samples")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'b' not found

## Residual plots.
plot(b, which = 3:4)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'b' not found
{"ft_lang_label":"__label__en","ft_lang_prob":0.6462164,"math_prob":0.9756184,"size":2977,"snap":"2023-14-2023-23","text_gpt3_token_len":789,"char_repetition_ratio":0.12579885,"word_repetition_ratio":0.2278481,"special_character_ratio":0.26570374,"punctuation_ratio":0.18074325,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9973058,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-05T19:22:09Z\",\"WARC-Record-ID\":\"<urn:uuid:655a7124-913e-4a0b-a899-47d62777f8aa>\",\"Content-Length\":\"17430\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f9732e0d-8751-4d73-a5a2-725f2f6a43de>\",\"WARC-Concurrent-To\":\"<urn:uuid:24d50925-f136-41ae-97dc-9584176368e8>\",\"WARC-IP-Address\":\"137.208.57.38\",\"WARC-Target-URI\":\"http://www.bamlss.org/reference/plot.bamlss.html\",\"WARC-Payload-Digest\":\"sha1:H5TC6PS74AWP5UXRBK62A3PG275OJBVK\",\"WARC-Block-Digest\":\"sha1:UGDWRG4S2VBKGBGB7Z3HG6LBFVTW3SLP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224652161.52_warc_CC-MAIN-20230605185809-20230605215809-00101.warc.gz\"}"}