summary.fit_model | R Documentation |
summary.fit_model
extracts commonly used quantities derived from a fitted VAST model
## S3 method for class 'fit_model'
summary(
x,
what = "density",
n_samples = 250,
working_dir = NULL,
type = 1,
random_seed = NULL,
form = NULL,
category_names = x$category_names,
year_labels = x$year_labels,
...
)
x |
Output from |
what |
String indicating what to summarize; options are 'density', 'index' or 'residuals' |
n_samples |
Number of samples used when |
type |
integer stating what type of simulation to use from the following options:
|
random_seed |
integer passed to |
form |
Optional predictor against which the residuals should be plotted. Default is to used the predicted(simulationOutput). |
... |
additional arguments passed to |
summary.fit_model
faciliates common queries for model output including:
what="density"
returns a tagged list containing element Density_dataframe
,
which lists the estimated density for every Latitude-Longitude-Year-Category combination
for every modelled location in the extrapolation-grid.
what="residuals"
returns a DHARMa object containing PIT residuals;
See details section for more information.
For calculating residuals, the function calls package DHARMa
to create a diagnostic object for simulation-based quantile residuals.
It specifically simulates replicated data sets from the predictive distribution of data
conditional on estimated fixed and random effects. It then
calculates probability-integral-transform (PIT) residuals from the observed and simulated values.
It then replaces the automatically calculated residuals in the DHARMa object with these these PIT residuals,
so that DHARMa can be used to plot those PIT residuals. PIT residuals are used because the original DHARMa calculations
are not correct when using a delta-model (due to additional jittered values added by DHARMa when detecting multiple 0-valued observations), hence
the need to call this function to correctly calculate PIT residuals for a delta-model.
Note that summary(fit, ..., type=0
uses oneStepPredict_deltaModel
to calculate one-step-ahead
residuals. These are probably the most appropriate method for evaluating residuals, but are also *very* slow to calculate relative
to other methods.
plot_quantile_residuals
to plot output of summary.fit_model(x,what="residuals")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.