Learn R Programming

SAFD (version 0.3)

lrmodel: Linear Regression model

Description

The linear regression model Y=aX+eps for trapezoidal fuzzy numbers as described in [1] has been implemented, whereby the least-squares-minimization (with constraints) is done with respect to the Bertoluzza metric (with theta=1/3). Given lists XX, YY of polygonal fuzzy numbers the functions first checks (1) if each element of the two list is in the correct form (tested by checking), (2) if the alpha-levels of all elements in the two lists coincide and (3) if the lists have the same length. If all conditions are fulfilled the function automatically converts the fuzzy numbers in XX and YY in trapezoidal ones and returns the estimations for the parameters a and B - in case of double solutions both solutions are returned.

Usage

lrmodel(XX, YY)

Arguments

XX
...list of polygonal fuzzy numbers (the functions implicitly checks the conditions) having the same length as YY
YY
...list of polygonal fuzzy numbers (the functions implicitly checks the conditions) having the same length as XX

Value

  • Given input XX, YY in the correct format the function returns a list containing the estimates for a and B (in case of double solutions both solutions are returned).

Details

See examples

References

[1] Gonzalez-Rodriguez, G.; Blanco, A.; Colubi, A.; Lubiano, M.A.: Estimation of a simple linear regression model for fuzzy random variables, Fuzzy Sets and Systems, 160(3), pp. 357-370 (2009) [2] Gil, M.A., Lopez, M.T., Lubiano, M.A., Montenegro, M.: Regression and correlation analyses of a linear relation between random intervals, Test, 10(1), pp. 183-201 (2001)

See Also

See Also as checking, Mmean, hukuhara, Bvar, Bcov, bertoluzza

Examples

Run this code
#Example 1 (crisp case)
XX<-vector("list",length=2)
XX[[1]]<-data.frame(cbind(x=c(1,1,1,1),alpha=c(0,1,1,0)))
XX[[2]]<-data.frame(cbind(x=c(2,2,2,2),alpha=c(0,1,1,0)))
YY<-list(length=2)
YY[[1]]<-data.frame(cbind(x=c(1,1,1,1),alpha=c(0,1,1,0)))
YY[[2]]<-data.frame(cbind(x=c(2,2,2,2),alpha=c(0,1,1,0)))
m<-lrmodel(XX,YY)
m

#Example 2:
data(XX)
V<-translator(XX[[3]],100)
XX<-vector("list",length=50)
YY<-XX
  for(i in 1:50){
   XX[[i]]<-generator(V,,,)
   YY[[i]]<-XX[[i]]
   YY[[i]]$x<-5*YY[[i]]$x+1
   }
m<-lrmodel(XX,YY)
m

Run the code above in your browser using DataLab