Package 'RPEIF'

Title: Computation and Plots of Influence Functions for Risk and Performance Measures
Description: Computes the influence functions time series of the returns for the risk and performance measures as mentioned in Chen and Martin (2018) <https://www.ssrn.com/abstract=3085672>, as well as in Zhang et al. (2019) <https://www.ssrn.com/abstract=3415903>. Also evaluates estimators influence functions at a set of parameter values and plots them to display the shapes of the influence functions.
Authors: Anthony Christidis <anthony.christidis@stat.ubc.ca>, Shengyu Zhang <syzhang@uw.edu>, Douglas Martin <doug@amath.washington.edu>
Maintainer: Anthony Christidis <anthony.christidis@stat.ubc.ca>
License: GPL (>= 2)
Version: 1.2.4
Built: 2025-02-20 05:45:26 UTC
Source: https://github.com/anthonychristidis/rpeif

Help Index


Influence Function for Available Risk and Performance Measures

Description

IF returns the data and plots the shape of either the IF or the IF TS for a specified estimator.

Usage

IF(
  estimator,
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  family = c("mopt", "opt", "bisquare")[1],
  eff = 0.99,
  ...
)

Arguments

estimator

The estimator of interest.

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

family

Family for robust m-estimator of location. Must be one of "mopt" (default), "opt" or "bisquare".

eff

Tuning parameter for the normal distribution efficiency for robust methods.

...

Additional parameters passed on to influence function of risk or performance measure.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF using the wrapper function
outIF <- IF(estimator = "Mean",
            returns = NULL, evalShape = TRUE, retVals = NULL, nuisPars = list(mu = 0.005),
            IFplot = TRUE, IFprint = TRUE)

#' # Loading data (hedge funds returns)
data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 
                    
