Quantitative finance/mathematical library for Java [closed] - java

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am currenlty working on a project which relies on a couple of mathematical/statistical/financial tools which I would ideally like to include in one (perhaps several) libraries. What I would like to have is:
Statistical measures - modes, variance etc.
probability distributions + sampling from them available
financial models for e.g. option pricing
Does anyone have an idea which libraries might be useful?

I do quite a bit of numerical work in Java and Clojure so hopefully my perspective can be useful.
For 1. and 2. here are some options to explore:
Parallel Colt - very comprehensive, high-performance mathematical library. Good for lots of vector processing which you get in finance apps.
Incanter - R-like statistical library for Clojure (very easy to embed in a Java app). Has pretty much all the statistical tools you could desire, plus is very easy to extend if you want to create your own DSLs
EJML - probably the fastest matrix library available in Java
Apache Commons Math - handy collection of maths and statistical tools
For 3. (financial models) these tend to be pretty bespoke to the problem you are trying to solve. I doubt you would want to use an off-the-shelf solution even if it existed. I'd suggest developing yourself using the toolkits mentioned above.

QuantLib apparently has Java bindings via SWIG.

IdylFin might be just what you are looking for -- inspired by quantmod, it contains some blazing fast, numerically stable statistical methods, an API to Yahoo Finance, as well as some portfolio optimization methods and it's being extended actively.
Disclaimer: I am the author of the library, and it would knock my socks off if you used it ;).

Strata from OpenGamma contains those items. It is a professional quantitative finance library written in Java and open source.
The quantitative finance part contains interest rate, forex and equity models. It is developed by industry quants for bank and hedge funds. I don't which type of financial models you want to use; there is a large panel of models and asset classes and you should be able to find off-the-self a professional type implementation.

Related

