I should probably do a better job of modeling this problem.
So, here's an approximate solution which I think models the integration process:
F=: (2*#) * */@:-. * +/&.:*:
prob=:dyad define
NB. x: number of samples for each dimension
NB. y: number of dimensions
dz=. %x-1
(dz^y)*+/^:_ F"1 >{y#<(i.x)*dz
)
100 prob 2
0.528113
Not completely accurate but that's not the point.
And, obviously there are ways of tweaking this - for example +/@, does
the same thing that +/^:_ does. But since this is just a model I
wanted to try get a little closer to the notation used on the
stackexchange page.
With that in mind, perhaps instead I should have done something like this:
prob=:dyad define
NB. x: number of samples for each dimension
NB. y: number of dimensions
dz=. %x-1
(dz * +/)^:(#@$) F"1 >{y#<(i.x)%x-1
)
But, for example:
F D. _1
|nonce error
So I would have to decompose this expression to get J's integration
techniques to function. But the question is: how do you decompose
something like this?
So, I'm looking for other people's perspectives...
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm