logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
459 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Tessa DuckworthMarketing
(5/5)

641 Answers

Hire Me
expert
Steven HughesEducation
(5/5)

712 Answers

Hire Me
expert
George BlackbridgeeCriminology
(5/5)

792 Answers

Hire Me
expert
Jovette BermanBusiness
(5/5)

713 Answers

Hire Me
R Programming
(5/5)

The four screensout is the question and plz follow the format of template

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

The four screensout is the question and plz follow the format of template

 

1. In this question, you will use simulation to estimate the value of z based on the fact that the area of circle with radius 1 is z.

a. Set the seed of the random number generator to 1234

b. Generate Xl, ,Xn, Yl,.

, Yn as i.i.d. random variables from l), where n 100. Don't display these 200

random variables in your solution.

c. Regard (Xi, Yi) as an coordinate in the xy plane. Find out the number of pairs (Xi, Yi)'s that fall within a circle centered at (O, O)

with radius 1 .

d. Compute the proportion p of pairs that fall within the circle. According to law of large numbers, 4p "converges" to z, when as n goes

to infinity. Compute the absolute error between 4p and z.

e. Set the seed to 5678 , and repeat part (b)-(d) with n 10000.

In the following questions, you will debug each of the functions included in the corresponding questions so that they produce the correct results.

After correcting those problems, you need to show the debugged function and display the result Of the testing code based on your debugged

function. Also you have to explain in words what changes you made and why. For convenience, the functions and testing code are also provided

in an accompanying R file.

2. my.dgamma. log() generates the log of the probability density of the Gamma distribution. Use ?lgamma to understand what it does. Note

that this is exactly equal to the function dgamma( ... ,

log-TRUE) so use this to verify your answers.

The function to be debugged:

my.dgamma. log C— function( xx, shape,

shape* log ( rate)

— Igarnma(shape) + (shape—I) —

The testing code:

rate)

rate*xx

my. dgamma. 2, 5, rate—5)

dgamma( 2, 5, . 2), 2, log—TRUE)

my.dgamma. log (seg(0.4, 10, by—O.4), shape—O . 2, rate—5)

my.dgamma. log (seq(l, 10, by—O.2), shape—2, rate:6)

3. my. dnorm. log() generates the log of the probability density of the normal distribution. Note that this is exactly equal to the function

. , log—TRUE) so use this to verify your answers.

dnorm(

The function to be debugged:

 

 

(5/5)
Attachments:

Expert's Answer

459 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme