Predictive Functions
After fitting an LRMoE model, the following predictive functions provide further insights into the dataset. These functions start with predict_ followed by a quantity of interest (e.g. mean_) listed below.
class: latent class probabilities and the most likely latent class;mean: mean of response;var: variance of response;limit: limited expected value (LEV) of response, that is, $E[{min}(Y, d)]$;excess: expected excess value of response, that is, $E[{max}(Y-d, 0)]$; andVaRCTE: quantile (or Value-at-Risk/VaR) and conditional tail expectation (CTE, or tail-VaR/TVaR) of response.
These quantities can be calculated based on either the prior and posterior latent class probabilities, as indicated by the suffix of these functions.
prior: the latent class probabilities are based on the covariatesXand logit regression coefficientsα.posterior: the latent class probabilities are based on the covariatesX, logit regression coefficientsαand observed valuesY.
The differences of these probabilities can be found in Fung et al. (2019).
The following contains a detailed description of all predictive functions included in the package. Throughout this page, Y is a matrix of response, X a matrix of covariates, α a matrix of logit regression coefficients and model a matrix of expert functions.
LRMoE.predict_class_prior — Functionpredict_class_prior(X, α)Predicts the latent class probabilities, given covariates X and logit regression coefficients α.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.
Return Values
prob: A matrix of latent class probabilities.max_prob_idx: A matrix of the most likely latent class for each observation.
LRMoE.predict_class_posterior — Functionpredict_class_posterior(Y, X, α, model;
exact_Y = true, exposure_past = nothing)Predicts the latent class probabilities, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
Y: A matrix of responses.X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
prob: A matrix of latent class probabilities.max_prob_idx: A matrix of the most likely latent class for each observation.
LRMoE.predict_mean_prior — Functionpredict_mean_prior(X, α, model;
exposure_future = nothing)Predicts the mean values of response, given covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.
Optional Arguments
exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted mean values of response, based on prior probabilities.
LRMoE.predict_mean_posterior — Functionpredict_mean_posterior(Y, X, α, model;
exact_Y = true, exposure_past = nothing, exposure_future = nothing)Predicts the mean values of response, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
Y: A matrix of responses.X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted mean values of response, based on posterior probabilities.
LRMoE.predict_var_prior — Functionpredict_var_prior(X, α, model;
exposure_future = nothing)Predicts the variance of response, given covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.
Optional Arguments
exposure_future: A vector indicating the time exposure of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted variance of response, based on prior probabilities.
LRMoE.predict_var_posterior — Functionpredict_var_posterior(Y, X, α, model;
exact_Y = true, exposure_past = nothing, exposure_future = nothing)Predicts the variance of response, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
Y: A matrix of responses.X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted variance of response, based on posterior probabilities.
LRMoE.predict_limit_prior — Functionpredict_limit_prior(X, α, model, limit;
exposure_future = nothing)Predicts the limit expected value (LEV) of response, given covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.limit: A matrix specifying the cutoff point.
Optional Arguments
exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted limit expected value of response, based on prior probabilities.
LRMoE.predict_limit_posterior — Functionpredict_limit_posterior(Y, X, α, model, limit;
exact_Y = true, exposure_past = nothing, exposure_future = nothing)Predicts the limit expected value (LEV) of response, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
Y: A matrix of responses.X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.limit: A vector specifying the cutoff point.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted limit expected value of response, based on posterior probabilities.
LRMoE.predict_excess_prior — Functionpredict_excess_prior(X, α, model, limit;
exposure_future = nothing)Predicts the excess expectation of response, given covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.limit: A vector specifying the cutoff point.
Optional Arguments
exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted excess expectation of response, based on prior probabilities.
LRMoE.predict_excess_posterior — Functionpredict_excess_posterior(Y, X, α, model, limit;
exact_Y = true, exposure_past = nothing, exposure_future = nothing)Predicts the excess expectation of response, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
Y: A matrix of responses.X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.limit: A vector specifying the cutoff point.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
- A matrix of predicted excess expectation of response, based on posterior probabilities.
LRMoE.predict_VaRCTE_prior — Functionpredict_VaRCTE_prior(X, α, model, p;
exposure_future = nothing)Predicts the p-th value-at-risk (VaR) and conditional tail expectation (CTE) of response, given covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.p: A matrix of probabilities.
Optional Arguments
exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
VaR: A matrix of predicted VaR of response, based on prior probabilities.CTE: A matrix of predicted CTE of response, based on prior probabilities.
LRMoE.predict_VaRCTE_posterior — Functionpredict_VaRCTE_posterior(Y, X, α, model, p;
exact_Y = true, exposure_past = nothing, exposure_future = nothing)Predicts the p-th value-at-risk (VaR) and conditional tail expectation (CTE) of response, given observations Y, covariates X, logit regression coefficients α and a specified model of expert functions.
Arguments
X: A matrix of covariates.α: A matrix of logit regression coefficients.model: A matrix specifying the expert functions.p: A matrix of probabilities.
Optional Arguments
exact_Y:trueorfalse(default), indicating ifYis observed exactly or with censoring and truncation.exposure_past: A vector indicating the time exposure (past) of each observation. If nothing is supplied, it is set to 1.0 by default.exposure_future: A vector indicating the time exposure (future) of each observation. If nothing is supplied, it is set to 1.0 by default.
Return Values
VaR: A matrix of predicted VaR of response, based on posterior probabilities.CTE: A matrix of predicted CTE of response, based on posterior probabilities.