Prior weight function module

In priorweightfunction.f90, all subroutines and functions are contained within the priorweightfunction module. The radius of support for the nodal weight functions, metric D, and the prior are set in subroutine setrmaxandpriorweight($ \ldots$). This is done via a call to this function from an external program or from subroutine drivermaxent($ \ldots$), which is contained in the maxent module. The main program, main.f90, serves as an illustrative reference. The variables rmax, D, and prior are private variables, and hence once they are set, all functions within the module can access them. The weight functions are defined in function weightfunction($ k$, $ \tilde x^k$, $ D_k \tilde {x}^k$,$ q$). Here, $ k$ runs from $ 1$ to $ n$, $ \tilde x^k := {x}^k - {x}$, and $ D_k \ne I$ renders the nodal weight function support to be anisotropic. The variable $ q := \sqrt{\tilde {x}^k D_k \tilde {x}^k}/\rho_{\textrm{max}}^k$, where $ \rho_{\textrm{max}}^k$ is the radius of support of the nodal weight function. The following weight functions are available:
  1. uniform: a constant weight function, i.e., $ w(q) = 1$.
  2. cubic: the weight function is a $ C^2$ cubic spline function, which is given by

    $\displaystyle w(q) = \begin{cases}\dfrac{2}{3} - 4q^2 +4 q^3 & \textrm{if } 0 \...
...& \textrm{if } \dfrac{1}{2} < q \le 1,\ 0 & \textrm{otherwise} \end{cases}  .$ (19)

  3. quartic: the weight function is a $ C^2$ quartic polynomial function, which is given by

    $\displaystyle w(q) = \begin{cases}1 - 6 q^2 + 8q^3 - 3q^4 & \textrm{if } 0 \le q \le 1,\ 0 & \textrm{otherwise} \end{cases}  .$ (20)

  4. gaussian: the weight function is a $ C^\infty$ Gaussian function, which is given by

    $\displaystyle w(q) = \begin{cases}\exp\left(-\dfrac{1}{1-q^2}\right) & \textrm{if } 0 \le q \le 1,\ 0 & \textrm{otherwise} \end{cases}  .$ (21)

  5. gaussian-rbf: a $ C^\infty$ Gaussian radial basis function, $ w(r) = \exp   ( -\beta r^2 )$ [12], where $ \beta \equiv \rho_{\textrm{max}}^k$ is a constant for each node.
If a different prior is desired, it can be added in function weightfunction($ \ldots$). The gradient is defined in function dweightfunction($ \ldots$), and the Hessian of the weight function is defined in function ddweightfunction($ \ldots$).

N. Sukumar
Copyright © 2008