icamodel

 

ToolEvaluation

Page history last edited by Richard Percy 2 yrs ago

Tool Evaluation

 


 

Desiderata

 

  • Be able to deliver a model that is easy to install and run: eg as a .exe on windows.
  • Easy for users to make changes
    • Ie, easy to build from source
  • Doesn't rely on expensive proprietary software

 

Current thought is to use one language for the framework, calling out to another (or others) for heavy duty stats or maths.

 

It's likely that we'll want to specify the parameters in XML, so will want an XML parser to be available in the language that we use for the framework.

 

Some issues

 

Runtime environments

Pretty much all the languages under consideration have a runtime environment of one form or another. This may allow interpreted code to run (ie, you just type the code into the environment) or may just allow compiled code to run.

 

Some languages support compilation to byte code that will then use the runtime environment. This means that you have to have the runtime environment installed in order to run the program. The byte code can be compiled on any platform (windows, linux, mac) and will run on all supported platforms.

 

Other languages support compilation to native object code. The native object code can be run only on the platform for which it was compiled. No extra software is required to make it run.

 

Typically, native code runs faster than byte code. However, some runtimes (such as the JVM, see below) include JIT (just in time) compilers that provide significant speed ups.

 

Design-time environment and distributed development

Irrespective of the languages chosen, an integrated development environment is useful to keep control of the various modules and their relationships with one another. Object-oriented development typically generates a large number of separate source files, all with different versions and being developed by different people. In this case we will have people working at different locations as well.

 

Statistics and financial modelling

There are clearly two main types of functionality that the model will have to have.

 

  1. We'll want to be able to do some reasonably sophisticated statistical things: generating random numbers from a wide range of distributions, with complex correlations, analysing the results of the (large number of) simulations to come up with capital requirements, and so on.
  2. We want a reasonably flexible modelling framework to allow us to model different types of insurance operations. By far the easiest way to do this is using an object oriented language.

 

The question is, can (or should) these be separated? Could we have a multi-phase tool: 1. inspect the model structure (parameter file) to see what random numbers are required; 2. generate the random numbers and write to a file; 3. run the model using the random numbers, write the results to a file; 4. Analyse the results.

 

Advantages of separation

  • Wouldn't have to find a language that was good for both the stats side and the model side
  • Modularity is enforced
  • ...

 

Disadvantages of separation

  • More clunky for the users
  • Might require 2 separate runtime environments to be installed
  • ...

 

Some ideas

 

Spreadsheet

Excel is the most familiar tool to our potential users, although we could use an open source spreadsheet such as Gnumeric or Open Office.

Spreadsheets are more suitable for one-off prototypes than for flexible modelling tools.

Using Excel would exclude some users.

 

R

R is an open source statistical programming language. Contains many libraries for excellent statistical and graphical capabilities. Good random number generator. Can integrate with Excel via the RCOM package and databases via the RODBC package. A "niche" programming language within the IT world (but then most things will be niche within the actuarial one).

Ideal for statistical/graphical functionality. Memory constraints could be a problem, but possibly alleviated by integrating with a database. Speed for certain calculations could be a problem, but can always call out to a C++ function instead.

Not suitable for overall framework, as the object-oriented functionality is extremely limited.

It can be called from other languages (eg C, C++). Does doing so require the runtime environment to be installed?

Runtime provides an interpreter.

 

Octave

Octave is an open source version of Matlab, a high-level language primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments.

May be suitable for some of the statistical functionality, along the same lines as R (see above).

 

VB.NET

VB.NET is a fully object oriented programming language somewhat similar to Visual Basic and VBA. Elements of it will be familiar to many actuaries. A possibility for the overall framework.

Requires a runtime environment. .NET is the commercial version available from Microsoft, which is available only on windows. However, it is now (usually) installed as a matter of course along with the operating system (check up on this).

There is a free runtime, Mono: "Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix." However, it doesn't currently include a compiler for VB.NET, so the commercial framework would be required for development.

No interpreter.

 

C#

C# (pronounced C-sharp) is a fully object oriented programming language similar to Java, but with some additions. Fairly fast.

It provides a simple way of controlling Excel.

A Microsoft product, with many of the same disadvantages as VB.NET. however, the Mono framework does include a compiler for C#, so developers don't need .NET.

The most recent version of Java has caught up with C# in many ways.

 

C++ and C

 

C++ and C are the grand-daddies of them all. No runtime, compile to object code only.

Open source compilers are available, e.g. DevC++. Computationally very efficient. C++ is object oriented. Lots of libraries are available for these languages.

May be useful for calculation intensive modules.

Don't rely on any commercial software. Possible to build an easily installable executable. Requires much more skill to develop and build (especially as there is no automatic memory management). Development time would likely be a lot longer than for Java, C#, or even Ocaml.

Syntax for arithmetic operations is reasonably straightforward for non specialists to understand and use.

 

OCaml

 

OCaml is a high performance object oriented programming language. It can be compiled to object code or byte code, and includes an interpreter. This means that it would be very easy for people to add bits of code without having to rebuild the whole application.

It's possible to call out to C or C++ libraries, and there are bindings that provide an interfaces to the Gnu scientific library and the GNU libplot library.

Syntax is less straightforward for non specialists to understand and use.

Provides strong typing, which has both advantages and disadvantages: it's easier to put type constraints in that make it harder to produce a program that runs but produces nonsense (in some sense) results, but it's harder to construct the model on the fly from the parameter file because of the lack of reflection.

 

Java

 

Java is a free object oriented language, which has recently gone open source.

Requires a runtime environment (the JVM, Jave Virtual Machine), but this may be installed on many machines anyway (find out).

Advantage is that one of the primary developers is familiar with it. The latest version has much of the functionality that was previously only in C#.

There have been concerns about the poor performance of Java in the past, but the latest runtime environment (which includes a JIT) has gone a fair way to putting these concerns to rest. It's widely used in the financial community (just look at the job ads for java developers in banks).

I haven't been able to find many widely available and free libraries for statistical functionality.

Syntax is reasonably straightforward for non specialists to understand and use.

 

PRNG

 

PRNG is a portable, high-performance ANSI-C implementation of pseudorandom number generators.

 

GSL

 

The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.

The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite. For example, it contains functions to do Cholesky decomposition (useful for generating correlated random numbers).

There's an OCaml binding that provides an interface to the GSL.

Comments (0)

You don't have permission to comment on this page.