Title: | Optimal B-Robust Estimator Tools |
---|---|
Description: | An implementation for computing Optimal B-Robust Estimators of two-parameter distribution. The procedure is composed of some equations that are evaluated alternatively until the solution is reached. Some tools for analyzing the estimates are included. The most relevant is covariance matrix computation using a closed formula. |
Authors: | Andrea Riboldi [aut], Ivan Luciano Danesi [aut], Fabio Piacenza [aut, cre], Oliver Kuehnle [aut], Davide Di Vincenzo [aut], Ruben Ciaponi [ctb], Stephen Allen [ctb], Novella Saccenti [ctb], Annarita Filippi [ctb] |
Maintainer: | Fabio Piacenza <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2-0 |
Built: | 2024-10-31 19:47:45 UTC |
Source: | CRAN |
Function containing expressions of density and cumulative functions, plus the first and second derivatives.
densityExpressions(strDistribution = "normal", eDensityFun = NA)
densityExpressions(strDistribution = "normal", eDensityFun = NA)
strDistribution |
Distribution input between "normal" (Normal distribution), "logNormal" (logNormal distribution), "weibull" (Weibull distribution), "logLogistic" (logLogistic distribution), "gpd2" (Generalized Pareto Distribution with two parameters) or "custom" if the distribution is written by the user. |
eDensityFun |
The density of a two parameters distribution. This should be an expression object, the two parameters should be called "nTheta1" and "nTheta2", the data "nvData" and its formula should be derivable |
Returns list containing all the symbolic functions.
# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # The same result can be generated by inserting manually the formula distrForOBRE <- densityExpressions(strDistribution = "custom", eDensityFun = expression((exp( -((nvData - nTheta1)^2) / (2 * nTheta2^2)) / (sqrt(2 * pi) * nTheta2))))
# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # The same result can be generated by inserting manually the formula distrForOBRE <- densityExpressions(strDistribution = "custom", eDensityFun = expression((exp( -((nvData - nTheta1)^2) / (2 * nTheta2^2)) / (sqrt(2 * pi) * nTheta2))))
Function computing part 1 of element [1, 1] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl11Part1(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl11Part1(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function computing part 2 of element [1, 1] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl11Part2(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl11Part2(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function computing part 1 of element [1, 2] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl12Part1(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl12Part1(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function computing part 2 of element [1, 1] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl12Part2(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl12Part2(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function computing part 1 of element [2, 2] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl22Part1(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl22Part1(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function computing part 2 of element [2, 2] for Fisher Information matrix computation. The Fisher Information matrix is splitted in the four elements ([1, 1], [1, 2], [2, 1], [2, 2]). Each element is split in part 1 and part 2
fisherEl22Part2(nvData, nTheta1, nTheta2, lDensityExpr)
fisherEl22Part2(nvData, nTheta1, nTheta2, lDensityExpr)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
Function calculating the Fisher information matrix.
matFisherComputation(nTheta1, nTheta2, lDensityExpr)
matFisherComputation(nTheta1, nTheta2, lDensityExpr)
nTheta1 |
First parameter. |
nTheta2 |
Second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
The Fisher information matrix.
The parameters Maximum Likelihood Estimation is obtained by numerical optimization.
MLE(nvData, strDistribution, lDensityExpr)
MLE(nvData, strDistribution, lDensityExpr)
nvData |
The vector of the data. |
strDistribution |
The distribution name. |
lDensityExpr |
The distribution expression, |
A list with distribution name, distribution parameters, value of the objective function corresponding to the parameters, additional information returned by the optimizer, convergence of the algorithm.
The function compute the Negative Log-Likelihood value that has to be used for optimization in MLE function.
NlLike(nvTheta, nvData, lDensityExpr)
NlLike(nvTheta, nvData, lDensityExpr)
nvTheta |
Parameters of the distribution. |
nvData |
The vector of the data. |
lDensityExpr |
The distribution density espressions. |
Negative log likelihood value.
Function for obtaining the Optimal B-Robust Estimates starting by a vector of data and a two parameters distribution.
OBRE( nvData, strDistribution, nCParOBRE, dfParOBRE = data.frame(nEta = 1e-06, nMaxIterLoopWc = 10, nMaxIterLoopA = 10, nRelTol = 0.001, nAbsTol = 0.5, stringsAsFactors = FALSE), nTheta1Init = NA, nTheta2Init = NA, eDensityFun = NA )
OBRE( nvData, strDistribution, nCParOBRE, dfParOBRE = data.frame(nEta = 1e-06, nMaxIterLoopWc = 10, nMaxIterLoopA = 10, nRelTol = 0.001, nAbsTol = 0.5, stringsAsFactors = FALSE), nTheta1Init = NA, nTheta2Init = NA, eDensityFun = NA )
nvData |
The vector of data. |
strDistribution |
The distribution name between "normal" (Normal distribution), "logNormal" (logNormal distribution), "weibull" (Weibull distribution), "logLogistic" (logLogistic distribution), "gpd2" (Generalized Pareto Distribution with two parameters) or "custom" if the distribution is written by the user as an input of "eDensityFun" parameter. Alternatively, the input of "strDistribution" can be an object of class "OBREdist", obtained using function densityExpressions. |
nCParOBRE |
OBRE robustness parameter. |
dfParOBRE |
A data frame containing oprimization parameters, i.e. nEta, the precision between two parameters optimization, nMaxIterLoopWc and nMaxIterLoopA, the number of iterations in the optimization proceture, nRelTol and nAbsTol, the relative and absolute tolerances. |
nTheta1Init |
First parameter for the beginning of the computation. |
nTheta2Init |
Second parameter for the beginning of the computation. |
eDensityFun |
The density of a two parameters distribution. To be inserted if in strDistribution the "custom" option is chosen. This should be an expression object, the two parameters should be called "nTheta1" and "nTheta2", the data "nvData" and its formula should be derivable |
A list with the vector containing the final parameters, the exit OBRE message, the values of vector a and matrix A, the OBRE tuning parameter c, the initial values of the parameters (if unspecified by the user, the values of MLE are reported), the vector of data, the density expression.
Bellio, R. (2007). Algorithms for bounded-influence estimation. Comput. Stat. Data Anal. 51, 2531-2541.
Hampel F (1968). Contributions to the theory of robust estimation. University of California.
Hampel, F., Ronchetti, E., Rousseeuw, P. & Stahel, W. (1985). Robust Statistics. The approach based on influence function. John Wiley and Sons Ltd., Chichester, UK.
Victoria-Feser, M.P. & Ronchetti, E. (1994). Robust methods for personal-income distribution models. Canadian Journal of Statistics 22, 247-258.
# Using the densityExpressions function for initialize the distribution distrForOBRE <- densityExpressions(strDistribution = "normal") simData = c(rnorm(1000, 12, 2),200,150) try({estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) # Launching the generation of the density expression directly from OBRE simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = "normal", nCParOBRE = 3) # Using the "custom" option and using the normal distribution simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = "custom", nCParOBRE = 3, eDensityFun = expression((exp( -((nvData - nTheta1)^2) / (2 * nTheta2^2)) / (sqrt(2 * pi) * nTheta2))))})
# Using the densityExpressions function for initialize the distribution distrForOBRE <- densityExpressions(strDistribution = "normal") simData = c(rnorm(1000, 12, 2),200,150) try({estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) # Launching the generation of the density expression directly from OBRE simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = "normal", nCParOBRE = 3) # Using the "custom" option and using the normal distribution simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = "custom", nCParOBRE = 3, eDensityFun = expression((exp( -((nvData - nTheta1)^2) / (2 * nTheta2^2)) / (sqrt(2 * pi) * nTheta2))))})
The function compute the relative distance from the past to the current iteration of matrix A, with respect to the relative tolerance if at the current iteration matrix A is not null. Otherwise the absolute error is checked. Then the vector a is checked in the same way.
OBRECheckTolParameters(matANew, matAOld, nvANew, nvAOld, nRelTol, nAbsTol)
OBRECheckTolParameters(matANew, matAOld, nvANew, nvAOld, nRelTol, nAbsTol)
matANew |
Matrix A at the current iteration. |
matAOld |
Matrix A at the past iteration. |
nvANew |
Vector a at the current iteration. |
nvAOld |
Vector a at the past iteration. |
nRelTol |
Relative tolerance. |
nAbsTol |
Absolute tolerance. |
A flag indicating if condition on matrix A and vector a are both satisfied.
The function computes matrices M (Jacobian) and Q (Variability) and uses them to evaluate the covariance matrix V.
OBRECovarianceMatrix(lOBRE)
OBRECovarianceMatrix(lOBRE)
lOBRE |
List of all the variables resulting from the OBRE computation. |
A list containing Jacobian of the estimate function, variability and asymptotic covariance matrices, as well as the relative efficiency with respect to Maximum Likelihood Estimator
Hampel, F., Ronchetti, E., Rousseeuw, P. & Stahel, W. (1985). Robust Statistics. The approach based on influence function. John Wiley and Sons Ltd., Chichester, UK.
Heritier S, Cantoni E, Copt S, Victoria-Feser M (2011). Robust Methods in Biostatistics. John Wiley and Sons Ltd., Chichester, UK.
try({distrForOBRE <- densityExpressions(strDistribution = "normal") simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) lOBRECov = OBRECovarianceMatrix(estOBRE)})
try({distrForOBRE <- densityExpressions(strDistribution = "normal") simData = c(rnorm(1000, 12, 2),200,150) estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) lOBRECov = OBRECovarianceMatrix(estOBRE)})
Function computing argument A for OBRE matrix M integrals.
OBREmatMArgumentA( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
OBREmatMArgumentA( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
nK |
Exponent which differentiate M_1 from M_2. |
Function computing argument B for OBRE matrix M integrals.
OBREmatMArgumentB( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
OBREmatMArgumentB( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
nK |
Exponent which differentiate M_1 from M_2. |
Function computing argument C for OBRE matrix M integrals.
OBREmatMArgumentC( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
OBREmatMArgumentC( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
nK |
Exponent which differentiate M_1 from M_2. |
The function evaluates integrals used to compute the M_1 and M_2 OBRE matrices. Element (1,1) uses argument (A,B,F); element (1,2) uses argument (B,D,E,F); elements (2,2) uses arguments (C,D,F).
OBREMatMComputation( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
OBREMatMComputation( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA, nK )
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
nK |
Exponent which differentiate M_1 from M_2. |
OBRE M matrix (M_1 if nK = 1; M_2 if nK = 2).
Function computing element [1, 1] of matrix M, for the computation of asymptotic covariance matrix V.
OBREMatVMatMEl11(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatMEl11(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing element [1, 2] of matrix M, for the computation of asymptotic covariance matrix V.
OBREMatVMatMEl12(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatMEl12(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing element [2, 1] of matrix M, for the computation of asymptotic covariance matrix V.
OBREMatVMatMEl21(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatMEl21(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing element [2, 2] of matrix M, for the computation of asymptotic covariance matrix V.
OBREMatVMatMEl22(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatMEl22(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing argument element [1, 1] of matrix Q of asymptotic covariance matrix V.
OBREMatVMatQEl11(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatQEl11(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing argument element [1, 2] of matrix Q of asymptotic covariance matrix V.
OBREMatVMatQEl12(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatQEl12(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing argument element [2, 2] of matrix Q of asymptotic covariance matrix V.
OBREMatVMatQEl22(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREMatVMatQEl22(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
The function evaluates integrals used to compute the components of OBRE a vector.
OBREnvAComputation( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA )
OBREnvAComputation( nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA )
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
The list of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
OBRE matrix A. |
nvA |
OBRE vector a. |
The OBRE a vector.
Function computing denominator for OBRE numeric vector nvA evaluation.
OBREnvADen(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREnvADen(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing first part numerator for OBRE numeric vector nvA evaluation.
OBREnvANum1(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREnvANum1(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function computing second part numerator for OBRE numeric vector nvA evaluation.
OBREnvANum2(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREnvANum2(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
List of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
Matrix A. |
nvA |
Vector a. |
Function for computing OBRE weights. The function computes the score function for both parameters and build the score matrix. The score matrix is then modified using OBRE parameters A matrix and a vector and an euclidean norm is derived. The weights are finally found as the minimum between the normalized nCParOBRE and 1.
OBREWeightsFun(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
OBREWeightsFun(nvData, nTheta1, nTheta2, lDensityExpr, nCParOBRE, matA, nvA)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
The list of symbolic expressions of density, cumulative and derivatives. |
nCParOBRE |
OBRE c parameter. |
matA |
OBRE matrix A. |
nvA |
OBRE vector a. |
A numeric vector containing OBRE weights.
The function computes the plot of the OBRE computation
## S3 method for class 'OBREresult' plot(x, ...)
## S3 method for class 'OBREresult' plot(x, ...)
x |
The OBREresult object (output of OBRE function) that has to be plotted. |
... |
Added argument for consistency with the plot generic function. |
A graphical representation of an OBREresult obect. The plot is composed by four plots: the value of input data in logaritmic scale, the values of score function evaluated in the input data, the OBRE weights, the values of OBRE components.
try({# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # Generates input data simData = c(rnorm(100, 12, 1), rnorm(10, 10, 10)) # Estimates OBREresult object estOBRE = OBRE(nvData = simData, strDistribution = "normal", nCParOBRE = 3) plot(estOBRE)})
try({# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # Generates input data simData = c(rnorm(100, 12, 1), rnorm(10, 10, 10)) # Estimates OBREresult object estOBRE = OBRE(nvData = simData, strDistribution = "normal", nCParOBRE = 3) plot(estOBRE)})
The function evaluates the formula used to compute the first component of the score function. The missing elements are imputed with 0.
scoreComponent(nvData, nTheta1, nTheta2, lDensityExpr, nParIndex)
scoreComponent(nvData, nTheta1, nTheta2, lDensityExpr, nParIndex)
nvData |
The vector of data. |
nTheta1 |
The first parameter. |
nTheta2 |
The second parameter. |
lDensityExpr |
The list of symbolic expressions of density, cumulative and derivatives. |
nParIndex |
Which component parameter needs to be calculated. |
The first component of the score function.
Generic summary method
summary(object)
summary(object)
object |
... |
The function shows the estimated parameters, the OBRE tuning parameter, the proportion of data weighted and the relative efficiency with respect to MLE of an OBREresult object.
## S3 method for class 'OBREresult' summary(object)
## S3 method for class 'OBREresult' summary(object)
object |
The OBREresult object (output of OBRE function) that has to be plotted. |
The summary an OBREresult obect with the estimated parameters, the OBRE tuning parameter, the proportion of data weighted and the relative efficiency with respect to MLE.
try({# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # Generates input data simData = c(rnorm(100, 12, 1), rnorm(10, 10, 10)) # Estimates OBREresult object estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) # Summary of the results summary(estOBRE)})
try({# Generates the Normal distribution input for OBRE distrForOBRE <- densityExpressions(strDistribution = "normal") # Generates input data simData = c(rnorm(100, 12, 1), rnorm(10, 10, 10)) # Estimates OBREresult object estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) # Summary of the results summary(estOBRE)})