Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Run the following R code. The set.seed ( ) command insures that everyone using this code will have the same random numbers and will obtain

Run the following R code. The set.seed() command insures that everyone using this code will have the same random numbers and will obtain the same price series. There are 253 trading days per year, so you are simulating 1 year of daily returns nine times. The price starts at 120.
The code par(mfrow=c(3,3)) on line 3 opens a graphics window with three rows and three columns and rnorm() on line 6 generates normally dis- tributed random numbers.
1 set.seed(2012)
2 n=253
3 par(mfrow=c(3,3))
4 for (i in (1:9))
5{
6 logr = rnorm(n,0.05/253,0.2/ sqrt(253))
7 price = c(120,120* exp(cumsum(logr)))
8 plot(price, type ="b")
9}
Problem 9 In this simulation, what are the mean and standard deviation of the log-returns for 1 year?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions