Serving the Quantitative Finance Community

 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

matlab interface

October 20th, 2011, 6:49 pm

QuoteOriginally posted by: outrunHee Polter, do you have idea for a struct of constants in Matlab, like the C++ enum below, but then in Matlab? The user would have to load that one time to make the constants available.I need this to collapse all the functions into a smaller set.Any ideas?MATLAB EnumerationsMATLAB StructuresSome more suggestions (including, for instance, Java enum classes):http://stackoverflow.com/questions/1389 ... -in-matlab
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

matlab interface

October 20th, 2011, 8:51 pm

I'd go for the most elegant solution, unless it's (too much?) in terms of performance costs. Do you feel like trying them all out and comparing?Not sure if we should be worried a lot about the old MATLAB versions... on the other hand, supporting things, like, say, Octave (open-source MATLAB clone) could be nice (but then again, how popular is it among people who do NOT use R, which we also plan to support)?Huh... have you seen this -- http://www.swig.org/Doc1.3/Octave.html#Octave_nn11 -- ? Perhaps SWIG/MATLAB port should be as close as possible to already existing SWIG/Octave support to maintain compatibility, etc.? BTW, have you tried files generated by SWIG/Octave in MATLAB?
Last edited by Polter on October 19th, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

matlab interface

October 21st, 2011, 9:23 pm

I see your point, yes, it shouldn't be over-complicated.BTW, for something completely different (but perhaps simpler for the users & more MATLAB-idiomatic): what do you think about context-dependent named arguments: http://www.mathworks.se/help/techdoc/re ... arser.html ?Perhaps something like bgm_barrier_option(S0, yield, vol, Barrier, Strike, T, 'option_type', 'down-and-in-call', 'function', 'price') ?// BTW' -- I'm inclined against using abbreviations or acronyms, unless they're extremely very well-known, like LMM for Libor Market Model. In the short-term it makes it convenient for us, but in the long-term it might be less convenient for the users; I also thing it might break discoverability, http://accu.org/index.php/journals/1572If we can keep parse it in a context-dependent way, the user wouldn't have to repeat himself -- so, if the parser "knows" that the argument passed to bgm_barrier_option function next to the 'option_type' to is going to be something that maps to qfcl.barrier_option.option_types, then there shouldn't be a need for the user to repeat himself and say that twice (and since bgm_barrier_option is already a part of the QFCL package, thus no need to repeat it either)?No idea on the simplicity/efficiency tradeoff characteristics of that (parsing is probably not costless), but perhaps that shouldn't be our focus in MATLAB environment...
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

matlab interface

October 21st, 2011, 10:04 pm

To be fair, one downside is that the Tab-key autocompletion doesn't seem to work with strings in MATLAB. :-(E.g., when you want to type something like:>> plot(x,y,'LineWidth',2,...typing>> plot(x,y,'Land pressing the Tab key yields "No Completions Found." message.On the other hand, with a structure:>> whatever.abc=1; whatever.def=2;>> whateverwhatever = abc: 1 def: 2typing>> whatever.aand pressing the Tab key correctly yields>> whatever.abcSo there's that. Any ideas on how to have a cake and eat it too here?Got enough MATLAB users around to try hallway testing and compare the reactions?
Last edited by Polter on October 21st, 2011, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

matlab interface

October 21st, 2011, 10:22 pm