Er... still on the modeling, not on the analytic solution side of
this, I should be doing:
F=: (2*#) * */@:-. * +/&.:*:
prob=:dyad define
NB. x: number of samples for each dimension
NB. y: number of dimensions
dz=. %x
(dz * +/)^:(#@$) F"1 >{y#<(0.5+i.x)%x
)
The change is the subexpression (0.5+i.x)%x
This corresponds to using the trapezoid rule for a riemann sum. (It
also makes the result of the approximation more accurate than my
earlier fumblings.)
But what I would like to do is represent each iteration (currently the
inductive stages of (dz * +/)^:(#@$) F"1) analytically. And, for that,
I need an analytic technique which I am not comfortable with. And
that's where I am looking for help.
In other words, I think I want to treat each dimension independently,
which I think means an analytic placeholder in the above expression
for the lump of dimensions which will be treated further in later
steps.
Or, if that's not viable (and it might not be), then I need some other
divide&conqueror approach for this problem.
Any hints (even if someone could remind me of a relevant technique's
name), that would help.
Thanks,
--
Raul
On Wed, Jul 6, 2016 at 10:08 AM, Raul Miller <[email protected]> wrote:
> 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