Learn R Programming

NNMoMo (version 0.1.0)

residuals.fitNNMoMo: Compute Residuals for NNMoMo Fitted Models

Description

This function computes the residuals for objects created by fit.NNMoMo. It is analog to the residuals.fitStMoMo function for StMoMo but without the option to scale the residuals as nobs and npar are not provided by the neural network.

Usage

# S3 method for fitNNMoMo
residuals(object, scale = FALSE, ...)

Value

An object of class resStMoMo with the residuals. This object has components:

  • residuals: a matrix with the residuals.

  • ages: ages corresponding to the rows in residuals.

  • years: years corresponding to the columns in residuals.

Arguments

object

An object of class fitNNMoMo with the fitted parameters of a stochastic mortality model.

scale

Logical, default FALSE. If TRUE, an error is thrown because the number of observations (nobs) and parameters (npar) cannot be calculated for fitNNMoMo objects.

...

Further arguments passed to or from other methods.