A new blog on various actuarial stuffs...

The aim of this blog is sharing information of interest in the actuarial world. We consider informative contents as well as implementation tools in financial, life and pension actuarial matters.

Tuesday 13 September 2011

New Release Pandas 0.4.0

See http://pandas.sourceforge.net/


pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. Additionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language. It is already well on its way toward this goal.
pandas is well suited for many different kinds of data:
  • Tabular data with heterogeneously-typed columns, as in an SQL table or Excel spreadsheet
  • Ordered and unordered (not necessarily fixed-frequency) time series data.
  • Arbitrary matrix data (homogeneously typed or heterogeneous) with row and column labels
  • Any other form of observational / statistical data sets. The data actually need not be labeled at all to be placed into a pandas data structure
Read more on http://pandas.sourceforge.net/

Monday 1 August 2011

New release iPython

Interesting review of the new version

Innovations in iPython

One of the highlights of SciPy 2011 was a demonstration of the upcoming release of iPython 0.11 (which is likely to become version 1.0, eventually). Fernando Perez calls iPython a "tool for manipulating namespaces", but this dry, technical definition belies the productivity-boosting power of this project. I have been using iPython for a few years as a replacement for the standard shell because it affords users easier access to debugging tools, command history and the underlying file system. Version 0.11 adds to this a variety of enhancements that further improve its utility and usability. A full account of it many features can be found in the iPython documentation, but I want to highlight a couple of the recent innovations that users might not be aware of. ...read More...

Wednesday 20 July 2011

Cloudnumbers: Your Python Application in the Cloud

