zfaigl

25 Reputation

6 Badges

14 years, 98 days

MaplePrimes Activity


These are replies submitted by zfaigl

I think, that maybe the first NumericEventHandler should be kept, and probably I should redefine the following:

0*infinity should not be undefined but should equal to 0.

How can we achieve this?

My problem is that 0*infinity does not drop an exception, which could be catched by the NumericExceptionHandler, hence maybe I should do something with define, to achieve this.

 

I tried to add more definition to the multiplication rule by

definemore(`*`,0*infinity=0), but the error is that `*` does not refer to the multiplication operator.

 

BR,

Zoltan

Hi,

 

Thank you for your answers. K (H) are simple now, but my aim is to compare different ranking methods, and the most simple is the weighted sum method, where I choose 1/3 for the weights (of the columns of the matrix X). That is why K and H became simple.

If this integration worked, I would like to tune the fX11, fX12, ... probability density functions to more realstic ones in my domain (packet delay, rate, jitter, loss) (using some heavy tail, gaussian, etc.), and compare different ranking algorithms (more complex K (H)) from the point of view that which of them makes a given alternative win more times. 

So it would be really nice if it worked with this "simple" case. I think that I should not decrease the number of variables in this comparison, because in those cases it is not realistic to use ranking algorithms.

 

Even if the example could be calculated with exact integration, other methods are less nice (in some cases non-continuous and/or non-linear). Hence maybe numerical integration would be good for me. What is your opinion? Is Montecarlo very unreliable?

I have doubts in it because it did not react in a consistent way to increaing values of the epsilon and digits parameters.

Another direction I already tried is to discretize the problem: enumerate combinations of input variables calculate the output of the ranking methods and compare ranking methods on this basis. In your opinion wouldn't this be a better direction?

The output of all of these experiences will be something like in a given use case described by the distribution of input parameters how the method selection influences the winning probabilities of a given alternative, having the  attributes in a given row of the matrix X.

Br,

Zoltan

 

Hi,

 

Thank you for your answers. K (H) are simple now, but my aim is to compare different ranking methods, and the most simple is the weighted sum method, where I choose 1/3 for the weights (of the columns of the matrix X). That is why K and H became simple.

If this integration worked, I would like to tune the fX11, fX12, ... probability density functions to more realstic ones in my domain (packet delay, rate, jitter, loss) (using some heavy tail, gaussian, etc.), and compare different ranking algorithms (more complex K (H)) from the point of view that which of them makes a given alternative win more times. 

So it would be really nice if it worked with this "simple" case. I think that I should not decrease the number of variables in this comparison, because in those cases it is not realistic to use ranking algorithms.

 

Even if the example could be calculated with exact integration, other methods are less nice (in some cases non-continuous and/or non-linear). Hence maybe numerical integration would be good for me. What is your opinion? Is Montecarlo very unreliable?

I have doubts in it because it did not react in a consistent way to increaing values of the epsilon and digits parameters.

Another direction I already tried is to discretize the problem: enumerate combinations of input variables calculate the output of the ranking methods and compare ranking methods on this basis. In your opinion wouldn't this be a better direction?

The output of all of these experiences will be something like in a given use case described by the distribution of input parameters how the method selection influences the winning probabilities of a given alternative, having the  attributes in a given row of the matrix X.

Br,

Zoltan

 

Thank you Acer! I learnt again something on Maple. Zoltan

Thank you Acer! I learnt again something on Maple. Zoltan

In that case, I assume this is a good solution to handle that solution has been found by fsolve:

 

If we have this equation:

eqn1 := f1(t)=f2(t) 

Let  the output of fsolve be tmp1

tmp1 := fsolve(eqn1, t = 0 .. 1)

 

to catch that solution has been found:

if `and`(tmp1<>NULL,type(tmp1,float)) then ... end if

 

What is your opinion?

BR,

Zoltan

In that case, I assume this is a good solution to handle that solution has been found by fsolve:

 

If we have this equation:

eqn1 := f1(t)=f2(t) 

Let  the output of fsolve be tmp1

tmp1 := fsolve(eqn1, t = 0 .. 1)

 

to catch that solution has been found:

if `and`(tmp1<>NULL,type(tmp1,float)) then ... end if

 

