美文网首页
Monte Carlo Simulation

Monte Carlo Simulation

作者: MC1229 | 来源:发表于2015-11-04 22:08 被阅读0次
simulation codes
  • rand follows uniform distribution between [0,1], randn follows normal distribution between [0,1].

  • rand(2,1), rand(2)

  • his(rand(100000,1))

  • icdf

  • icdf('Normal', rand(100000,1), 0.3,0.4)

  • A=icdf('exp', rand(100000,1), 0.5)
    hist(A)

Multivariate Random Number
  • mvnrnd([2;4][2 1;1 3])
  • mvnrnd([2;4][2 1;1 3],5)
  • A=mvnrnd([2;4][2 1;1 3],50000)
    plot(A(:,1), A(:,2),'d')

** Simulating period by period**


Code
  • Path is a matrix, in the last command, do remember to write "." after the Path(;,i), or Matlab will think it as a whole matrix transform, rather than for each element specified.
  • "Nsim" is number of simulation

** The simulated discounted present value **



Statistic Inference


Exercise


Variance Reduction

  • Antithetic Algorithm

Example

  • Control Variable

相关文章

网友评论

      本文标题:Monte Carlo Simulation

      本文链接:https://www.haomeiwen.com/subject/llzqhttx.html