optimal_alpha | R Documentation |
\alpha
for MDPDEThis 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
}.
optimal_alpha(formula, data = NULL, base_alpha = 0.5, B = 99, s_level = 0.1)
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 |
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. |
A character string indicating the recommended optimal \alpha
for MDPD
estimation, selected from the set {0, 0.05, 0.1, ...,base_alpha
}.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.