I doubt that automatic conversion of the specifications into
J is possible in all cases.  However, because of the superior
interactive array manipulations in J it is definitely worthwhile 
to explore your time-series data in J.

In the particular example in your msg,

   Contribution=: +/\ 0, MonthlyContribution

(Contributions are the partial sums of 0
catenated to the monthly contributions.)



----- Original Message -----
From: Patrick van Beek <[EMAIL PROTECTED]>
Date: Thursday, July 24, 2008 8:05
Subject: [Jprogramming] Converting time dependant variables to J
To: Programming forum <[email protected]>

> I have been using actuarial models for some time and a common 
> theme is that
> functions (variables) are defined in the model using simple code.
> Typically there is a dependance on time, usually denoted by the
> system varaible 't' which represents yaers or months since start 
> of the
> calculation.
> 
> A typical function for a variable say "Contributons" might be 
> along the
> lines of
> 
> If t = 0 Then
> Contributon = 0
> Else
> Contributon(t) = Contributon(t-1)  + Mtly_Contributon
> 
> Where Mtly_Contribution is a (scalar) input
> 
> A sequencer and compiler then strings all such functions 
> together and
> creates an executable which takes any inputs and calculates the 
> variablesfor each value of t from 0 to a system value and 
> outputs them.
> 
> I want to know if it is feasible to try to port my code to J 
> since on the
> one hand I have specification which requires sequencing and 
> compilation and
> on the other hand J is interpreted.  Ideally I would like 
> to write a
> J script which converts my specification into a J script which I 
> can then
> run on the inputs.
> 
> I was thinking that I could establish a list for each variable 
> in J with the
> index defining which value of t. Say ContributionsJ was a list 
> in J to
> represent the Contribiton functions above.  I think the 
> equivalent of
> Contribution(t) would be t { ContributionJ
> 
> I was thinking of writing a script with a "for do End" loop 
> which increments
> t. The various functions would then be calculated as t gets 
> incremented
> However I am a bit of a loss how I would I would determing the 
> sequencingorder where there is interdependance between the 
> various variables from
> different time periods. Is this something that is worth even 
> trying to do in
> J?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to