Java or Python for Natural Language Processing [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I would like to know which programming language is better for natural language processing. Java or Python? I have found lots of questions and answers regarding about it. But I am still lost in choosing which one to use.
And I want to know which NLP library to use for Java since there are lots of libraries (LingPipe, GATE, OpenNLP, StandfordNLP). For Python, most programmers recommend NLTK.
But if I am to do some text processing or information extraction from unstructured data (just free formed plain English text) to get some useful information, what is the best option? Java or Python? Suitable library?
Updated
What I want to do is to extract useful product information from unstructured data (E.g. users make different forms of advertisement about mobiles or laptops with not very standard English language)
Java vs Python for NLP is very much a preference or necessity. Depending on the company/projects you'll need to use one or the other and often there isn't much of a choice unless you're heading a project.
Other than NLTK (www.nltk.org), there are actually other libraries for text processing in python:
TextBlob: http://textblob.readthedocs.org/en/dev/
Gensim: http://radimrehurek.com/gensim/
Pattern: http://www.clips.ua.ac.be/pattern
Spacy:: http://spacy.io
Orange: http://orange.biolab.si/features/
Pineapple: https://github.com/proycon/pynlpl
(for more, see https://pypi.python.org/pypi?%3Aaction=search&term=natural+language+processing&submit=search)
For Java, there're tonnes of others but here's another list:
Freeling: http://nlp.lsi.upc.edu/freeling/
OpenNLP: http://opennlp.apache.org/
LingPipe: http://alias-i.com/lingpipe/
Stanford CoreNLP: http://stanfordnlp.github.io/CoreNLP/ (comes with wrappers for other languages, python included)
CogComp NLP: https://github.com/CogComp/cogcomp-nlp
This is a nice comparison for basic string processing, see http://nltk.googlecode.com/svn/trunk/doc/howto/nlp-python.html
A useful comparison of GATE vs UIMA vs OpenNLP, see https://www.assembla.com/spaces/extraction-of-cost-data/wiki/Gate-vs-UIMA-vs-OpenNLP?version=4
If you're uncertain, which is the language to go for NLP, personally i say, "any language that will give you the desired analysis/output", see Which language or tools to learn for natural language processing?
Here's a pretty recent (2017) of NLP tools: https://github.com/alvations/awesome-community-curated-nlp
An older list of NLP tools (2013): http://web.archive.org/web/20130703190201/http://yauhenklimovich.wordpress.com/2013/05/20/tools-nlp
Other than language processing tools, you would very much need machine learning tools to incorporate into NLP pipelines.
There's a whole range in Python and Java, and once again it's up to preference and whether the libraries are user-friendly enough:
Machine Learning libraries in python:
Sklearn (Scikit-learn): http://scikit-learn.org/stable/
Milk: http://luispedro.org/software/milk
Scipy: http://www.scipy.org/
Theano: http://deeplearning.net/software/theano/
PyML: http://pyml.sourceforge.net/
pyBrain: http://pybrain.org/
Graphlab Create (Commerical tool but free academic license for 1 year): https://dato.com/products/create/
(for more, see https://pypi.python.org/pypi?%3Aaction=search&term=machine+learning&submit=search)
Weka: http://www.cs.waikato.ac.nz/ml/weka/index.html
Mallet: http://mallet.cs.umass.edu/
Mahout: https://mahout.apache.org/
With the recent (2015) deep learning tsunami in NLP, possibly you could consider: https://en.wikipedia.org/wiki/Comparison_of_deep_learning_software
I'll avoid listing deep learning tools out of non-favoritism / neutrality.
Other Stackoverflow questions that also asked for NLP/ML tools:
Machine Learning and Natural Language Processing
What are good starting points for someone interested in natural language processing?
Natural language processing
Natural Language Processing in Java (NLP)
Is there a good natural language processing library
Simple Natural Language Processing Startup for Java
What libraries offer basic or advanced NLP methods?
Latest good languages and books for Natural Language Processing, the basics
(For NER) Entity Extraction/Recognition with free tools while feeding Lucene Index
(With PHP) NLP programming tools using PHP?
(With Ruby) https://stackoverflow.com/questions/3776361/ruby-nlp-libraries
The question is very open ended. That said, rather than choose one, below is a comparison depending on the language that you would like to use (since there are good libraries available in both languages).
Python
In terms of Python, the first place you should look at is the Python Natural Language Toolkit. As they note in their description, NLTK is a leading platform for building Python programs to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning.
There is also some excellent code that you can look up that originated out of Google's Natural Language Toolkit project that is Python based. You can find a link to that code here on GitHub.
Java
The first place to look would be Stanford's Natural Language Processing Group. All of software that is distributed there is written in Java. All recent distributions require Oracle Java 6+ or OpenJDK 7+. Distribution packages include components for command-line invocation, jar files, a Java API, and source code.
Another great option that you see in a lot of machine learning environments here (general option), is Weka. Weka is a collection of machine learning algorithms for data mining tasks. The algorithms can either be applied directly to a dataset or called from your own Java code. Weka contains tools for data pre-processing, classification, regression, clustering, association rules, and visualization. It is also well-suited for developing new machine learning schemes.

What is the purpose of google guava libraries? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
They seem identical to java.util counterparts.
In a project I have to review these apis are used and an external jar is present for that.
But...in what they are different from java.util ones?
The Guava libraries, much like the Apache Commons libraries, are intended to complement the core java libraries, as outlined in the Philosophy Explained document:
Guava is a productivity multiplier for Java projects across the board: we aim to make
working in the Java language more pleasant and more productive. The JDK utilities, e.g.
the Collections API, have been widely adopted and have significantly simplified virtually
all Java code. We hope to continue in that tradition.
That article goes on to explain how they realise that you could implement the procedures they provide to fill the gaps in the core API yourself, but believe there are a number of advantages to using their code:
Guava has been battle-tested in production at Google.
Guava has staggering numbers of unit tests: as of July 2012, the guava-tests package
includes over 286,000 individual test cases. Most of these are automatically generated,
not written by hand, but Guava's test coverage is extremely thorough, especially for
com.google.common.collect.
Guava is under active development and has a strong, vocal, and involved user base.
The best libraries seem obvious in retrospect, but achieving this state is notoriously
challenging.

Are Custom Libraries Unprofessional? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm still in university at the moment, and I'll likely either try to get security or programming job. My first programming course used a custom library that came with the book. It replaced and added many of the basics of Java like Arrays, completely custom math functions, input (scanner), Hashmaps, Queues and Stacks.
If I did land a programming gig, is it considered unprofessional to use a given custom library such as the one above? Either way, I've pretty much weaned myself off of 75% of the custom classes in favor of standard Java classes/objects, but I wanted to know if slipping in a premade class from a textbook is frowned upon. Thanks guys.
"Custom library" is too broad a category to be useful. Libraries that reimplement functionality that's standard in the JRE, such as the Collections API, are almost certainly useless, and probably did more harm than help in an educational setting. However, there are a large number of tools, particularly Google Guava (enhanced collections like multisets and bimaps), the Apache Commons tools (including string parsing, hashCode building, and the like), slf4j/log4j for logging, and runtime environments such as Spring that are basically standard in the industry.
The general principle is "don't reinvent the wheel". If you have an example class out of a textbook that gets a basic job done that isn't in the standard API or one of the de facto standard third-party libraries, by all means use it, but don't prefer some professor's half-baked and untested implementation to ones that have been in use by thousands of developers for years.
Good programmers write good code, excellent programmers find excellent code.
If your library is any good I suspect it's more a case of everyone grabbing a copy.

C++ library with a Java-like API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Hoping that anybody here knows about a good one: I'm looking for a (free to use) C++ library with a class hierarchy and methods resembling the Java API, with at least the I/O & networking part if it, specifically HTTP handling.
I work mainly with C & Java, but for this particular project C++ is recommended, so I thought of adopting a good set of C++ libraries without facing a steep learning curve.
Thanks in advance for any recommendation.
Qt is IMHO very java like. I.e. they prefer Java-Style Iterators over the STL ones. Qt includes networking (examples) and much other stuff (like scripting via javascript)
Have you looked at the Boost libraries?
Boost.IOStreams provides a framework for defining streams, stream buffers and i/o filters.
Asio - Portable networking, including sockets, timers, hostname resolution and socket iostreams.
Many others....
The Boost libraries provide similar capabilities as compared to the Java API, but they very much 'look and feel' - appropriately - like a C++ library.
There is also the option of using something like POCO, which is slightly simpler than using something like Boost, while still being cross platform.
While the only time I used HTTP in Java was a long time ago, the interface for the POCO library looks fairly simple to use. It gives a example of basic FTP usage a something like this:
Poco::Net::FTPStreamFactory::registerFactory();
std::ofstream localFile(inputFile, std::ios_base::out | std::ios_base::binary);
Poco::URI uri(inputURL);
std::auto_ptr<std::istream> ptrFtpStream(Poco::Net::URIStreamOpener::defaultOpener().open(uri));
Poco::StreamCopier::copyStream(*ptrFtpStream.get(), localFile);
A C++ library that looked like a Java one would be a bad library, IMHO. The two languages are so very different that what is good design for one will almost inevitably be bad design for the other.
You can take a look at Mindroid, which is primarily oriented to embeddded programming:
Mindroid is an application framework (with focus on messaging and concurrency) that lets you create applications using a set of reusable components - just like Android. The name Mindroid has two different meanings. On one hand Mindroid is a minimal set of core Android classes and on the other hand these classes also form Android's mind (at least in my opinion).

What are the best practices for the Middleware API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products.
What I would like to know is this: Are there standard "Best Practices" for the development of these types of API?
I am thinking in terms of usability, readability, efficiency etc.
My two favourite resources on the subject: http://mollyrocket.com/873 and http://video.google.com/videoplay?docid=-3733345136856180693
From using third party libraries on Windows I've learned the following two things:
Try to distribute your library as a DLL rather than a static library. This gives way better compatibility between different c compilers and linkers. Another problem with static libraries in visual c++ is that the choice of runtime library can make libraries incompatible with code using a different runtime library and you may end up needing to distribute one version of the library for each runtime library.
Avoid c++ if possible. The c++ name mangling differs alot between different compilers and it's unlikely that a library built for visual c++ will be possible to link from another build environment in windows. When it comes to C, things are much better, in particular if you use dll's.
If you really want to get the good parts of c++ (such as resource management through constructors and destructors), build a convenience layer in c++ that you distribute as source code that hides away your c functions. Since the user has the source and compiles it locally, it won't have any name mangiling or abi issues with the local environment.
Without knowing too much about calling c/c++ code from Java, I expect it to be way easier to work with c code than c++ code because of the name mangling issues.
The book "Imperfect C++" has some discussion on library compatibility that I found very helpful.
The video from Josh Bloch mentioned by yrp is a classic - I second that recommendation.
Some general guidelines:
DO define your API primarily in terms of interfaces, factories, and builders.
DO clearly specify exactly which packages and classes are part of the API.
DO provide a jar specifically used for compiling against the API.
DO NOT rely heavily on inheritance or the template method pattern - over time this becomes fragile and broken.
DO NOT use the singleton pattern or at least use it with extreme caution.
DO create package and class level javadoc explaining usage and concepts.
Take a look at Framework Design Guidelines. I know it is .NET specific, but you can probably learn a lot of general information from it too.
There are lots of ways to design apis, depending on what you are solving. I think a full answer to this question would be worthy off a whole book, such as the gang of four patterns book. For Java specifically, and also just OO programming in general, I would recommend Effective Java 2nd Edition. The first is general and a lot of popular programming patterns, when they apply and their benefits. Effective Java is Java centered, but parts of it is general enough to apply to any programming language.

Categories

Resources