What is your opinion?

BR,

Zoltan

@zfaigl 

For some reason, this worked:

fDiffx:=proc(X,methodList)  # differentiate functions based on t

local i,j,tmp,U,Un;

for i in [1,2,3] do: 

tmp[i]:=diff(simplify(convert(X[i],rational)),t) assuming t>=0, t<=1;

od;

for j in [2,3] do:       

U:=convert(select(Y->type(Y,numeric),map(op,map(Y->map2(rhs@op,1,

PiecewiseTools:-ToList(Y)),indets(tmp[j],piecewise)))),list);

Un := [0, op(U), infinity];

tmp[j]:=piecewise(seq(op( [ t > Un[i] and t < Un[i+1], `assuming`([simplify(tmp[j])], [t>Un[i] and t<Un[i+1]])]), i=1..nops(Un)-1),undefined);

od;

Vector(3,i->tmp[i]);

end proc:

@zfaigl 

For some reason, this worked:

fDiffx:=proc(X,methodList)  # differentiate functions based on t

local i,j,tmp,U,Un;

for i in [1,2,3] do: 

tmp[i]:=diff(simplify(convert(X[i],rational)),t) assuming t>=0, t<=1;

od;

for j in [2,3] do:       

U:=convert(select(Y->type(Y,numeric),map(op,map(Y->map2(rhs@op,1,

PiecewiseTools:-ToList(Y)),indets(tmp[j],piecewise)))),list);

Un := [0, op(U), infinity];

tmp[j]:=piecewise(seq(op( [ t > Un[i] and t < Un[i+1], `assuming`([simplify(tmp[j])], [t>Un[i] and t<Un[i+1]])]), i=1..nops(Un)-1),undefined);

od;

Vector(3,i->tmp[i]);

end proc:

Thank you! I analyzed your commands, using maple help.

 

Finally I could use in my example the follwoing differentiation

Thank you! I analyzed your commands, using maple help.

 

Finally I could use in my example the follwoing differentiation

I forgot to say that compared to my previous question where pagan's solution worked (http://www.mapleprimes.com/questions/96934-Question-On-Differentiation-And-Integration-Problems#comment96941
), now the input Matrix X has been changed.

BR,

Zoltan

@zfaigl 


I noticed that if I plot out smaller regions of tmp[1] (distance of dia ) , the function shape is not too nice. Otherwise discont says that the function has no discontinuities. fdiscont on the other hand results regions of discontinuities.

What caused that tmp[1] is so noisy/oscillating? Did the numerical integration gave up due to this oscillation?

with('LinearAlgebra'):Testzero:= proc(O) evalb(simplify(O)=0) end:

safeDivide:=(x,y)->limit(x/b,b=y):

sumNorm:=proc(X)
local k,l,xnorm,N,M,output;

if (typematch(X,Matrix)) then
        N,M:=Dimensions(X);
        for k to M do:
                for l to N do:
                        xnorm[l,k]:=safeDivide(X[l,k],add(X[i,k],i=1..N));
                od;
        od;
        output:=Matrix(N,M,xnorm)

elif (typematch(X,Vector)) then
        N:=Dimensions(X);
        for l to N do:
                xnorm[l]:=safeDivide(X[l],add(X[i],i=1..N));
        od;
        output:=Vector(N,xnorm)
end if;
output;
end proc:

Let's compare three score aggregation method. All are f:=(X::Matrix,C::Vector) -> TerminalScores::Vector

 

1st method: simple weighted sum

simpleWeightedSum:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,N,M;
        N,M:=Dimensions(X);

        # simple weighted sum
        for j from 1 to N do:
                t[j]:=add(C[i]*X[j,i],i=1..M);
        od;
        sumNorm(Vector(N,t));
end proc:

2nd method: distance to ideal alternative

dia:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,v,Dpos,Dneg,Dposmin,Dnegmax,N,M;
        N,M:=Dimensions(X);

        #DiA
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:=add(  abs(v[j,i] - max(seq(v[k,i],k=1..N)) ) ,i=1..M );
                Dneg[j]:=add(  abs(v[j,i] - min(seq(v[k,i],k=1..N)) ) ,i=1..M );
        od;
        j,k:='j','k';
        Dposmin:=min(seq(Dpos[j],j=1..N));
        Dnegmax:=max(seq(Dneg[j],j=1..N));
        j:='j';
        for j to N do:
                t[j]:=sqrt((Dpos[j]-Dposmin)^2+(Dneg[j]-Dnegmax)^2);                
        od;
        Vector(N,1)-sumNorm(Vector(N,t));
        #Vector(N,t);
