MrMarc

3163 Reputation

18 Badges

17 years, 137 days

MaplePrimes Activity


These are replies submitted by MrMarc

Thanx for that. That was pretty fast actually :-) The problem is though
that I need the index numbers as well (for identification) or more specifically
I need it in the below format. Is this possible to incorporate it into you code ?

i, - j, Ans[i, j]
i, - j, Ans[i, j]
i, - j, Ans[i, j]

preferably in a Matrix :-). That is basically was sortX does. The frst two loops identify the maximum value and the
last two loops check if Ans[i,j]=maximum value and the return [i, -j, Ans[i, j]. The last loop does that
10 times, after each iteration the Ans[i,j] which contain the maximium value is assigned to zero inorder
for the second itteration to get the second largest value etc

Thanx for that. That was pretty fast actually :-) The problem is though
that I need the index numbers as well (for identification) or more specifically
I need it in the below format. Is this possible to incorporate it into you code ?

i, - j, Ans[i, j]
i, - j, Ans[i, j]
i, - j, Ans[i, j]

preferably in a Matrix :-). That is basically was sortX does. The frst two loops identify the maximum value and the
last two loops check if Ans[i,j]=maximum value and the return [i, -j, Ans[i, j]. The last loop does that
10 times, after each iteration the Ans[i,j] which contain the maximium value is assigned to zero inorder
for the second itteration to get the second largest value etc

All right thanx acer. Sorry If I am being a bit anal here (or potentially waisting your time) here but it is
just that I want to completely understand what is going on because there could potentially be much
at stake if the code was misspecified. I have already initially confirmed that it seem to work as it
should but I am going to do more tests and as I said previously it is very fast which is nice.

"As I wrote it, the inner such loop goes from 1 to i. If you instead made j go from 1 to NSTOCK then it
would compute all NSTOCK^2 entries."

Yes it makes sence when you pointed it out (I missed that completely) again when I have confirmed that
the result matrix is symmetrical in absoulte terms for j=1..nstock  I will happily use your much faster version
because as you said it does not make sense to do all calulations twice if they are more or less the same.
It is just waisting precious time and recources. Again thanx for taking the time to help me :-)

All right thanx acer. Sorry If I am being a bit anal here (or potentially waisting your time) here but it is
just that I want to completely understand what is going on because there could potentially be much
at stake if the code was misspecified. I have already initially confirmed that it seem to work as it
should but I am going to do more tests and as I said previously it is very fast which is nice.

"As I wrote it, the inner such loop goes from 1 to i. If you instead made j go from 1 to NSTOCK then it
would compute all NSTOCK^2 entries."

Yes it makes sence when you pointed it out (I missed that completely) again when I have confirmed that
the result matrix is symmetrical in absoulte terms for j=1..nstock  I will happily use your much faster version
because as you said it does not make sense to do all calulations twice if they are more or less the same.
It is just waisting precious time and recources. Again thanx for taking the time to help me :-)

Ok boss thank for your help and support..."mother-of-a-compilable-proc" ha ha sweet :-)

Ok boss thank for your help and support..."mother-of-a-compilable-proc" ha ha sweet :-)

Sweet excellent stuff !  Thanx for your effort !  I thought is would be
much harder to get expected return and standard deviation but after I
have seen you do it it all make sense :-) I think I will manage to do the rest.
I will post an updated version when I have a compiled procedure  :-)

Sweet excellent stuff !  Thanx for your effort !  I thought is would be
much harder to get expected return and standard deviation but after I
have seen you do it it all make sense :-) I think I will manage to do the rest.
I will post an updated version when I have a compiled procedure  :-)

I dont understand what AbsolutePath does ?

I dont understand what AbsolutePath does ?

All right thanx. That worked better :-)

All right thanx. That worked better :-)

I think esignal www.esignal.com/  has the most competitive priced data both historical and rt ie EsignalOnDemand
15 £ per month. The thing is though why pay for something that you can get for free (yahoo finance) :-)

I think esignal www.esignal.com/  has the most competitive priced data both historical and rt ie EsignalOnDemand
15 £ per month. The thing is though why pay for something that you can get for free (yahoo finance) :-)

I initially thought that the solution was simple but that was not the case. I tried the below code
but it is still quite slow:

restart:

X10 := proc (ap) local z;

z := compiletable([1 = evalf(exp(1.0), 10), 2 = evalf(exp(1.0), 100), 3 = evalf(exp(1.0), 1000), 4 = evalf(exp(1.0), 10000), 5 = evalf(exp(1.0), 100000)]);

return tablelook(ap, z) ;

end proc:

st := time():   X10(5) ;  time()-st ;

                                 13.29592962

First 21 22 23 24 25 26 27 Last Page 23 of 33