optimal_alpha: Selecting an Optimal alpha for MDPDE

View source: R/robustSFM.R

optimal_alphaR Documentation

Selecting an Optimal \alpha for MDPDE

Description

This function recommends an optimal \alpha for performing MDPD estimation. The function repeatedly calls bootstrap_test and selects the optimal \alpha from the set {0, 0.05, 0.1, ..., specified \alpha}.

Usage

optimal_alpha(formula, data = NULL, base_alpha = 0.5, B = 99, s_level = 0.1)

Arguments

formula

A symbolic description of the model to be estimated, specified using the standard R formula syntax (e.g., y ~ x1 + x2).

data

A data frame containing the variables in the model.

base_alpha

A numeric value. This selection procedure includes a bootstrap test. The bootstrap samples are generated using the MDPD estimates with \alpha = base_alpha, and the procedure selects an optimal \alpha from the set {0, 0.05, 0.1, ..., base_alpha}.

B

A numeric. This selecting procedure includes a bootstrap test, where B is the number of the bootstrap replications required for calculating a critical value. The default value is 99.

s_level

A numeric value representing the significance level for the bootstrap test. The default value is 0.1.

Value

A character string indicating the recommended optimal \alpha for MDPD estimation, selected from the set {0, 0.05, 0.1, ...,base_alpha}.

Examples


## Example using the 'riceProdPhil' dataset from the `frontier` package
library(frontier)
data(riceProdPhil)

## It takes to time to get the result of the optimal_alpha() function.
my.model <- log(PROD) ~ log(AREA) + log(LABOR) + log(NPK) + log(OTHER)
optimal_alpha(my.model, data = riceProdPhil, base_alpha=0.5)


## Data with a single outlying observation
riceProdPhil2 <- riceProdPhil
riceProdPhil3 <- riceProdPhil

idx <- which.max(riceProdPhil$PROD)
riceProdPhil2$PROD[idx] <- riceProdPhil$PROD[idx]*10
riceProdPhil3$PROD[idx] <- riceProdPhil$PROD[idx]/100

optimal_alpha(my.model, data = riceProdPhil2, base_alpha=0.5)
optimal_alpha(my.model, data = riceProdPhil3, base_alpha=0.5)


robustSFA documentation built on April 3, 2025, 6:12 p.m.