| Title: | linear Likelihood-based Imprecise Regression |
|---|---|
| Description: | This package implements the methodology of Likelihood-based Imprecise Regression (LIR) for the case of linear regression with interval data. Compatibility updates by Renova. |
| Authors: | Andrea Wiencierz |
| Maintainer: | Andrea Wiencierz <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.1.9001 |
| Built: | 2026-11-15 20:45:20 UTC |
| Source: | https://github.com/renova-r/linLIR |
Function within the s.linlir-function that determines the Likelihood-based Region Minimax (LRM) line(s).
gen.lms(dat, p = 0.5, bet, epsilon = 0, k.u = 0)gen.lms(dat, p = 0.5, bet, epsilon = 0, k.u = 0)
dat |
An |
p |
Quantile of the abolute residuals' distribution to be used as loss function in the LIR analysis. (0.5 corresponds to the median.) |
bet |
Cutoff-point for the normalized profile likelihood function. |
epsilon |
Fraction of coarsening errors considered. |
k.u |
As default |
The gen.lms-function implements the first part of the exact algorithm for the simple linear LIR analysis with interval data developed in M. Cattaneo, A. Wiencierz (2012c). This first part of the algorithm can be seen as a generalization of the basic algorithm for Least Median of Squares Regression (see, e.g., Steele / Steiger (1986) and Rousseeuw / Leroy (1987)).
A list of two components.
lrm |
A vector (or a matrix) of the intercept and slope parameter values of the LRM line(s) and the value of the p-quantile of the absolute residuals associated with the LRM line(s). |
b.val |
A vector of all slope values considered for the LRM line(s). |
dat.unique |
A data frame of all unique observations in the analyzed data set. |
ind.dat |
A matrix of the indices of all combinations of 2 unique data points. |
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
P. Rousseeuw, A. Leroy (1987). Robust Regression and Outlier Detection. Wiley.
J. Steele, W. Steiger (1986). Algorithms and complexity for least median of squares regression. Discret Appl Math 14. 93-100.
Create an interval data frame (idf-object), summarize its content and visualize subsets of two variables.
idf.create(dat, var.labels = NULL) ## S3 method for class 'idf' summary(object, ...) ## S3 method for class 'idf' plot(x, y=NULL, ..., var = NULL, typ="hist", k.x = 1, k.y = 1, inf.margin=10, p.cex=1, col.lev=15, plot.grid=FALSE, x.adj = 0.5, x.padj = 3, y.las = 0, y.adj = 1, y.padj = 0, x.lim = c(0, 0), y.lim = c(0, 0), x.lab = "X", y.lab = "Y")idf.create(dat, var.labels = NULL) ## S3 method for class 'idf' summary(object, ...) ## S3 method for class 'idf' plot(x, y=NULL, ..., var = NULL, typ="hist", k.x = 1, k.y = 1, inf.margin=10, p.cex=1, col.lev=15, plot.grid=FALSE, x.adj = 0.5, x.padj = 3, y.las = 0, y.adj = 1, y.padj = 0, x.lim = c(0, 0), y.lim = c(0, 0), x.lab = "X", y.lab = "Y")
dat |
A |
var.labels |
Names of the variables corresponding to the interval-valued observations in the |
object |
The |
... |
Argument of the generic functions |
x |
Argument of the generic function |
y |
Argument of the generic function |
var |
Names of the two variables out of the |
typ |
Type of the plot. Possible values are |
k.x |
Particular plot function parameter. 1/ |
k.y |
Particular plot function parameter. 1/ |
inf.margin |
Particular parameter for plot type |
p.cex |
Particular parameter for plot type |
col.lev |
Particular parameter for plot type |
plot.grid |
Logical for plot type |
x.adj |
Horizontal position of the text for the abscissa. |
x.padj |
Vertical position of the text for the abscissa. |
y.las |
Orientation of the text for the ordinate. |
y.adj |
|
y.padj |
|
x.lim |
The limits for the abscissa of the plot. |
y.lim |
The limits for the ordinate of the plot. |
x.lab |
Title of the abscissa. |
y.lab |
Title of the ordinate. |
Within the LIR framework all types of interval data are possible, including the particular cases of actually precise data (i.e., lower endpoint = upper endpoint) or missing data (i.e., in case of a real valued variable, lower endpoint = -Inf and upper endpoint = Inf). For the LIR analysis it makes practically no difference if the intervals are closed or not, therefore, the created idf-object does not contain this information.
An idf-object of m variables, which is a list of m+1 entries.
Var1 ... varm |
|
n |
Number of observations. |
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
data('toy.smps') toy.idf <- idf.create(toy.smps, var.labels=c("x","y")) summary(toy.idf) plot(toy.idf, typ="draft", k.x=10, k.y=10, p.cex=1.5, y.las=1, y.adj=6) plot(toy.idf, typ="draft", k.x=10, k.y=10, x.adj=0.7, y.las=1, y.adj=6, y.padj=-3) plot(toy.idf, k.x=10, k.y=10, x.adj=0.7, x.padj=4, y.adj=0.7, y.padj=-4) data('pm10') pm.idf <- idf.create(pm10) summary(pm.idf) plot(pm.idf, typ="draft", k.x=10, k.y=20, p.cex=0.35, x.adj=0.5, x.padj=4, y.las=0, y.adj=0.5, y.padj=-4, x.lab="temperature", y.lab="particulate matter concentration")data('toy.smps') toy.idf <- idf.create(toy.smps, var.labels=c("x","y")) summary(toy.idf) plot(toy.idf, typ="draft", k.x=10, k.y=10, p.cex=1.5, y.las=1, y.adj=6) plot(toy.idf, typ="draft", k.x=10, k.y=10, x.adj=0.7, y.las=1, y.adj=6, y.padj=-3) plot(toy.idf, k.x=10, k.y=10, x.adj=0.7, x.padj=4, y.adj=0.7, y.padj=-4) data('pm10') pm.idf <- idf.create(pm10) summary(pm.idf) plot(pm.idf, typ="draft", k.x=10, k.y=20, p.cex=0.35, x.adj=0.5, x.padj=4, y.las=0, y.adj=0.5, y.padj=-4, x.lab="temperature", y.lab="particulate matter concentration")
k.l and k.u
Internal function to determine the quantities k.l and k.u on the basis of n, p, bet. This function is used within the (internal) functions gen.lms, undom.a and undom.para.
kl.ku(n, p = 0.5, bet, epsilon = 0)kl.ku(n, p = 0.5, bet, epsilon = 0)
n |
Number of observations. |
p |
Quantile of the abolute residuals' distribution to be used as loss function in the LIR analysis. (0.5 corresponds to the median.) |
bet |
Cutoff-point for the normalized profile likelihood function. |
epsilon |
Fraction of coarsening errors considered. |
A vector with 2 elements, k.l and k.u.
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
This data set was analyzed M. Cattaneo, A. Wiencierz (2012c).
data('pm10')data('pm10')
A data.frame containing 514 rows and 4 columns, i.e. 2 neighboring columns for each variable, the first column for the left endpoints of the interval observations, the second for the right endpoints.
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
Conducts a LIR analysis for 2 variables with interval-valued observations whose relation is assumed to be linear.
s.linlir(dat.idf, var=NULL, p=0.5, bet, epsilon=0, a.grid=100) ## S3 method for class 's.linlir' print(x, ...) ## S3 method for class 's.linlir' summary(object, ...) ## S3 method for class 's.linlir' plot(x, y=NULL, ..., typ, para.typ="polygon", b.grid=500, nb.func=1000, seed.func=NULL, pl.lrm=TRUE, pl.band=FALSE, lrm.col="blue", pl.dat=FALSE, pl.dat.typ="hist", k.x=1, k.y=1, inf.margin=10, p.cex=1, col.lev=15, plot.grid=FALSE, x.adj=0.5, x.padj=3, y.las=0, y.adj=1, y.padj=0,x.lim=c(0,0), y.lim=c(0,0), x.lab=" ", y.lab=" ")s.linlir(dat.idf, var=NULL, p=0.5, bet, epsilon=0, a.grid=100) ## S3 method for class 's.linlir' print(x, ...) ## S3 method for class 's.linlir' summary(object, ...) ## S3 method for class 's.linlir' plot(x, y=NULL, ..., typ, para.typ="polygon", b.grid=500, nb.func=1000, seed.func=NULL, pl.lrm=TRUE, pl.band=FALSE, lrm.col="blue", pl.dat=FALSE, pl.dat.typ="hist", k.x=1, k.y=1, inf.margin=10, p.cex=1, col.lev=15, plot.grid=FALSE, x.adj=0.5, x.padj=3, y.las=0, y.adj=1, y.padj=0,x.lim=c(0,0), y.lim=c(0,0), x.lab=" ", y.lab=" ")
dat.idf |
The |
var |
Names of the two variables out of the |
p |
Quantile of the abolute residuals' distribution to be used as loss function in the LIR analysis. (0.5 corresponds to the median.) |
bet |
Cutoff-point for the normalized profile likelihood function. |
epsilon |
Fraction of coarsening errors considered. |
a.grid |
Particular parameter of the internal function |
x |
Argument of the generic functions |
... |
Argument of the generic functions |
object |
The |
y |
Argument of the generic function |
typ |
Type of the plot. Possible values are |
para.typ |
Options for plot of |
b.grid |
Parameter for plot of |
nb.func |
Number of (randomly chosen) plotted undominated lines for plots of |
seed.func |
Set seed for the random selection of plotted regression lines for plots of |
pl.lrm |
Logical for plots of |
lrm.col |
Color used to highlight the LRM regression lines in the plots of |
pl.band |
Logical for plots of |
pl.dat |
Logical for plots of |
pl.dat.typ |
Type of the data plot. Possible values are |
k.x |
Particular data plot function parameter. 1/ |
k.y |
Particular data plot function parameter. 1/ |
inf.margin |
Particular parameter for data plot with |
p.cex |
Particular parameter for data plot with |
col.lev |
Particular parameter for data plot with |
plot.grid |
Logical for data plot with |
x.adj |
Horizontal position of the text for the abscissa. |
x.padj |
Vertical position of the text for the abscissa. |
y.las |
Orientation of the text for the ordinate. |
y.adj |
|
y.padj |
|
x.lim |
The limits for the abscissa of the plot. |
y.lim |
The limits for the ordinate of the plot. |
x.lab |
Title of the abscissa. |
y.lab |
Title of the ordinate. |
f.lrm |
Intercept and slope value(s) of the Likelihood-based Region Minimax (LRM) regression line(s). |
q.lrm |
Value of the p-quantile of the absolute residuals associated with the LRM regression line(s). |
a.undom |
Range of intercept values of the undominated regression lines. |
b.undom |
Range of slope values of the undominated regression lines. |
undom.para |
A matrix of undominated parameter combinations approximating the entire set of parameters corresponding to the set of undominated regression lines. |
config |
A list containing information about the settings of the LIR analysis. |
dat |
An |
n |
Number of observations. |
call |
Call of the function |
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
idf.create,
gen.lms,
kl.ku,
undom.para
data('toy.smps') toy.idf <- idf.create(toy.smps, var.labels=c("x","y")) test <- s.linlir(toy.idf, bet=0.5) test summary(test) plot(test, typ="para", x.adj=0.7, y.las=1, y.adj=6, y.padj=-3) plot(test, typ="func", pl.lrm=FALSE, x.adj=0.7, y.adj=0.7, y.padj=-3) plot(test, typ="lrm", lrm.col="red", pl.band=TRUE, pl.dat=TRUE, pl.dat.typ="draft",k.x=10, k.y=10, y.las=1, y.adj=6)data('toy.smps') toy.idf <- idf.create(toy.smps, var.labels=c("x","y")) test <- s.linlir(toy.idf, bet=0.5) test summary(test) plot(test, typ="para", x.adj=0.7, y.las=1, y.adj=6, y.padj=-3) plot(test, typ="func", pl.lrm=FALSE, x.adj=0.7, y.adj=0.7, y.padj=-3) plot(test, typ="lrm", lrm.col="red", pl.band=TRUE, pl.dat=TRUE, pl.dat.typ="draft",k.x=10, k.y=10, y.las=1, y.adj=6)
This data set was used for the illustrations in A. Wiencierz, M. Cattaneo (2012b).
data('toy.smps')data('toy.smps')
A data.frame containing 17 rows and 4 columns, i.e. 2 neighboring columns for each variable, the first column for the left endpoints of the interval observations, the second for the right endpoints.
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.
Functions within the s.linlir-function that determine the parameter combinations corresponding to undominated regression lines. The undom.a-function finds the set of undominated intercept values associated with a given slope and the undom.para-function finds the set of undominated intercept values associated with a given vector of slope values.
undom.a(dat, b, q.lrm, p = 0.5, bet, epsilon = 0) undom.para(dat, b.range, a.grid = 100, q.lrm, p = 0.5, bet, epsilon = 0)undom.a(dat, b, q.lrm, p = 0.5, bet, epsilon = 0) undom.para(dat, b.range, a.grid = 100, q.lrm, p = 0.5, bet, epsilon = 0)
dat |
An |
b |
A given value for the slope of a regression line. |
q.lrm |
Value of the p-quantile of the absolute residuals associated with the LRM line(s). |
p |
Quantile of the abolute residuals' distribution to be used as loss function in the LIR analysis. (0.5 corresponds to the median.) |
bet |
Cutoff-point for the normalized profile likelihood function. |
epsilon |
Fraction of coarsening errors considered. |
b.range |
Vector of slope values handed over to the function |
a.grid |
Particular parameter of the function |
The undom.para-function together with some preparational steps in the s.linlir-function implement the second part of the exact algorithm for the simple linear LIR analysis with interval data developed in M. Cattaneo, A. Wiencierz (2012c).
The undom.a-function returns a list of 2 components:
result1 |
A 2-column matrix of possibly degenerate intervals for the undominated intercept values associated with the given slope b. |
result2 |
The information of |
The undom.para-function returns a list of 3 components:
a.undom |
Range of intercept values of the undominated regression lines. |
b.undom |
Range of slope values of the undominated regression lines. |
undom.para |
A matrix of undominated parameter combinations approximating the entire set of parameters corresponding to the set of undominated regression lines. |
M. Cattaneo, A. Wiencierz (2012c). On the implementation of LIR: the case of simple linear regression with interval data. Technical Report No. 127. Department of Statistics. LMU Munich.
A. Wiencierz, M. Cattaneo (2012b). An exact algorithm for Likelihood-based Imprecise Regression in the case of simple linear regression with interval data. In: R. Kruse et al. (Eds.). Advances in Intelligent Systems and Computing. Vol. 190. Springer. pp. 293-301.
M. Cattaneo, A. Wiencierz (2012a). Likelihood-based Imprecise Regression. International Journal of Approximate Reasoning. Vol. 53. pp. 1137-1154.