C#平台学习

Discussion in 'General Topics on Software and Data' started by windspeedo, Oct 31, 2008.

  1. 根据这段时间的学习,一点不成熟的体会:
    1、顶尖的对冲基金更多用C++自己写策略/分析平台;
    2、一般的对冲基金用别人定制的平台,例如QuantDeveloper之类,可能也会结合自己C++编写一些;
    当然,大家还会用各种统计分析软件。

    对于普通的程序交易爱好者,在统计软件之外,也有一些选择:
    1、C++自己编写分析、策略、验证;
    2、整合了C#的商业软件;
    3、整合了VB的商业软件;
    4、含有公式编辑、策略回顾功能的商业软件。

    最近学习C#,感觉整合了C#的平台,威力强大,可以很大程度上自由地实现自己的想法。
    主要的不足是:
    1、对电脑硬件要求比较高;一旦开始复杂一点的运算,我的手提电脑就呜呜作响;:cool:
    2、我所接触到的Wealth Lab 和RightEdge,基本专注于策略的编写和测试,对市场数据的分析、挖掘方面,不太重视。其实,对市场的深入分析、多角度分析、展示,不但可以加深对市场的理解,而且还是新的策略形成的重要来源。

    也许,这正是那些对冲基金自己编写平台的重要原因。:cool:
     
  2. 个人觉得还是别搞c#,c++速度快,执行效率高,c#比较慢,所以你的机器会费力。
     
  3. 难怪高手都喜欢C++。
    对我来说,用C++可能学习曲线比较困难一点。C#上手容易。而且,正好,RE之类的内建了C#支持。
     
  4. 多谢指点。
    再请教一下,S-Plus/R与MatLab之间是什么关系?是不是用了MatLab就不用了S-Plus/R了。我原来以为需要统计软件,就学习了S-Plus。
    对于我们投资来说,如果学习了MATLAB,是不是就不需要其它统计软件了?
     
  5. matlab只不过是因为盗版容易获得,而且有些现成的组件和代码,所以才会比较流行。
    至于代码执行速度,实际上远不如吹嘘的好。
    matlab跟SAS比较的话,大量数据的处理和建模还是SAS快些,但是matlab对有计算机编程经验的来说上手比较舒服。

    如果是学习了splus,可以再搞R,R免费、扩展性好,很多功能和新算法及模型是matlab难以企及的。

    至于建模方面,有不少人用matlab仿着公式套了个模型,就叫建模了,可笑得不得了,可是这是现在金融业尤其国内的普遍现象。
     
  6. R有没有神经网络、遗传算法之类的非线性和计算智能的工具箱?
     
  7. 很多的最新算法都有包,而且不少经济学家、金融学家、数学家的个人主页也有他们自己模型的模型包。开源的最大好处就是可扩展性强。而且有些操作代码还简单。

    SAS方面现在那个proc fcmp自定函数实在是好得不得了,所有模型直接就可以存起来,想用的时候直接用,不用再一个一个宏去帖了。估计以后会有人专门卖SAS函数包的。
     
  8. zwz

    zwz

  9. zwz

    zwz

    sas 9.2 中文版什么时候出来啊?
     
  10. 大概今年5月下旬的时候

    在那之前内部好像提前一年多就开始用了
     
  11. 5555555555555,老大们我下的sas怎么不是不能用就是有时间限制啊,救命啊~~~~~~~~~~~
     
  12. 精辟。

    我最大的问题其实是不熟悉统计。所以很多威力强大的统计模型根本无从下手。
    学S-Plus而不是R,主要当初认为商业软件,帮助、文档是不是好一些。入门容易一些。R的强处,我这种统计门外汉,是不是用不起来?

    MatLab在绘制三维图形方面是不是比S/R强?
    我挺希望能够方便地三维展示数据分析的中间结果。
    再加上色彩,就是四维。:cool:
     
  13. 简单研究了一下MATLAB。原来五六年前也研究过,后来觉得SAS更实用。就学了一段时间SAS.
    胡乱理解:
    R/S-Plus属于统计软件,各种统计方法信手拈来,很方便。
    MATLAB属于Matrix计算软件,工程计算领域比较强,它做出来的多维数据图比较靓。
    SAS就不用说了。当仁不让的巨无霸。:)

    我目前设想的对我来说可能学习曲线最好的途径是:
    1、S-Plus进行统计分析;
    2、MATLAB进行多维展示;
    3、RightEdge进行策略验证;
    对于起步来说,平台建设可能就全了。
     
  14. 2003年的时候,Dr. Wim Kimmerer比较了S-Plus与MATLAB。他收集了周围很多使用过这两种软件的人的意见。代表性的意见如下:
    1、They do different things and good advice to students would be to learn both for their appropriate uses: Splus for data analysis, Matlab for numerical simulation. You can do some simulation in Splus (less flexible than Matlab and it's so slow I wouldn't recommend it for routine numerical work) and you can do some data analysis in Matlab (but its way less comprehensive, sophisticated or convenient, for the most part). In summary, Splus for statistical modeling, Matlab for numerical modeling.
    2、For anything statistical, splus is clearly the right choice. For linear algebra, they are more or less equal. For graphics, matlab is generally better, especially for colorfill contouring with curvilinear coordinates, but I wouldn't want to do without splus's trellis graphics. And splus automatically labels graphs, which matlab can't do.
    3、S-plus is weak at working with differential equations models and PDE support is nil. S-plus handles statistical models much much better. For example, implementing blue book models in MATLAB is a hore, whereas, it is essentially built-in S-plus. Graphics are great in both programs but a bit easier to do in MATLAB.

    当然,他们谈论的都是2003年的MATLAB和S-Plus.
     
  15. 关于MATLAB与S-Plus。又找到Wilmott上2005年的一个帖子:“S-Plus or MATLAB”。依稀记得当时主要就是依据这个帖子开始学S-Plus。

    下面简单摘要一些观点。感兴趣的朋友值得全文浏览那个帖子。里面很多人都是hedge fund的从业者。

    1、We use splus, matlab, eviews, stata, and sas if that is any indication. Or to narrow it down more precisely, equity guys use eviews, fi guys use stata, quant guys use splus, and everyone uses matlab from time to time. Only one group uses sas which is inside the fi. Not sure about other places.
    2、I think Matlab is more widely uised then s-plus. It should be noted that I use it primarily as an explorative tool to understand the problem at hand and qickly generate some numbers to get a feel for what I should be expecting. However production quality analytics C++ is the primary tool of implementation (Java and C# statign to be used a bit more for analytics now a days but C++ still ahead due to performance advantages)
    3、S-Plus: good to treat huge amounts of data in a simple fashion (simple functions or library). If u start coding complicated stuff the environment is pretty awful. But it can handle big chunks of data better than Matlab. S-Plus is a kind of giant excel for me capble of handling 10^6 lines
    Matlab: better for writing clean code than can be used in sth put into production - there are also more libraries available on the net than for Splus - and the coding environment/debugging is far easier. but the interfaces between matlab and data editors is rather crappy (import/export) and the optimization functions did not work for me (after 10 days of pain, my manager told me than fmincon never works)
    my advice would be to have both or to choose one of them according to ur specific needs if u need to pick only one. But they are not equivalent

    我自己用S-Plus的体会,确实如其中一位老兄所言,处理巨大的数据序列非常方便。进行统计分析就是小菜一碟。如果你懂统计的话。
     
  16. 关于SAS的王者地位,正好看到这样一个帖子。
    2002年,一个小伙子咨询学什么工具可以更好找工作。一个自称超级资产管理机构定量部门老大的人如是说:

    I am head of quant research at one of the very biggest investment managers. I know the dominant software used at at the biggest quant firms/quant departments: Barclays Global Investors, SSGA, Deutsche Asset Management, First Quadrant, GMO, Panagora, Numeric, MSAM, GSAM, etc. I am expert in all 3 languages you mention. Learn SAS before S-Plus. It will make you more marketable, period. Re. SAS vs. Matlab, Matlab is a little more intuitive and is superior at matrix manipulation. It is fine for smaller problems, such as asset allocation decisions where you might be dealing with fewer than 100 securities. But SAS is far superior at handling large datasets (Matlab is limited in its ability to handle character types), has a seamless SQL interface, and far greater built-in statistical and econometric capability. Quant investment management is often more about handling vast quantities of data than anything else. P.S. The is the first time I've ever visited this site, and while it's interesting to browse the boards, 75% of the info posted here is flat out wrong. Good luck.

    六年过去了,不知道SAS是不是还这么高高在上。
     
  17. 可能有人会问,这与C#有什么关系?
    C#可以直接调用MATLAB的程序/结果。
    最终,C#应该成为个人定量投资体系的中心环节。因为它高度可定制。充分调用专业资源、提高效率,实现自己的任何设想。当然,对于高手来说,这个环节就是C++。运行效率可以更高。


    C#调用MATLAB的具体步骤如下:
    1. 在matlab中用matlab builder把.m文件编译为.net assembly
    2. 在vs中添加路径,使得mathworks这个namespace可以被reference到,以便使用matlab中的数组类
    3. 在工程中添加到mathworks和第1步生成的assembly的reference
    然后就可以用了


    这是一个C#调用较早版本MATLAB程序的例子

    这里有一个C#调用相对较新版本MATLAB程序的例子

    总体上讲,中文的例子不多。

    英文的讲解C#与MATLAB联结的文章可就专业了。

    Integrating MATLAB with C#。列举了三种联结方法。还提供了相关代码下载。

    Emanuele Ruffaldi的1..2..3 ways of integrating MATLAB with the .NET深入浅出。我这个不懂编程的人都似乎看懂了。:) 否则,下面一段文字绝对让我晕。

    if by calling Matlab in C# you mean using some functions or .m files in C#, you can do it in Matlab 7.2 version only. It has a toolbox called "Matlab Builder for .NET" which you can build some library, or COM objects which are implementable in your C# application. you can
    find the documents on online matlab help.
    and if by calling you mean run matlab engine or part of program from a running C# application and pass some variables to it, you can do it in different ways. one of the ways is using Dynamic Data Exchange or COM objects. Also you can find how to make server and client examples in matlab help. search for C# COM client in matlab help and you'll find a good example for it.