# Plot of IF using wrapper function and with a specified TS 
outIF <- IF(estimator = "Mean",
            returns = edhec[,"CA"], evalShape = TRUE, 
            retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
            IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF(estimator = "Mean",
            returns = edhec[,"CA"], evalShape = FALSE, retVals = NULL, nuisPars  = NULL,
            IFplot = TRUE, IFprint = TRUE,
            compile = TRUE, prewhiten = FALSE)

Influence Function - Downside Sharpe Ratio

Description

IF.DSR returns the data and plots the shape of either the IF or the IF TS for the Downside Sharpe Ratio.

Usage

IF.DSR(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  rf = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

rf

Risk-free interest rate.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Addtional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of DSR.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.DSR(returns = NULL, evalShape = TRUE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.DSR(returns = edhec[,"CA"], evalShape = TRUE, 
                retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.DSR(returns = edhec[,"CA"], evalShape = FALSE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE,
                prewhiten = FALSE)

Influence Function - Expected Shortfall (ES)

Description

IF.ES returns the data and plots the shape of either the IF or the IF TS for the ES

Usage

IF.ES(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  alpha.ES = 0.05,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

alpha.ES

Tail Probability.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of the ES.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.ES(returns = NULL, evalShape = TRUE, 
               retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.ES(returns = edhec[,"CA"], evalShape = TRUE, 
               retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.ES(returns = edhec[,"CA"], evalShape = FALSE, 
               retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE,
               prewhiten = FALSE)

Influence Function - Expected Shortfall (ES) Ratio

Description

IF.ESratio returns the data and plots the shape of either the IF or the IF TS for the Expected Shortfall Ratio.

Usage

IF.ESratio(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  alpha = 0.1,
  rf = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

alpha

Tail Probability.

rf

Risk-free interest rate.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of ESratio.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.ESratio(returns = NULL, evalShape = TRUE, 
                    retVals = NULL, nuisPars = NULL,
                    IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.ESratio(returns = edhec[,"CA"], evalShape = TRUE, 
                    retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                    IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.ESratio(returns = edhec[,"CA"], evalShape = FALSE, 
                    retVals = NULL, nuisPars = NULL,
                    IFplot = TRUE, IFprint = TRUE,
                    prewhiten = FALSE)

Influence Function - Lower Partial Moment (LPM)

Description

IF.LPM returns the data and plots the shape of either the IF or the IF TS for the LPM

Usage

IF.LPM(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  const = 0,
  order = 1,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

const

Constant threshold.

order

Order of LPM. Can only take values 1 or 2.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of LPM.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.LPM(returns = NULL, evalShape = TRUE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.LPM(returns = edhec[,"CA"], evalShape = TRUE, 
                retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.LPM(returns = edhec[,"CA"], evalShape = FALSE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE,
                prewhiten = FALSE)

Influence Function - Mean

Description

IF.Mean returns the data and plots the shape of either the IF or the IF TS for the mean.

Usage

IF.Mean(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function for the specified risk or performance measure.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.Mean(returns = NULL, evalShape = TRUE, retVals = NULL, nuisPars = NULL,
                 IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.Mean(estimator = "mean",
                 returns = edhec[,"CA"], evalShape = TRUE, 
                 retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                 IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.Mean(returns = edhec[,"CA"], evalShape = FALSE, 
                 retVals = NULL, nuisPars = NULL,
                 IFplot = TRUE, IFprint = TRUE,
                 prewhiten = FALSE)

Influence Function - Omega Ratio

Description

IF.OmegaRatio returns the data and plots the shape of either the IF or the IF TS for the Omega Ratio.

Usage

IF.OmegaRatio(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  const = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

const

Constant threshold.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of Omega Ratio.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.OmegaRatio(returns = NULL, evalShape = TRUE, 
                       retVals = NULL, nuisPars = NULL,
                       IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.OmegaRatio(returns = edhec[,"CA"], evalShape = TRUE, 
                       retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                       IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.OmegaRatio(returns = edhec[,"CA"], evalShape = FALSE, 
                       retVals = NULL, nuisPars = NULL,
                       IFplot = TRUE, IFprint = TRUE,
                       prewhiten = FALSE)

Influence Function - Rachev Ratio

Description

IF.RachevRatio returns the data and plots the shape of either the IF or the IF TS for the Rachev Ratio.

Usage

IF.RachevRatio(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  alpha = 0.1,
  beta = 0.1,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

alpha

Lower tail probability.

beta

Upper tail probability.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of Rachev Ratio.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.RachevRatio(returns = NULL, evalShape = TRUE, 
                        retVals = NULL, nuisPars = NULL,
                        IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.RachevRatio(returns = edhec[,"CA"], evalShape = TRUE, 
                        retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                        IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.RachevRatio(returns = edhec[,"CA"], evalShape = FALSE, 
                        retVals = NULL, nuisPars = NULL,
                        IFplot = TRUE, IFprint = TRUE,
                        prewhiten = FALSE)

Influence Function - Robust M-Estimator of Mean

Description

IF.robMean returns the data and plots the shape of either the IF or the IF TS for the M-estimator of Mean.

Usage

IF.robMean(
  returns = NULL,
  family = c("mopt", "opt", "bisquare")[1],
  eff = 0.95,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

family

Family for robust m-estimator of Mean. Must be one of "mopt" (default), "opt" or "bisquare".

eff

Tuning parameter for the normal distribution efficiency. Default is 0.99.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

...

Addtional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function for M-estimator of Mean

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 
                    
# Plot of IF shape
outIF <- IF.robMean(returns = edhec[,"CA"], evalShape = TRUE, 
                    retVals = NULL, 
                    IFplot = TRUE, IFprint = TRUE)

# Plot of IF a specified TS 
outIF <- IF.robMean(returns = edhec[,"CA"], evalShape = TRUE, 
                    retVals = seq(-0.1, 0.1, by = 0.001), 
                    IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.robMean(returns = edhec[,"CA"], evalShape = FALSE, 
                    retVals = NULL, 
                    IFplot = TRUE, IFprint = TRUE,
                    prewhiten = FALSE)

Influence Function - Standard Deviation

Description

IF.SD returns the data and plots the shape of either the IF or the IF TS for the standard deviation

Usage

IF.SD(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Vector of the returns of the asset or portfolio.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of the standard deviation.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.SD(returns = NULL, evalShape = TRUE, retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.SD(returns = edhec[,"CA"], evalShape = TRUE, 
               retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.SD(returns = edhec[,"CA"], evalShape = FALSE, 
               retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE,
               prewhiten = FALSE)

Influence Function - Semi-Standard Deviation (SemiSD)

Description

IF.SemiSD returns the data and plots the shape of either the IF or the IF TS for the SemiSD

Usage

IF.SemiSD(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of SemiSD.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.SemiSD(returns = NULL, evalShape = TRUE, 
                   retVals = NULL, nuisPars = NULL,
                   IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.SemiSD(returns = edhec[,"CA"], evalShape = TRUE, 
                   retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                   IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.SemiSD(returns = edhec[,"CA"], evalShape = FALSE, 
                   retVals = NULL, nuisPars = NULL,
                   IFplot = TRUE, IFprint = TRUE,
                   prewhiten = FALSE)

Influence Function - Sortino Ratio

Description

IF.SoR returns the data and plots the shape of either the IF or the IF TS for the Sortino Ratio.

Usage

IF.SoR(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  threshold = c("const", "mean")[1],
  const = 0,
  rf = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

threshold

Parameter of threshold is either "mean" or "const". Default is "mean".

const

The threshold if threshold is "const".

rf

Risk-free interest rate.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Addtional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of SoR.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.SoR(returns = NULL, evalShape = TRUE, 
                retVals = NULL, nuisPars = NULL,
                 IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.SoR(returns = edhec[,"CA"], evalShape = TRUE, 
                retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.SoR(returns = edhec[,"CA"], evalShape = FALSE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE,
                prewhiten = FALSE)

Influence Function - Sharpe Ratio (SR)

Description

IF.SR returns the data and plots the shape of either the IF or the IF TS for the SR

Usage

IF.SR(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  rf = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

rf

Risk-free interest rate.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of the SR.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.SR(returns = NULL, evalShape = TRUE, 
               retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.SR(returns = edhec[,"CA"], evalShape = TRUE, 
               retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.SR(returns = edhec[,"CA"], evalShape = FALSE, 
               retVals = NULL, nuisPars = NULL,
               IFplot = TRUE, IFprint = TRUE,
               prewhiten = FALSE)

Influence Function - Value at Risk (VaR)

Description

IF.VaR returns the data and plots the shape of either the IF or the IF TS for the Value at Risk

Usage

IF.VaR(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  alpha = 0.05,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

alpha

The tail probability of interest.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of the VaR.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.VaR(returns = NULL, evalShape = TRUE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.VaR(returns = edhec[,"CA"], evalShape = TRUE, 
                retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.VaR(returns = edhec[,"CA"], evalShape = FALSE, 
                retVals = NULL, nuisPars = NULL,
                IFplot = TRUE, IFprint = TRUE,
                prewhiten = FALSE)

Influence Function - Value at Risk (VaR) Ratio

Description

IF.VaRratio returns the data and plots the shape of either the IF or the IF TS for the VaR Ratio.

Usage

IF.VaRratio(
  returns = NULL,
  evalShape = FALSE,
  retVals = NULL,
  nuisPars = NULL,
  k = 4,
  IFplot = FALSE,
  IFprint = TRUE,
  alpha = 0.05,
  rf = 0,
  prewhiten = FALSE,
  ar.prewhiten.order = 1,
  cleanOutliers = FALSE,
  cleanMethod = c("locScaleRob")[1],
  eff = 0.99,
  ...
)

Arguments

returns

Returns data of the asset or portfolio. This can be a numeric or an xts object.

evalShape

Evaluation of the shape of the IF risk or performance measure if TRUE. Otherwise, a TS of the IF of the provided returns is computed.

retVals

Values used to evaluate the shape of the IF.

nuisPars

Nuisance parameters used for the evaluation of the shape of the IF (if no returns are provided).

k

Range parameter for the shape of the IF (the SD gets multiplied k times).

IFplot

If TRUE, the plot of the IF shape or IF TS of the returns is produced.

IFprint

If TRUE, the data for the IF shape or the IF TS of the returns is returned.

alpha

The tail probability of interest.

rf

Risk-free interest rate.

prewhiten

Boolean variable to indicate if the IF TS is pre-whitened (TRUE) or not (FALSE).

ar.prewhiten.order

Order of AR parameter for the pre-whitening. Default is AR(1).

cleanOutliers

Boolean variable to indicate whether outliers are cleaned with a robust location and scale estimator.

cleanMethod

Robust method used to clean outliers from the TS. Default choice is "locScaleRob".

eff

Tuning parameter for the normal distribution efficiency for the "locScaleRob" robust data cleaning.

...

Additional parameters.

Details

For further details on the usage of the nuisPars argument, please refer to Section 3.1 for the RPEIF vignette.

Value

Influence function of the VaRratio.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Plot of IF with nuisance parameter with return value
outIF <- IF.VaRratio(returns = NULL, evalShape = TRUE, 
                     retVals = NULL, nuisPars = NULL,
                     IFplot = TRUE, IFprint = TRUE)

data(edhec, package = "PerformanceAnalytics")
colnames(edhec) = c("CA", "CTAG", "DIS", "EM","EMN", "ED", "FIA",
                    "GM", "LS", "MA", "RV", "SS", "FoF") 

# Plot of IF a specified TS 
outIF <- IF.VaRratio(returns = edhec[,"CA"], evalShape = TRUE, 
                     retVals = seq(-0.1, 0.1, by = 0.001), nuisPars = NULL,
                     IFplot = TRUE, IFprint = TRUE)

# Computing the IF of the returns (with prewhitening) with a plot of IF TS
outIF <- IF.VaRratio(returns = edhec[,"CA"], evalShape = FALSE, 
                     retVals = NULL, nuisPars = NULL,
                     IFplot = TRUE, IFprint = TRUE,
                     prewhiten = FALSE)

Nuisance Parameters Computation

Description

nuis.pars returns the value of the nuisance parameters used in the evaluation of the shape of influence functions for risk and performance measures.

Usage

nuisParsFn(mu = 0.01, sd = 0.05, c = 0, alpha = 0.1, beta = 0.1)

Arguments

mu

Mean parameter.

sd

Standard deviation parameter.

c

Constant value for threshold.

alpha

Parameters for the lower tail quantile.

beta

Parameter for the upper tail quantile.

Details

For further details on the usage of the nuisParsFn function, please refer to Section 3.1 for the RPEIF vignette.

Value

List of nuisance parameters.

Author(s)

Anthony-Alexander Christidis, anthony.christidis@stat.ubc.ca

Examples

# Nuisance parameters using default values
defaultNuisance <- nuisParsFn()

# Nuisance parameters using specified values
specifiedNuisance <- nuisParsFn(mu=0.02, sd=0.1, c=0.01, alpha=0.05, beta=0.1)