cloudnumbers.com supports the interpreted, interactive, object-oriented and extensible programming language Python (http://www.python.org/). Python is a user-friendly open source programming language that is used in many areas. It has become really popular since many programmers consider it to be one of the easiest programming languages to study and work with.
cloudnumbers.com combines High-Performance Computing (HPC) and Python in order to provide a fully scalable platform for all your calculations. Combining Python´s ease-of-use with high performance computing means that ideas can more quickly become applications, increasing the productivity of developers, while overcoming any limitations.
HPC support for Python is provided with the following libraries:
  • mpi4py (http://mpi4py.scipy.org/): This module provides the binding of the Message Passing Interface (MPI) standard to the Python programming language. It allows any Python program to exploit multiple processors.
  • pp (http://www.parallelpython.com/): This module provides mechanism for parallel execution of Python code on multicore machines and on computer clusters.

Thursday 14 July 2011

Fractal (and Quantum) Finance back again: Try out Fraclab

Fraclab is a Matlab-based toolbox for image and signal processing mainly developed and maintained by people at INRIA. It seems to include powerfull fractal modules used in
Astrophysics, Biomedical, Chemical engineering, Fluid dynamics, Food engineering, Geophysics, Internet traffic, Mathematical analysis, Signal and image processing, Statistics and...Finance.
An interesting feature is also that you do not need to have Matlab installed to get it run since there is a standalone packaged version available (that, by the way, installs a run-time Matlab version on your system during the install process).

Fraclab is available for Windows, Mac OS X and Linux.

Wednesday 6 July 2011

Rattle: A Graphical User Interface for Data Mining using R

In addition to Rstudio the following tool looks promising: Rattle
Rattle (the R Analytical Tool To Learn Easily) presents statistical and visual summaries of data, transforms data into forms that can be readily modelled, builds both unsupervised and supervised models from the data, presents the performance of models graphically, and scores new datasets.

Sunday 3 July 2011

Numpy and Scipy Ports for IronPython (.NET)

Here is Codeplex wiki entry for the port of  Numpy and Scipy for IronPython 2.7. Please note that not all Scipy features have been ported yet but sounds like a good start.

Friday 1 July 2011

Amended IAS 19 released: Is the Glass half-full or half-empty?

The IAS Board has eventually released the long-awaited amended standard IAS 19 Employee Benefits (a 175+ pages document!).  The main changes consist of:
  • eliminating an option to defer the recognition of gains and losses, known as the ‘corridor method’, targeting improvement of comparability and faithfulness of presentation. 
  • suppression of the concept of expected return on assets  and explicit requirements to consider the tax on contribution effect on DBO.
  • streamlining the presentation of changes in assets and liabilities arising from defined benefit plans, including requiring remeasurements to be presented in other comprehensive income (OCI), thereby separating those changes from changes that many perceive to be the result of an entity’s day-to-day operations.
  • enhancing the disclosure requirements for defined benefit plans, providing better information about the characteristics of defined benefit plans and the risks that entities are exposed to through participation in those plans. 
  • amending the treatment of Termination Benefits by excluding stay-bonuses from this category and distinguishing termination as a result of employer's or the employee's decision. 
These changes - effective as from FY 2013 -  bring IAS 19 more in line with the IFRS framework. However, we can doubt they will effectively contribute to give a more reliable economic view on the financial position of the reporting entities (mthe obligation mresaurement remain highly volatile)  if as noted by many obsevers a second Phase does not complete the revision process. It is indeed not clear whether the IASB (currently in a transition phase: members have to be replaced) intends to take this on the agenda at short notice. In this case, entities would have to cope with a half-revised standard. So,...

More specifically, from a Belgian viewpoint
  • the accounting of DC plans would not be affected by the amendments because the IAS Board eventually decided to remove the modification of back-loaded plan rule that would have seriously affected them.
  • the tax impact on DBO may be significant.
  • we advise to pay special attention  to the treatment of Employee contribution and Termination Benefits as well as to the impact of the suppression of the expected return on assets.

A new R-gui: RStudio

Investigating using R under other platforms than Microsoft Windows, I have been looking for alternative tools to the well-known R-GUI Tinn-R. I have just discovered RStudio that seems to be a well-promising GUI tool. I have tested it under Mac OS X, Ubuntu 11.04... and Windows XP. Works fine (although still missing some functionnalities, such as export of console output  that should be implemented soon).

Friday 29 April 2011

Python(x,y) News: Python(x, y) 2.6.6.0 Released!

Python(x,y) News: Python(x, y) 2.6.6.0 Released!: "Hi All, Gabi Davar and I are pleased to announce that Python(x,y) 2.6.6.0 has been released. This is the last major release based on Python..."

Thursday 24 March 2011

IAS 19 Employee Benefits ( Board March'11 meeting): amendment effective date 01/01/2013


During its March meeting, the IASB Board unanimously confirmed that the IAS 19 Employee Benefits amendments would be effective from 1 January 2013.  The amendment itself is still expected to be issued in April 2011.
 

Thursday 24 February 2011

IAS 19 Employee Benefits (Board Feb'11 meeting) : amendment expected in March '11

The IASB continued its discussion of the proposals in the exposure draft Defined Benefit Plans (the ED). At this meeting the Board discussed:
  • the presentation of remeasurements;
  • disclosure and administration costs; and
  • the effective date and transition requirements.

Presentation of remeasurements
In December 2010 the Board tentatively decided to allow an entity to present remeasurements in profit or loss. In January 2011 the Board confirmed that decision but added some restrictions, such as making the election irrevocable, and asked the staff to assess whether the option should be restricted further. At this meeting the Board decided, in the light of that initial assessment, to revert to, and confirm, the proposal in the ED that remeasurements should be presented in other comprehensive income. The decision was supported by eight Board members. The remaining seven Board members would have preferred either to confirm the decision reached in January or to allow a free choice. 

Disclosure and administration costs
At the November and December 2010 Board meetings the Board asked the staff to obtain input from the Employee Benefits Working Group on particular aspects of the tentative decisions to date on disclosure and administration costs.
On the basis of this feedback the Board tentatively decided unanimously:
  • to require the disclosure of the weighted-average duration of the defined benefit obligation, and that the amendments should include examples of the types of additional information that could be provided about the maturity analysis to meet the disclosure objective; and
  • that administration costs related to the management of plan assets should be deducted from the return on plan assets.

The Board also decided, by a vote of nine to six, not to proceed with a requirement to disclose a disaggregation of the defined benefit obligation. Instead, the amendment should include an example of the type of disclosure that may meet the disclosure objectives.

Effective date and transition requirements
The Board decided to defer its decision on the effective date but tentatively agreed that it should not be earlier than 1 January 2013. The Board will discuss the effective date as well as early application as part of the broader consideration of the feedback received from the consultation on the Request for Views on Effective Dates and Transition Methods.

Subject to the Board's broader consideration of transition, the Board tentatively decided unanimously:
  • that for entities already applying IFRSs, the amendments to IAS 19 should be applied retrospectively in accordance with the general requirements of IAS 8 Accounting Policies, Changes in Accounting Estimates and Errors, except that:
    • the carrying amount of assets outside the scope of IAS 19 need not be adjusted for changes in employee benefit costs that were included in the carrying amount before the beginning of the financial year in which this standard is first applied (ie previously unrecognised actuarial gains and losses and past service cost should be recognised by adjusting equity, not by adjusting the carrying amount of assets that include employee benefit costs); and
    • comparatives need not be presented for the disclosures for the sensitivity of the defined benefit obligation for the year of initial application of the amendments to IAS 19;
  • that for entities adopting IFRSs for the first time, the amendments to IAS 19 should be applied retrospectively in accordance with the general requirements of IFRS 1 First-time Adoption of International Financial Reporting Standards, except that the Board will allow a temporary exemption for entities adopting IFRSs with a date of transition to IFRSs before the effective date of the amendments to IAS 19. That exemption would mean that comparatives need not be presented for the disclosures for the sensitivity of the defined benefit obligation.
  • to confirm the proposal in the 2010 exposure draft to delete paragraphs 153-156 of IAS 19 and paragraph D10 of Appendix D of IFRS 1.

Next steps
All the Board members agreed that, subject to balloting, the Board has satisfactorily completed all the steps required in the IASB Due Process Handbook.
The Board instructed the staff to begin the balloting process for the amendment to IAS 19. The Board plans to issue the amendment by the end of March 2011.

Tuesday 1 February 2011

Python-based data/science environment from Microsoft

Microsoft's Ironpython?

I've noticed a recent post in a blog from http://www.johndcook.com/blog/category/python/

Sho is an interactive environment for data analysis and scientific computing that lets you seamlessly connect scripts (in IronPython) with compiled code (in .NET) to enable fast and flexible prototyping. The environment includes powerful and efficient libraries for linear algebra as well as data visualization that can be used from any .NET language, as well as a feature-rich interactive shell for rapid development.
http://blogs.msdn.com/b/the_blog_of_sho/archive/2011/01/26/introducing-sho.aspx

See also http://www.johndcook.com/blog/2010/07/01/scipy-and-numpy-for-net/

Saturday 29 January 2011

IAS 19 Employee Benefits : From the Board - Remeasurement & Curtailment/Settlement

During its January meeting, the Board continued the discussions with regard to

  • presentation of remeasurementthe Board tentatively decided that, although remeasurements should be presented in other comprehensive income, there were circumstances in which it would be appropriate to allow an entity to elect to present remeasurements in profit or loss (primarily to address accounting mismatches) for a given plan. 
  • curtailment & settlement: the Board tentatively proposed recognition rules for
    • gains and losses resulting from  a curtailment or plan amendment arising as part of a restructuring plan or is linked to termination benefits
    • termination benefits arising as a part of plan amendment arises as part of a restructuring plan
More information available at this link.

Thursday 27 January 2011

Python Web-Hosting with Numpy : virtualising your environment

Many solutions can be found to host a Python-based website. But really few (none?) of them offer a solutions with pre-installed Numpy, Scipy and Matplotlib. A way for circumeventing this seems to rely on the virtualisation of your Python environment with tools such virtualenv. You would have to proceed as follows
  1. Virtualisation of a own Python environment with the website hoster
  2. Installation of the required tools with easy_install
This link points to the referred solution (copied hereunder)...that I have not tested ! 

For your information:
  • I didn't know numpy, scipy and friends could be (easily) installed with easy_install
  • This at least requires the gcc tools or the corresponding compiling and building tools to be installed with the server

You can indeed install third party packages to your hosted space. If it's a pure python package, all that's needed is to unpack it to a directory and then add that directory to your PYTHONPATH environment variable or sys.path.
This can be tiring to do often, and won't work easily for compiled modules. If you have shell access to your python host, the excellent virtualenv package allows you to do set up a private python environment with its own libraries.
To set up your virtualenv, you'll do something like this at the shell:
$ virtualenv $HOME/my_python
$ $HOME/my_python/bin/easy_install numpy
You can keep running easy_install for anything else you want to install in your personal python environment.
Now, when you write your python scripts, you will want to use your private python interpreter, if that is possible:
 #!/home/myuser/my_python/bin/python
import numpy
# script here
If your python env cannot be specified (such as if run by mod_wsgi), you will need to add it to the  import path:
import sys
sys.path.insert(0, '/home/myuser/my_python/lib/python2.5/site-packages')
import numpy

Tuesday 25 January 2011

The difficult choice of a python IDE

The first steps in python often begin with the simple environment that comes with python. After a while you start looking for something more and there's a lot out there: Python wiki on IDE's, some are commercial, some are open source. I've tried out some open source versions and can't say there's a winner.
Here is a nice list of the possibilities: Open source Python IDE's

For the moment I work with Spyder and Eclipse(PyDev) that comes with a package that's interesting  because it gives you a lot of functionality at once (Python x,y (scientific-oriented Python Distribution))

I also tried out Eric and Pyscripter and Eric seems also interesting when you want some more help with GUI development (Qt) and webenabled development (Django).

Friday 21 January 2011

Python, Programming language of 2010

Programming language Python has become programming language of 2010. This award is given to the programming language that gained most market share in 2010. Python grew 1.81% since January 2010. This is a bit more than runner up Objective-C (+1.63%). Objective-C was favorite for the title for a long time thanks to the popularity of Apple's iPhone and iPad platforms. However, it lost too much popularity the last couples of months.

Python has become the "de facto" standard in system scripting (being a successor of Perl in this), but it is used for much more different types of application areas nowadays. Python is for instance very popular among web developers, especially in combination with the Django framework. Since Python is easy to learn, more and more universities are using Python to teach programming languages.

Source: TIOBE

Wednesday 19 January 2011

For .NET users: GSL binaries

GSL (GNU Scientific Library) is the popular open-source scientific library.

This  link points to two .NET libraries 2 libgsl_d.dll and libgslcblas_d.dll that have been been built statically (and posted on www.quantcode.com). Hence they can be used from a C# application of plat invoke, without dependency issues.

Saturday 15 January 2011

For .NET lovers or slaves : SharpDevelop 4.0 has been released

SharpDevelop is an open source IDE alternative for .NET development (under PC environment). Its brand new 4.0 release now allows building against .NET 4.0 framework (and previous releases as well). With respect to the free Microsoft Express tools:

  • It includes tools that are not included in the limited Express versions, such as Class Diagrammes
  • It handles more .NET dialects from the same platform: VisualBasic.NET, C#, Boo, F# and IronPython and IronRuby
  • It includes a translation module between dialects
  • For those who cannot miss their favorite scripting language, it includes (Iron)Python/Ruby console even if you develop under C#.

Friday 7 January 2011

"IAS 19 Employee Benefits : prémices d'une mutation" has been issued by Kluwer

This booklet (64 pages) link published by Kluwer analyses and comments the recent proposals made by the IAS Board with respect to IAS 19  in its Exposure Draft ED/2010/3 Defined Benefit Plans: Proposed amendments to IAS 19. The table of contents is available here.

Thursday 6 January 2011

Prospective mortality tables; R is your friend

A very interesting R package that permits to easily fit the Lee Carter model for prospective mortality tables.

website: http://cran.r-project.org/web/packages/demography/demography.pdf

Description:

Functions for demographic analysis including lifetable
calculations; Lee-Carter modelling; functional data analysis of
mortality rates, fertility rates, net migration numbers; and stochastic population forecasting

Interested people might also find intersting to use the web applciation developped by Mr Lee himself:
http://lcfit.demog.berkeley.edu/

Useless to say that the web application uses Python... ;-)