specificationof values at which the forecasts should beevaluated, typically a numeric vector but possibly also a matrix or dataframe. Additionally, at can be the character string"function" or "list", see details below.
further parameters passed to methods. In particular, this includesthe logical argument elementwise = NULL. Should each element of distribution only be evaluated at thecorresponding element of at (elementwise = TRUE) or at all elementsin at (elementwise = FALSE). Elementwise evaluation is only possibleif the number of observations is length of at are the same and in that case a vector ofthe same length is returned. Otherwise a matrix is returned. The default is to useelementwise = TRUE if possible, and otherwise elementwise = FALSE.
character or numeric or NULL. Specification of the standarddeviation sigma to be used for the Normal distribution in thelm method. The default "ML" (or equivalently "MLE" or NULL)uses the maximum likelihood estimate based on the residual sum of squares dividedby the number of observations, n. Alternatively, sigma = "OLS" uses theleast-squares estimate (divided by the residual degrees of freedom, n - k). Finally,a concrete numeric value can also be specified in sigma.
character or numeric or NULL. Specification of thedispersion parameter in the glm method. The default NULL(or equivalently "deviance") is to use the deviancedivided by the number of observations, n. Alternatively, dispersion = "Chisquared"uses the Chi-squared statistic divided by the residual degrees of freedom, n - k.Finally, a concrete numeric value can also be specified in dispersion.
Either a data.frame of predictions with the same number of rowsas the newdata (or the original observations if that is NULL).If drop = TRUE predictions with just a single column are simplifiedto a vector and predictions with multiple columns to a matrix.
The function procast provides a unified framework for probabilisticforcasting (or procasting, for short) based on probabilistic (regression)models, also known as distributional regression approaches. Typical typesof predictions include quantiles, probabilities, (conditional) expectations,variances, and (log-)densities. Internally, procast methods typicallycompute the predicted parameters for each observation and then compute thedesired outcome for the distributions with the respective parameters.
Some quantities, e.g., the moments of the distribution (like mean or variance),can be computed directly from the predicted parameters of thedistribution while others require an additional argument at which thedistribution is evaluated (e.g., the probability of a quantile or anobservation of the response).
The default procast method leverages the S3 classes and methods forprobability distributions from the distributions3 package. In a first stepthe predicted probability distribution object is obtained and, by default(type = "distribution"), returned in order to reflect the distributionalnature of the forecast. For all other types (e.g., "mean","quantile", or "density"), the corresponding extractor methods(e.g., mean, quantile, or pdf) are used tocompute the desired quantity from the distribution objects. The examplesprovide some worked illustrations.
Package authors or users, who want to enable procast for new typesof model objects, only need to provide a suitable prodistextractor for the predicted probability distribution. Then the default procastworks out of the box. However, if the distributions3 package does not supportthe necessary probability distribution, then it may also be necessary toimplement a new distribution objects, see apply_dpqr.
3a8082e126