Pstat 160B Programming Assignmen

Pstat 160B Programming Assignment 1
Instructions:
You can use either R or Python. I strongly suggest you to use notebooks (either R Markdown
or Jupyter).
The code must be annotated. Show your results and make your conclusion.
Submit these files on Gauchospace:
– pdf file, which should contain annotated code, results, graphics (if any) , conclusion.
– source file (.ipynb, .Rmd, .py or .R) in case we need to rerun your code. Therefore
clearly state the seed you’re using for your simulations.
The problems below are due Sunday January 27th at 11:59pm.
1. (Sarantsev 160 Notes, Problem 21.16 page 119) Simulate 1000 times the first 50 jumps of a
Poisson process (Nt)t>0 with intensity λ = 2. Calculate the empirical expectation E[N1N2],
and compare it with the true value.
2. (Dobrow, Problem 6.44 page 264) Investors purchase $1000 dollar bonds at the random times
of a Poisson process with parameter λ. If the interest rate is r, then the present value of an
investment purchased at time t is 1000e
rt. Then the expected total present value of the bonds
purchased by time t is 1000(1 e
rt)
Simulate the expected total present value of bonds if the interest rate is 4%, the Poisson
parameter is λ = 50, and t = 10. Compare with the exact value.
3. Compound Poisson process. We modify the Poisson process to let it jump not only by 1 upward,
but in a more general way. Define a sequence of i.i.d. (independent identically distributed)
random variables Z1, Z2, . . . , independent of (Nt)t≥0. Then a compound Poisson process is
defined as
Ct =XNt
k=1
Zk.
It starts from C0 = 0, then waits time X1 and jumps to CX1 = Z1. Next, it waits additional
time X2 (for the total time S1 = X1 + X2) and jumps to CS1 = Z1 + Z2, then waits time X3
and jumps to CS3 = Z1 + Z2 + Z3, etc. For a Compound Poisson process the mean and the
variance are given by:
E(Ct) = E(Nt)E(Zk)
V ar(Ct) = E(Nt)V ar(Zk) + V ar(Nt)(E(Zk))2
(Sarantsev 160 Notes, Problem 21.17 page 119) Simulate 1000 times the first 50 jumps of a
compound Poisson process (Ct)t≥0 with increments Z1, Z2, . . . distributed as N(2.5, 4), and
intensity λ = 0.5. Use this to find empirical value V ar(C4), and compare this with the true
value.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codinghelp

原文地址:https://www.cnblogs.com/rrrrrhelper/p/10327704.html

时间: 2024-10-12 00:14:53

Pstat 160B Programming Assignmen的相关文章

Functional Programming.

I have been seeing Redux for sometime, but recently I come to realize that , it's part of so called functional programming. The basic idea for functional programming is so simple, Declare all dependency as function input, no hidden input ( we should

Go语言自述(The Go Programming Language README)

声明:本文为笔者为练习英语所做的翻译练习,原文所属者与笔者没有任何关系,翻译结果不代表原文所属者的观点.笔者不保证翻译的正确性,任何人以任何形式的对本文的引用,都是不负责任和荒谬的行为,造成的后果笔者不予负责. 原文链接所属:golang/go Go is an open source programming language that makes it easy to build simple,reliable, and efficient software. Go是一门开源的编程语言,用它可

Algorithm Part I:Programming Assignment(2)

问题描述: Programming Assignment 2: Randomized Queues and Deques Write a generic data type for a deque and a randomized queue. The goal of this assignment is to implement elementary data structures using arrays and linked lists, and to introduce you to g

Java Object Oriented Programming concepts

Introduction This tutorial will help you to understand about Java OOP'S concepts with examples. Let's discuss about what are the features of Object Oriented Programming. Writing object-oriented programs involves creating classes, creating objects fro

How To: Perl TCP / UDP Socket Programming using IO::Socket::INET

http://www.thegeekstuff.com/2010/07/perl-tcp-udp-socket-programming/ In this article, let us discuss how to write Perl socket programming using the inbuilt socket modules in Perl. Perl socket modules provides an object interface that makes it easier

Unity基于响应式编程(Reactive programming)入门

系列目录 [Unity3D基础]让物体动起来①--基于UGUI的鼠标点击移动 [Unity3D基础]让物体动起来②--UGUI鼠标点击逐帧移动 时光煮雨 Unity3D让物体动起来③—UGUI DoTween&Unity Native2D实现 时光煮雨 Unity3D实现2D人物动画① UGUI&Native2D序列帧动画 时光煮雨 Unity3D实现2D人物动画② Unity2D 动画系统&资源效率 背景 前有慕容小匹夫的一篇<解构C#游戏框架uFrame兼谈游戏架构设计&

Distributed Programming With Ruby》读书笔记六 Starfish, Distribunaut and Politics (Part2 chapter4-6)

Chapter4: Starfish (海星?)这样的例子有时间换linux的环境试一下吧 Starfish1 bills itself as "a utility to make distributed programming ridiculously easy." I think that is a bit of an overstatement, but Starfish certainly can make distributed programming easier. Thi

Async/Await - Best Practices in Asynchronous Programming

https://msdn.microsoft.com/en-us/magazine/jj991977.aspx Figure 1 Summary of Asynchronous Programming Guidelines Name Description Exceptions Avoid async void Prefer async Task methods over async void methods Event handlers Async all the way Don’t mix

Dynamic Programming

We began our study of algorithmic techniques with greedy algorithms, which in some sense form the most natural approach to algorithm design. Faced with a new computational problem, we've seen that it's not hard to propose multiple possible greedy alg