Answered step by step
Verified Expert Solution
Link Copied!

Question

...
1 Approved Answer

Generate a sample of 1,000 independent observations from a gamma distribution with scale ? = 2 and shape k = 3 and giving R code

Generate a sample of 1,000 independent observations from a gamma distribution with scale ? = 2 and shape k = 3

and giving R code as

n = 1000 x = rgamma(n,shape = 3,scale = 2) hist(x,freq = FALSE,col = 'blue') lines(density(x),lwd =3,col = 'red')

for question

image text in transcribedimage text in transcribed
c. Construct a Kernel density estimator, f(x), assuming a rectangular kernel, from scratch (that is, without using in-built functions from R packages for constructing a Kernel density estimator). . To determine h, determine the bin-width used in the histogram from your preferred rule in b. and halve it. . The lower limit for x will be 0 and upper limit max + h. . Compare the KDE to the underlying distribution.. Sturges Rule: bw = Tmax -Tmin. where n is the sample size. log2 (n)+1 , . Scott's Rule: bw = 3.50 1/3, where o is the standard deviation of the data. . Freedman-Diaconis Rule: bw = 2(975-925) n1/3 where 975, 925 are the 75 % and 25 % quantile of the data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

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

Statistics For Engineers And Scientists

Authors: William Navidi

4th Edition

9780073401331

More Books

Students also viewed these Mathematics questions