title: Copula-based conditional probability
body: <p>Reading the paper "A multivariate model of sea storms using copulas" (De Michele et al., 2007) <a href="https://www.sciencedirect.com/science/article/pii/S0378383907000592" rel="nofollow noreferrer">https://www.sciencedirect.com/science/article/pii/S0378383907000592</a>
  I'm stuck on partial derivatives' calculation in R.</p>
  
  <p><strong>The mathematical background:</strong> </p>
  
  <p>If you have three variables H, D, I (with U1=F(H) etc.) and you need to estimate the conditional probability </p>
  
  <p>P(U3|U1,U2) </p>
  
  <p>you should first estimate the ratio of partial derivatives such as </p>
  
  <p>(∂C(u1,u2,u3)/∂u1 ∂u2) / (∂C(u1,u2)/∂u1 ∂u2)</p>
  
  <p>(for more details, please see the image),<a href="https://i.stack.imgur.com/dn3vz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dn3vz.jpg" alt="According to De Michele et al., 2007"></a></p>
  
  <p><strong>The code:</strong> </p>
  
  <p>Following the R package "VineCopula" (<a href="https://cran.r-project.org/web/packages/VineCopula/VineCopula.pdf" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/VineCopula/VineCopula.pdf</a>) the function dduCopula evaluates the partial derivative </p>
  
  <p>∂C(u1,u2)/∂u1,</p>
  
  <p>so this procedure is easy for the simple partial derivatives (named k, m and n in the image).</p>
  
  <p>But how can I estimate the partial derivative which is in respect of another variable "u1" compared to the copula C(k,m).</p>
  
  <p>∂C(k,m)/∂u1 ?</p>
  
  <p>For the partial derivatives k and n:</p>
  
  <pre><code>library(VineCopula)
  u1&lt;-pobs(H)
  u2&lt;-pobs(D) 
  library(copula)
  C_hd &lt;- BB1Copula()
  k &lt;- ddvCopula(cbind(u1,u2), C_hd)
  n &lt;- dduCopula(cbind(u1,u2), C_hd)
  </code></pre>
  
  <p>Do you have any idea?</p>