On Oct 13, 2009, at 12:01 PM, Borden, Doug wrote:
I’ve just started using FiPy for a problem in quantitative finance,
and I need a bit of help getting started.
Welcome to the list.
I’ve cast a particular problem in trading as a stochastic control
problem, and after deriving the relevant Hamilton-Jacobi-Bellman
equation, I end up with a PDE to solve (see attached PDF). I have
two questions:
1) Do I only have a source term and a transient term, or can I
cast my problem with a convection term?
2) How do I specify my boundary conditions?
Any help you can offer would be greatly appreciated.
Aside from the issues that Frederic raises about singularities, my
thought is that from FiPy's perspective, because you are applying a
boundary condition on all x at t = t_n, I don't think you have a
transient term. Although you can certainly set an initial condition on
a time-dependent problem, FiPy has no way to assign a terminal value.
It may be more fruitful to think about two spatial dimensions that
happen to be named x and t and that run from -xmax to +xmax and from 0
to t_n. You can then impose a conventional FixedValue boundary
condition at t = t_n and it may be possible to solve the static
problem in terms of these two "spatial" dimensions. In principle, I
think d\phi/dt and d\phi/dx can then be cast to convection terms with
wind vectors of [0,1] and [1,0] respectively, but I'm not sure how I'd
capture the max() business. Also, because there would be nothing but
convection and sources, it might be necessary to introduce a transient
term for relaxation, but to recognize that it's in terms of an
artificial time variable, not your "t".
Daniel may hopefully have further insights into this, particularly on
how best to pose the convection terms.
Another possibility might be to set your t = t_n boundary condition as
an initial (final?) condition on a one-dimensional problem in terms of
x and then run backwards in time (TransientTerm(coeff=-1) should do
it). I see that Wikipedia says as much, so it must be true.