Forum Navigation:


FORUMS > The Quantitative Finance FAQs Project < refresh >
Topic Title: Mathematica vs Matlab vs Maple, discuss
Created On Wed Aug 30, 06 06:38 PM
Topic View:

Pages: [ << 1 2 3 >> Previous Next ]
View thread in raw text format


ZmeiGorynych
Senior Member

Posts: 875
Joined: Jul 2005

Fri Jul 06, 07 08:37 AM
User is offline View users profile

Oh, and BTW MATLAB's financial toolbox is quite overpriced for what it is. If you consider MATLAB, just get base, optimization and statistics toolboxes (plus any interfaces to excel, datafeeds etc if your interests lie that way).

-------------------------
You give a hungry man a fish, he owes you one fish. You teach him to fish, you lose your monopoly on fishing.
 
Reply
   
Quote
   
Top
   
Bottom
     



guillaume07
Member

Posts: 37
Joined: Feb 2007

Tue Jul 10, 07 10:03 AM
User is offline

Scilab is a great tool too and is it free....
 
Reply
   
Quote
   
Top
   
Bottom
     



Alan
Senior Member

Posts: 3628
Joined: Dec 2001

Tue Jul 10, 07 03:20 PM
User is offline View users profile

Quote

Originally posted by: ZmeiGorynych

Another issue is that a MATLAB license is perpetual (you only get free updates for a year, but you may keep using that version forever), whereas Mathematica, last I heard, had the unspeakable policy of making you pay EVERY YEAR.



That's wrong. You pay for Mathematica once for an individual license which is perpetual;
you pay again (at the upgrade rate) only if you want to upgrade to a new version.

 
Reply
   
Quote
   
Top
   
Bottom
     



stonexu1984
Member

Posts: 82
Joined: Mar 2007

Sat Jul 14, 07 04:58 AM
User is offline

garch toolbox is also worth to get. For univariate, I prefer mathwork's garch to UCSD's
 
Reply
   
Quote
   
Top
   
Bottom
     



MCarreira
Senior Member

Posts: 1318
Joined: Jul 2002

Wed Jul 18, 07 01:23 AM
User is offline View users profile

Quote

Originally posted by: Alan
Quote

Originally posted by: ZmeiGorynych

Another issue is that a MATLAB license is perpetual (you only get free updates for a year, but you may keep using that version forever), whereas Mathematica, last I heard, had the unspeakable policy of making you pay EVERY YEAR.



That's wrong. You pay for Mathematica once for an individual license which is perpetual;
you pay again (at the upgrade rate) only if you want to upgrade to a new version.


If you buy the Premium License (use in 2 computers plus free upgrades plus Premium support and stuff) then you pay every year.



-------------------------
"The best lack all conviction, while the worst
Are full of passionate intensity." - W.B. Yeats
 
Reply
   
Quote
   
Top
   
Bottom
     



dibble
Senior Member

Posts: 727
Joined: Oct 2006

Wed Jul 18, 07 01:27 AM
User is offline

-- If you buy the Premium License (use in 2 computers plus free upgrades plus Premium support and stuff) then you pay every year.

But not the full price. You pay a maintenance price.

-- whereas Mathematica, last I heard, had the unspeakable policy of making you pay EVERY YEAR.

The same rules apply for Matlab and Mathematica

-------------------------
"I am not saying that Bush, Cheney and Rumsfeld should be taken outside and shot. What I am saying is that they should be tried on the charge of High treason and then taken outside and shot"

"Religion of course is primarily the mixture of faith and fear. The latter a base human condition, the former a learned human reaction and a mere veil for the latter."

Edited: Wed Jul 18, 07 at 01:29 AM by dibble
 
Reply
   
Quote
   
Top
   
Bottom
     



jaegerstar2000
Junior Member

Posts: 2
Joined: Jun 2007

Sun Aug 12, 07 11:31 AM
User is offline

