Computational-Statistics-732A90 – Computer Lab 3 Computational Statistics Solved

34.99 $

Category: Tags: , , , , , ,
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (2 votes)

Question 1: Stable distribution
A random variable has a so called one–sided strictly stable distribution of order 1/2 if for a parameter c > 0 it has density equalling
√ 2 f(x) = c( 2π)−1e−c /(2x)x−3/21(0,∞)(x).
In particular the support is on (0,∞). The aim of the assignment is to sample from this distribution by using an acceptance–rejection algorithm with the help of a power–law distribution with density

for Tmin > 0, α > 1. In particular the support is on (Tmin,∞).
1. Plot f(x) and fp(x) together. Can the power–law distribution be used just by itself or is there a problem at any place of the support Explain what the problem is and how can it be taken care of. Provide values of the power–law distribution’s parameters that can be used in the acceptance–rejection algorithm. Derive and implement a majorizing density.
2. Implement an acceptance–rejection algorithm for sampling from the one–sided strictlystable distribution of order 1/2 with the proposal distribution built around the power– law distribution. To sample from a power–law distribution you can use the function poweRlaw::rplcon().
3. Generate a large sample using your implemented sampler, for different choices of c. Present the sample graphically. What is the mean and variance and how do they depend on c? Study the rejection rate.
Question 2: Laplace distribution
The double exponential (Laplace) distribution is given by formula:

1. Write a code generating double exponential distribution DE(0,1) from Unif(0,1) by using the inverse CDF method. Explain how you obtained that code step by step. Generate 10000 random numbers from this distribution, plot the histogram and comment whether the result looks reasonable.
2. Use the Acceptance/rejection method with DE(0,1) as a majorizing density to generate N(0,1) variables. Explain step by step how this was done. How did you choose constant c in this method? Generate 2000 random numbers N(0,1) using your code and plot the histogram. Compute the average rejection rate R in the acceptance/rejection procedure. What is the expected rejection rate ER and how close is it to R? Generate 2000 numbers from N(0,1) using standard rnorm() procedure, plot the histogram and compare the obtained two histograms.

  • Lab3-3teov7.zip