Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

apollo (version 0.1.0)

apollo_prediction: Predicts using an estimated model

Description

Calculates apollo_probabilities with functionality="prediction" and extracts one element from the returned list.

Usage

apollo_prediction(
  model,
  apollo_probabilities,
  apollo_inputs,
  prediction_settings = list(),
  modelComponent = "model"
)

Arguments

model

Model object. Estimated model object as returned by function apollo_estimate.

apollo_probabilities

Function. Returns probabilities of the model to be estimated. Must receive three arguments:

  • apollo_beta: Named numeric vector. Names and values of model parameters.

  • apollo_inputs: List containing options of the model. See apollo_validateInputs.

  • functionality: Character. Can be either "estimate" (default), "prediction", "validate", "conditionals", "zero_LL", or "raw".

apollo_inputs

List grouping most common inputs. Created by function apollo_validateInputs.

prediction_settings

List of settings. It can have the following elements.

  • modelComponent Character. Name of component of apollo_probabilities output to calculate predictions for. Default is "model", i.e. the whole model.

  • silent Boolean. If TRUE, thsi function won't print any output to screen.

modelComponent

Deprecated. Same as modelComponent inside prediction_settings.

Value

A list containing predictions for component modelComponent of the model described in apollo_probabilities. The particular shape of the prediction will depend on the model component.

Details

Structure of predictions are simplified before returning, e.g. list of vectors are turned into a matrix.