The P-approximation is finding the shadow price of a stock, \(p\) from the relation:
\(p(s) = \frac{W_{s}(s) + \dot{p}(s)}{\delta - \dot{s}_{s}}\),
where \(W_{s} = \frac{dW}{ds}\), \( \dot{p}(s) = \frac{dp}{ds}\),
\(\dot{s}_{s} = \frac{d\dot{s}}{ds} \), and \(\delta\) is the given discount rate.
Consider approximation \(p(s) = \mathbf{\mu}(s)\mathbf{\beta}\), \(\mathbf{\mu}(s)\)
is Chebyshev polynomials and \(\mathbf{\beta}\) is their coeffcients.
Then, \(\dot{p} = diag (\dot{s}) \mathbf{\mu}_{s}(s)\mathbf{\beta}\) by the orthogonality of Chebyshev basis.
Adopting the properties above, we can get the unknown coefficient vector \(\beta\) from:
\(\mathbf{\mu}\mathbf{\beta} = diag \left( \delta - \dot{s}_{s} \right)^{-1} \left( W_{s} + diag (\dot{s}) \mathbf{\mu}_{s} \mathbf{\beta} \right) \), and thus,
\(\mathbf{\beta} = \left( diag \left( \delta - \dot{s}_{s} \right) \mathbf{\mu} - diag (\dot{s}) \mathbf{\mu}_{s} \right)^{-1} W_{s} \).
In a case of over-determined (more nodes than approaximation degrees),
\(\left( \left( diag \left( \delta - \dot{s}_{s} \right) \mathbf{\mu} - diag (\dot{s}) \mathbf{\mu}_{s} \right)^{T}
\left( diag \left( \delta - \dot{s}_{s} \right) \mathbf{\mu} - diag (\dot{s}) \mathbf{\mu}_{s} \right) \right)^{-1}
\left( diag \left( \delta - \dot{s}_{s} \right) \mathbf{\mu} - diag (\dot{s}) \mathbf{\mu}_{s} \right)^{T} W_{s}\)
For more detils see Fenichel et al. (2016).