Mathematica has a time series package which has a huge bug in it for determining (G)ARCH.
I want my money back and the sales department is quiet. Technical support are looking
into it. But, no end in sight.......

The bug is that the package does not respect the non-negativity on the coefficients. Which means
sometimes you will receive a complex solution!!!
(see other posts by me on the internet for a more detailed explanation to this problem).

Mathematica version 6.0
Timeseries Package Version: 1.0

Until they fix it, do not purchase the package as you will not get your money back.

Instead, Engle recommends Eviews. I recommend either: MATLAB, Ox, Eviews, SAS, Gauss and maybe
R-Project: tSeries for fitting GARCH.

Ian Gregory.
 
Reply
   
Quote
   
Top
   
Bottom
     



ZmeiGorynych
Senior Member

Posts: 875
Joined: Jul 2005

Sun Aug 19, 07 10:41 PM
User is offline View users profile

Quote

Originally posted by: guillaume07
Scilab is a great tool too and is it free....

We played with it a year or so ago and found it was incredibly slow on datasets of any size at all (considering it's MATLAB we're benchmarking against, that's quite an achievement ) as well as not supporting the full set of matlab commands, nor the same quality of GUI.

Why bother with clones - I'd either get the real thing, or use another language such as python.

-------------------------
You give a hungry man a fish, he owes you one fish. You teach him to fish, you lose your monopoly on fishing.
 
Reply
   
Quote
   
Top
   
Bottom
     



Hamilton
Senior Member

Posts: 5776
Joined: Jul 2001

Sun Aug 26, 07 03:19 AM
User is offline

I would like to know if any actuaries are using Mathematica and, if so, to what extent does it replace APL in their applications.

-------------------------
Despotism has so often been established in the name of liberty that experience should warn us to judge parties by their practices rather than their preachings.

—Raymond Aron, The Opium of the Intellectuals
 
Reply
   
Quote
   
Top
   
Bottom
     



Alan
Senior Member

Posts: 3628
Joined: Dec 2001

Sun Aug 26, 07 04:38 PM
User is offline View users profile

Can anyone match or beat either of these running times?
If so what's your setup? (Matlab/Mathematica Version #, CPU, Brand, Model, Op. Sys., Memory)


Matlab
---------------------------
M = rand(300,300);
t=0.25; T=2;
tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;
Elapsed time is 0.288171 seconds


Mathematica
---------------------------
M = Table[Random[], {i, 1, 300}, {j, 1, 300}];
t = 0.25; T= 2;
Timing[Inverse[M].(MatrixExp[-M t] - MatrixExp[-M T]);]
{0.375 Second, Null}




Edited: Sun Aug 26, 07 at 10:57 PM by Alan
 
Reply
   
Quote
   
Top
   
Bottom
     



AVt
Senior Member

Posts: 788
Joined: Dec 2001

Sun Aug 26, 07 07:31 PM
User is offline View users profile

with a bit guessing ( random = uniform in [0,1] and timing = execution time [not CPU time] ):

on my medium sized PC Maple needs about 10 times more, 90% seems to be spent on
computing the exponentials (working with hardware precision, no symbolics intended)

edited: forgot to say it needs ~ 2 seconds

Edited: Sun Aug 26, 07 at 07:35 PM by AVt
 
Reply
   
Quote
   
Top
   
Bottom
     



Alan
Senior Member

Posts: 3628
Joined: Dec 2001

Sun Aug 26, 07 11:05 PM
User is offline View users profile

Yes, you guessed right on the random numbers.
The timings are simply the standard timings for each software system respectively.
According to Mathematica: Timing[ ] "includes only CPU time spent in the Mathematica kernel"
I don't have Matlab, so not sure there.

My newest desktop is a couple years old, and I get 2.5 secs for the Mathematica problem.
But user:tonyd reports these times I have posted on a 2.66GHz Intel PC, but we don't know the rest of his setup.
My deskotp is a 2.99GHZ Intel PC running Mathematica Ver. 5.0 (Ver. 6.0.1 is current as of this post)
I would like to learn what it takes to improve my setup to get tonyd's timings -- simply V6 or new hardware or ? --
just made a similar query to the MM newsgroup.

Edited: Mon Aug 27, 07 at 12:44 AM by Alan
 
Reply
   
Quote
   
Top
   
Bottom
     



AVt
Senior Member

Posts: 788
Joined: Dec 2001

Mon Aug 27, 07 09:08 PM
User is offline View users profile

My timing was for concurrent Maple 11 on Win XP using an Athlon 2.2 GHz & 1 GB memory (so 64 Bit is not supported).

So in MMA does not give the time for symbolics outside the kernel - same as Maple. But it should be small, it is almost
pure floating point computation.

Almost: looking into the help and the code there should be some symbolics involved, it uses a general MatrixFunction(A, F)
where F is analytic (so works for F=sin as well as for exp).

Quote


The MatrixFunction(A) command returns the Matrix obtained by interpolating [lambda, F( lambda )] for each of the
eigenvalues lambda of A, including multiplicities.

Here the Matrix polynomial is r(lambda) = F(lambda) - p(lambda)*q(lambda) where p(x) is the characteristic polynomial,
q(lambda) is the quotient, and r(lambda) is the remainder.


The latter only makes sense for me by switching to rationals for the characteristic polynomial.

BTW: the determinant of such a beast is quite large and like 10^146, I have doubts in the reliability of the result,
but forgot the command for numerical stability concerning matrices (i.e. I think there is some).

---

u:=RandomTools:-Generate(float(range=0.0 .. 1.0, digits=14, method=uniform), makeproc=true);
M:=evalf(RandomMatrix(d, generator=u));

st:=time():
MatrixInverse(M).(MatrixExponential(-t*M) - MatrixExponential(-T*M));
time()-st;

results in 2 seconds.

 
Reply
   
Quote
   
Top
   
Bottom
     



spacemonkey
Senior Member

Posts: 340
Joined: Aug 2002

Mon Sep 03, 07 10:52 PM
User is offline View users profile

Tried this on the free Matlab clone octave:-

octave:26> M = rand(300,300);
octave:27> t = 0.25; T = 2;
octave:28> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc
ans = 3.2403 (seconds)

Not bad when you consider my computer - 1.7Ghz P4, 256Mb.

I also tried Maxima, but I couldn't get it to calculate the answer at all. Maxima has a lot of potential, but it seems pretty difficult to use. Still it beats the hell out of Mathematica on price.
 
Reply
   
Quote
   
Top
   
Bottom
     



blondie
Member

Posts: 63
Joined: Jun 2007

Thu Sep 06, 07 10:43 AM
User is offline

Quote

Originally posted by: Alan
Can anyone match or beat either of these running times?
If so what's your setup? (Matlab/Mathematica Version #, CPU, Brand, Model, Op. Sys., Memory)


Matlab
---------------------------
M = rand(300,300);
t=0.25; T=2;
tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;
Elapsed time is 0.288171 seconds


Mathematica
---------------------------
M = Table[Random[], {i, 1, 300}, {j, 1, 300}];
t = 0.25; T= 2;
Timing[Inverse[M].(MatrixExp[-M t] - MatrixExp[-M T]);]
{0.375 Second, Null}


Hi Alan,

My setup : Windows XP, AMD Opteron P250, 2.39GHz, 4Go RAM
Mathematica v5.0 -> {1.852 Second, Null}
Mathematica v6.0 -> {0.422 Second, Null}

When I ran the Mathematica benchmarks (Help -> About Mathematica -> System Information -> Kernel)
it 'rated me' 1.37, worse being 0.21 and best being 2.84.

My conclusion : simply v6 [ + intel oriented hardware better than AMD (for mathematica at least) ].

Personal comment : I also tried to do my own MatrixExp. I did compute the eigensystem and did
the exponentiation with exp(M) = P.exp(D).P^(-1). This should be less efficient than native MatrixExp
because there are faster algorithm to do matrix exponentiation, as quoted in their help.
Anyway, with v5.0, home made exponentiation is faster, which is NOT normal.
With v6.0, it's no longer the case.

I'll try to get a matlab licence.

-------------------------
"I've never seen so many men wasted so badly". Blondie - The Good, the Bad, the Ugly.
 
Reply
   
Quote
   
Top
   
Bottom
     



blondie
Member

Posts: 63
Joined: Jun 2007

Thu Sep 06, 07 04:29 PM
User is offline

Quote

Originally posted by: Alan
Can anyone match or beat either of these running times?
If so what's your setup? (Matlab/Mathematica Version #, CPU, Brand, Model, Op. Sys., Memory)


Matlab
---------------------------
M = rand(300,300);
t=0.25; T=2;
tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;
Elapsed time is 0.288171 seconds


Mathematica
---------------------------
M = Table[Random[], {i, 1, 300}, {j, 1, 300}];
t = 0.25; T= 2;
Timing[Inverse[M].(MatrixExp[-M t] - MatrixExp[-M T]);]
{0.375 Second, Null}


And interestingly,

>> M = rand(300,300);
>> t=0.25; T=2.;
>> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;
Elapsed time is 0.698117 seconds.

which means that with my setup, on this problem,
Matlab Version 7.2.0.232 is slower than Mathematica v6.0.

-------------------------
"I've never seen so many men wasted so badly". Blondie - The Good, the Bad, the Ugly.
 
Reply
   
Quote
   
Top
   
Bottom
     



Alan
Senior Member

Posts: 3628
Joined: Dec 2001

Thu Sep 06, 07 04:51 PM
User is offline View users profile

Thanks, blondie -- exactly what I was looking for.
 
Reply
   
Quote
   
Top
   
Bottom
     



slops
Junior Member

Posts: 12
Joined: Oct 2007

Sat Oct 13, 07 10:32 AM
User is offline

Nice!

Maxima is also free and pretty nice to work with.

Otherwise I would vote for Maple (because I know it fairly well).
However, I have noted bugs, regarding Legendre functions of the 1st and 2nd kind, both in Mathematica and Maple
 
Reply
   
Quote
   
Top
   
Bottom
     



Ken4
Junior Member

Posts: 2
Joined: Sep 2007

Thu Nov 15, 07 11:02 AM
User is offline

Hi
Sometimes you may cut Elapsed time from 100% to 10% with Real-Time Workshop, Real-Time Workshop Embedded Coder, 'Embedded MATLAB'
 
Reply
   
Quote
   
Top
   
Bottom
     



exneratunrisk
Senior Member

Posts: 1375
Joined: Apr 2004

Fri Nov 16, 07 09:29 AM
User is offline View users profile

People argue that Mathematica is "esoteric", because it forces you to "structure" (nested functional configurations).
(or you can exploit its full power, only when you structure..)
If you think of multi core high performance computing, this "weakness" becomes an unprecedented "advantage"?
Mathematica's "Parallel Computing Toolkit" provides symbolic parallelisation techniques.

We have applied this. In a few lines we support the dsitribution of single valuations to cores.
With close to linear speed up (instead of sequential evaluations of "tables of functions" on one core they are evaluated in parallel on the cores available).

The analytics of portfolios in scenarios is of good nature for such coarse grain parallelism.

It works in simple Microsoft based compute cluster set ups (a mix of PCs with different nr of cores in a LAN).

In a few years we will get hundreds of cores in a "cube of 1 m^3"?
And SW?




-------------------------
Our news and views: UnRisk Insight
 
Reply
   
Quote
   
Top
   
Bottom
     

Pages: [ << 1 2 3 >> Previous Next ]
View thread in raw text format
FORUMS > The Quantitative Finance FAQs Project < refresh >

Forum Navigation:

© All material, including contents and design, copyright Wilmott Electronic Media Limited - FuseTalk 4.01 © 1999-2010 FuseTalk Inc.