end proc:

3rd method:topsis

topsis:=proc(X::Matrix,C::Vector)
        local i,j,t,v,Dpos,Dneg,N,M;
        N,M:=Dimensions(X);

        #TOPSIS
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:= sqrt(add( (v[j,i] - max( seq( v[j,i],j=1..N ) ))^2, i=1..M));
                Dneg[j]:= sqrt(add( (v[j,i] - min( seq( v[j,i],j=1..N ) ))^2, i=1..M));
        od;
        j:='j';
        for j to N do:
                t[j]:= safeDivide(Dneg[j],(Dneg[j]+Dpos[j]));
        od;
        #Vector(N,t);
        sumNorm(Vector(N,t));        
end proc:

Number of methods to compare

numOfMethods=3;

1st input parameter of methods

X:=Matrix(3,3,<<t,0.5,0.5>|<0.5,0.5,0.5>|<0.5,0.5,0.5>>);

2nd input parameter of methods

C:=Vector(3,1/3);

I want to analyze the difference between the methods, by calculating :

   distortion1:=int(abs(terminalScore[1]_dia - terminalScore[1]_simpleWeightedSum, t=0..1), and

   distortion2:=int(abs(terminalScore[1]_topsis - terminalScore[1]_simpleWeightedSum, t=0..1)

Here I create a vector of the three decision method functions

createFunctionVector:=proc(t)
        global X,C,numOfMethods;
        local f;
        f[1]:=unapply(simpleWeightedSum(X,C),t);
        f[2]:=unapply(dia(X,C),t);
        f[3]:=unapply(topsis(X,C),t);
        Vector(3,i->f[i](t)[1]);
end proc:

termScores is the Vector of decision method functions

termScores:=createFunctionVector(t):

Now I create a procedure to differentiate the decision method functions

fDiffx:=proc(X,methodList)  # differentiate functions based on t
        local i,tmp;
        for i in methodList do:
                tmp[i]:=diff(simplify(convert(X[i],rational)),t) assuming t>=0, t<=1;
        od;
        Vector(3,i->tmp[i]);
end proc:

call the procedure to differentiate decision method function 1 and 3, i.e., simpleWeightedSum and Topsis

diffTermScores:=fDiffx(termScores,[1,2,3]): # OK for 1:simpleWeightedSum and 3:topsis

ERROR happens when I try to differentiate the dia function --> How to solve this?

fDiffx(termScores,2): # not OK for 2: dia

Now I look the "distance" of method topsis from simpleWeightedSum

distanceOfMethods:=Vector(2,<abs(diffTermScores[2]-diffTermScores[1]),abs(diffTermScores[3]-diffTermScores[1])>):

Before integration I replace undefined values to 0

tmp[1]:=unapply(subs(undefined=0,distanceOfMethods[1]),t):

tmp[2]:=unapply(subs(undefined=0,distanceOfMethods[2]),t):

I try to integrate (at least numerically) the distance of two methods to get the distortion of Topsis compared to simple weighted sum

distortion:=evalf(Int(tmp[1],0.0..1,epsilon=1e-4,digits=10)); # integration did not work for tmp[1]

distortion:=evalf(Int(tmp[2],0.0..1,epsilon=1e-4,digits=10)); # integration worked for tmp[2]

fdiscont(tmp[1], 0.47..0.52,10^(-3));

discont(tmp[1],t);

iscont(tmp[1], x = 0.48 .. 0.51);

plot(tmp[1](t),t=0.489999..0.49);

plot(tmp[1](t),t=0.4899995..0.49);

fdiscont(tmp[1],0.4899995..0.49);

plot(tmp[1](t),t=0.499999..0.5);

plot(tmp[2](t),t=0.489999..0.49);

 

 

 

 



Download question_differentia.mw

question_differentia.mw

@zfaigl 


I noticed that if I plot out smaller regions of tmp[1] (distance of dia ) , the function shape is not too nice. Otherwise discont says that the function has no discontinuities. fdiscont on the other hand results regions of discontinuities.

What caused that tmp[1] is so noisy/oscillating? Did the numerical integration gave up due to this oscillation?

with('LinearAlgebra'):Testzero:= proc(O) evalb(simplify(O)=0) end:

safeDivide:=(x,y)->limit(x/b,b=y):

sumNorm:=proc(X)
local k,l,xnorm,N,M,output;

if (typematch(X,Matrix)) then
        N,M:=Dimensions(X);
        for k to M do:
                for l to N do:
                        xnorm[l,k]:=safeDivide(X[l,k],add(X[i,k],i=1..N));
                od;
        od;
        output:=Matrix(N,M,xnorm)

elif (typematch(X,Vector)) then
        N:=Dimensions(X);
        for l to N do:
                xnorm[l]:=safeDivide(X[l],add(X[i],i=1..N));
        od;
        output:=Vector(N,xnorm)
end if;
output;
end proc:

Let's compare three score aggregation method. All are f:=(X::Matrix,C::Vector) -> TerminalScores::Vector

 

1st method: simple weighted sum

simpleWeightedSum:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,N,M;
        N,M:=Dimensions(X);

        # simple weighted sum
        for j from 1 to N do:
                t[j]:=add(C[i]*X[j,i],i=1..M);
        od;
        sumNorm(Vector(N,t));
end proc:

2nd method: distance to ideal alternative

dia:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,v,Dpos,Dneg,Dposmin,Dnegmax,N,M;
        N,M:=Dimensions(X);

        #DiA
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:=add(  abs(v[j,i] - max(seq(v[k,i],k=1..N)) ) ,i=1..M );
                Dneg[j]:=add(  abs(v[j,i] - min(seq(v[k,i],k=1..N)) ) ,i=1..M );
        od;
        j,k:='j','k';
        Dposmin:=min(seq(Dpos[j],j=1..N));
        Dnegmax:=max(seq(Dneg[j],j=1..N));
        j:='j';
        for j to N do:
                t[j]:=sqrt((Dpos[j]-Dposmin)^2+(Dneg[j]-Dnegmax)^2);                
        od;
        Vector(N,1)-sumNorm(Vector(N,t));
        #Vector(N,t);
end proc:

3rd method:topsis

topsis:=proc(X::Matrix,C::Vector)
        local i,j,t,v,Dpos,Dneg,N,M;
        N,M:=Dimensions(X);

        #TOPSIS
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:= sqrt(add( (v[j,i] - max( seq( v[j,i],j=1..N ) ))^2, i=1..M));
                Dneg[j]:= sqrt(add( (v[j,i] - min( seq( v[j,i],j=1..N ) ))^2, i=1..M));
        od;
        j:='j';
        for j to N do:
                t[j]:= safeDivide(Dneg[j],(Dneg[j]+Dpos[j]));
        od;
        #Vector(N,t);
        sumNorm(Vector(N,t));        
end proc:

Number of methods to compare

numOfMethods=3;

1st input parameter of methods

X:=Matrix(3,3,<<t,0.5,0.5>|<0.5,0.5,0.5>|<0.5,0.5,0.5>>);

2nd input parameter of methods

C:=Vector(3,1/3);

I want to analyze the difference between the methods, by calculating :

   distortion1:=int(abs(terminalScore[1]_dia - terminalScore[1]_simpleWeightedSum, t=0..1), and

   distortion2:=int(abs(terminalScore[1]_topsis - terminalScore[1]_simpleWeightedSum, t=0..1)

Here I create a vector of the three decision method functions

createFunctionVector:=proc(t)
        global X,C,numOfMethods;
        local f;
        f[1]:=unapply(simpleWeightedSum(X,C),t);
        f[2]:=unapply(dia(X,C),t);
        f[3]:=unapply(topsis(X,C),t);
        Vector(3,i->f[i](t)[1]);
end proc:

termScores is the Vector of decision method functions

termScores:=createFunctionVector(t):

Now I create a procedure to differentiate the decision method functions

fDiffx:=proc(X,methodList)  # differentiate functions based on t
        local i,tmp;
        for i in methodList do:
                tmp[i]:=diff(simplify(convert(X[i],rational)),t) assuming t>=0, t<=1;
        od;
        Vector(3,i->tmp[i]);
end proc:

call the procedure to differentiate decision method function 1 and 3, i.e., simpleWeightedSum and Topsis

diffTermScores:=fDiffx(termScores,[1,2,3]): # OK for 1:simpleWeightedSum and 3:topsis

ERROR happens when I try to differentiate the dia function --> How to solve this?

fDiffx(termScores,2): # not OK for 2: dia

Now I look the "distance" of method topsis from simpleWeightedSum

distanceOfMethods:=Vector(2,<abs(diffTermScores[2]-diffTermScores[1]),abs(diffTermScores[3]-diffTermScores[1])>):

Before integration I replace undefined values to 0

tmp[1]:=unapply(subs(undefined=0,distanceOfMethods[1]),t):

tmp[2]:=unapply(subs(undefined=0,distanceOfMethods[2]),t):

I try to integrate (at least numerically) the distance of two methods to get the distortion of Topsis compared to simple weighted sum

distortion:=evalf(Int(tmp[1],0.0..1,epsilon=1e-4,digits=10)); # integration did not work for tmp[1]

distortion:=evalf(Int(tmp[2],0.0..1,epsilon=1e-4,digits=10)); # integration worked for tmp[2]

fdiscont(tmp[1], 0.47..0.52,10^(-3));

discont(tmp[1],t);

iscont(tmp[1], x = 0.48 .. 0.51);

plot(tmp[1](t),t=0.489999..0.49);

plot(tmp[1](t),t=0.4899995..0.49);

fdiscont(tmp[1],0.4899995..0.49);

plot(tmp[1](t),t=0.499999..0.5);

plot(tmp[2](t),t=0.489999..0.49);

 

 

 

 



Download question_differentia.mw

question_differentia.mw

Thank you, I learnt it now. I have another problem. I try to analyze the distortion of methods in different cases for the X input Matrix. For some X , the distance function (i.e., abs( D(f2)-D(f1) )) contains dirac deltas.

In the following example, I only modified X to a new Matrix (besides adding the previous recommended modification). With this X I experienced that the numerical integration returns quite soon, but only with symbolic value, and I think that it is caused by the "dirac delta" part of the function. 

In general, how should we deal with this problem? I would like to have some distortion value, but maybe skipping out in the integration those x values where the value of the function to integrate is "infinite".

Can we find these x points, and integrate the function skipping out these points? Or what is a good treatment of this problem?

BR,

Zoltan Faigl



with('LinearAlgebra'):Testzero:= proc(O) evalb(simplify(O)=0) end:

safeDivide:=(x,y)->limit(x/b,b=y):

sumNorm:=proc(X)
local k,l,xnorm,N,M,output;

if (typematch(X,Matrix)) then
        N,M:=Dimensions(X);
        for k to M do:
                for l to N do:
                        xnorm[l,k]:=safeDivide(X[l,k],add(X[i,k],i=1..N));
                od;
        od;
        output:=Matrix(N,M,xnorm)

elif (typematch(X,Vector)) then
        N:=Dimensions(X);
        for l to N do:
                xnorm[l]:=safeDivide(X[l],add(X[i],i=1..N));
        od;
        output:=Vector(N,xnorm)
end if;
output;
end proc:

Let's compare three score aggregation method. All are f:=(X::Matrix,C::Vector) -> TerminalScores::Vector

 

1st method: simple weighted sum

simpleWeightedSum:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,N,M;
        N,M:=Dimensions(X);

        # simple weighted sum
        for j from 1 to N do:
                t[j]:=add(C[i]*X[j,i],i=1..M);
        od;
        sumNorm(Vector(N,t));
end proc:

2nd method: distance to ideal alternative

dia:=proc(X::Matrix,C::Vector)
        local i,j,k,l,t,v,Dpos,Dneg,Dposmin,Dnegmax,N,M;
        N,M:=Dimensions(X);

        #DiA
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:=add(  abs(v[j,i] - max(seq(v[k,i],k=1..N)) ) ,i=1..M );
                Dneg[j]:=add(  abs(v[j,i] - min(seq(v[k,i],k=1..N)) ) ,i=1..M );
        od;
        j,k:='j','k';
        Dposmin:=min(seq(Dpos[j],j=1..N));
        Dnegmax:=max(seq(Dneg[j],j=1..N));
        j:='j';
        for j to N do:
                t[j]:=sqrt((Dpos[j]-Dposmin)^2+(Dneg[j]-Dnegmax)^2);                
        od;
        Vector(N,1)-sumNorm(Vector(N,t));
        #Vector(N,t);
end proc:

3rd method:topsis

topsis:=proc(X::Matrix,C::Vector)
        local i,j,t,v,Dpos,Dneg,N,M;
        N,M:=Dimensions(X);

        #TOPSIS
        for i to M do:
                for j to N do:
                        v[j,i]:=C[i]*X[j,i];
                od;
        od;
        i,j:='i','j';
        for j to N do:
                Dpos[j]:= sqrt(add( (v[j,i] - max( seq( v[j,i],j=1..N ) ))^2, i=1..M));
                Dneg[j]:= sqrt(add( (v[j,i] - min( seq( v[j,i],j=1..N ) ))^2, i=1..M));
        od;
        j:='j';
        for j to N do:
                t[j]:= safeDivide(Dneg[j],(Dneg[j]+Dpos[j]));
        od;
        #Vector(N,t);
        sumNorm(Vector(N,t));        
end proc:

Number of methods to compare

numOfMethods=3;

1st input parameter of methods

X:=Matrix(3,3,<<t,0.5,0.5>|<0.5,0.5,0.5>|<0.5,0.5,0.5>>);

2nd input parameter of methods

C:=Vector(3,1/3);

I want to analyze the difference between the methods, by calculating :

   distortion1:=int(abs(terminalScore[1]_dia - terminalScore[1]_simpleWeightedSum, t=0..1), and

   distortion2:=int(abs(terminalScore[1]_topsis - terminalScore[1]_simpleWeightedSum, t=0..1)

Here I create a vector of the three decision method functions

createFunctionVector:=proc(t)
        global X,C,numOfMethods;
        local f;
        f[1]:=unapply(simpleWeightedSum(X,C),t);
        f[2]:=unapply(dia(X,C),t);
        f[3]:=unapply(topsis(X,C),t);
        Vector(3,i->f[i](t)[1]);
end proc:

termScores is the Vector of decision method functions

termScores:=createFunctionVector(t):

Now I create a procedure to differentiate the decision method functions

fDiffx:=proc(X,methodList)  # differentiate functions based on t
        local i,tmp;
        for i in methodList do:
                tmp[i]:=diff(simplify(convert(X[i],rational)),t) assuming t>0, t<1;
        od;
        Vector(3,i->tmp[i]);
end proc:

call the procedure to differentiate decision method function 1 and 3, i.e., simpleWeightedSum and Topsis

diffTermScores:=fDiffx(termScores,[1,2,3]): # OK for 1:simpleWeightedSum and 3:topsis

ERROR happens when I try to differentiate the dia function --> How to solve this?

fDiffx(termScores,2): # not OK for 2: dia

Now I look the "distance" of method topsis from simpleWeightedSum

distanceOfMethods:=Vector(2,<abs(diffTermScores[2]-diffTermScores[1]),abs(diffTermScores[3]-diffTermScores[1])>):

Before integration I replace undefined values to 0

tmp[1]:=unapply(subs(undefined=0,distanceOfMethods[1]),t):

tmp[2]:=unapply(subs(undefined=0,distanceOfMethods[2]),t):

I try to integrate (at least numerically) the distance of two methods to get the distortion of Topsis compared to simple weighted sum

distortion:=evalf(Int(tmp[1],0.0..1,epsilon=1e-4,digits=10)); # integration did not work for tmp[1]

distortion:=evalf(Int(tmp[2],0.0..1,epsilon=1e-4,digits=10)); # integration worked for tmp[2]

tmp[1](t):

plot(tmp[1](t),t=0.0..1);

plot(tmp[2](t),t=0.0..1);

 

 

 

 

question_differentia.mw

Download question_differentia.mw

1 2 Page 1 of 2