MATH 351 Homework 08

  1. Use inversion sampling to sample NN random numbers from the logistic distribution. The logistic distribution has cumulative distribution function F(x)=11+e(xμ)/sF(x) = \frac{1}{1 + e^{-(x-\mu) / s}} You pick values for the parameters μR\mu \in \mathbb{R} and s>0s > 0. Confirm your answer in at least two different ways.
  2. Use inversion sampling to sample NN random numbers from the Pareto distribution. The Pareto distribution has cumulative distribution function F(x)=1(xmx)αF(x) = 1 - \left(\frac{x_m}{x}\right)^{\alpha} for x>xmx > x_m. You pick values for the parameter xm>0x_m > 0 and α>0\alpha > 0. Confirm your answer in at least two different ways.
  3. Use the Metropolis Algorithm to sample NN random numbers for the parameter σ\sigma from the Rayleigh distribution based on a random sample of Rayleigh data x\mathbf{x}. The idea here is to learn about the value of σ\sigma by approximating expectations of a distribution for σ\sigma based on a sample of data x\mathbf{x}. The Rayleigh distribution has probability density function f(xσ)=xσ2ex2/(2σ2)f(x | \sigma) = \frac{x}{\sigma^2}e^{-x^2 / (2\sigma^2)} for x>0x > 0 and σ>0\sigma > 0. Here's some code to generate data from a Rayleigh distribution for a specified value of σ\sigma, which you should choose.
    import scipy.stats as st
    x = st.rayleigh(scale = 5).rvs(size = 501)