title: Coding a line with exponentially distributed random drops at Poisson distributed intervals
body: <p>I'm trying to model the ruin rate for an insurance company that will be receiving claims of random amounts (that I'm assuming will be exponentially distributed) at random time intervals (that I'm assuming will be Poisson distributed).</p>
  <p>I'm creating an index value of 100 for the initial holdings of the company and assuming that their assets grow at a constant rate of 5% per year and seeing how often ruin occurs when I change the different parameters in the Poisson and exponential distributions</p>
  <p>All I have come up with so far is a table of values that takes the previous holdings from the company, multiplies it by 1.05 and takes away a scaled random exponentially distributed value. I've tried including some Poisson extension for arrival intervals but this doesn't seem to work well, so I've hashed it out.  I'm struggling to then turn this into a line so it can be better visualised and also have the drops at random time intervals. Any help appreciated.</p>
  <p>code thus far:</p>
  <pre><code>data3 &lt;- data.frame(#arrival = rpois(50, lambda = 5),
                      size = rexp(50, rate = 50),
                      initial.holdings = rep(100,50)
                      )
  
  for(i in 2:50){
    newcolname &lt;- paste0(&quot;-&quot;, names(data3)[i])
    data3[[newcolname]] &lt;- (data3[,i]*1.05 -100*rexp(50, rate = 20))
  }
  </code></pre>