id_post_pred-idealstan-method: Posterior Prediction for 'idealstan' objects

id_post_pred,idealstan-methodR Documentation

Posterior Prediction for idealstan objects

Description

This function will draw from the posterior distribution, whether in terms of the outcome (prediction) or to produce the log-likelihood values.

This function can also produce either distribution of the outcomes (i.e., predictions) or the log-likelihood values of the posterior (set option type to 'log_lik'. For more information, see the package vignette How to Evaluate Models.

You can then use functions such as id_plot_ppc to see how well the model does returning the correct number of categories in the score/vote matrix. Also see help("posterior_predict", package = "rstanarm")

Usage

## S4 method for signature 'idealstan'
id_post_pred(
  object,
  draws = 100,
  output = "observed",
  type = "predict",
  sample_scores = NULL,
  ...
)

Arguments

object

A fitted idealstan object

draws

The number of draws to use from the total number of posterior draws (default is 100).

output

If the model has an unbounded outcome (Poisson, continuous, etc.), then specify whether to show the 'observed' data (the default) or the binary output 'missing' showing whether an observation was predicted as missing or not

type

Whether to produce posterior predictive values ('predict', the default), or log-likelihood values ('log_lik'). See the How to Evaluate Models vignette for more info.

sample_scores

In addition to reducing the number of posterior draws used to calculate the posterior predictive distribution, which will reduce computational overhead. Only available for calculating predictive distributions, not log-likelihood values.

...

Any other arguments passed on to posterior_predict (currently none available)


saudiwin/idealstan documentation built on Sept. 2, 2023, 1:29 a.m.