What are the conditional posterior distributions

Assignment Help Applied Statistics
Reference no: EM131734107

Question 1 -

Consider a set of data relating two score tests, LSAT and GPA, at a sample of 15 American law schools. Of interest is the correlation θ = cor(lsat, gpa) between these measurements and the variance ratio ψ = var(lsat)/var(gpa).

list(lsat = c(576, 635, 558, 578, 666, 580, 555, 661, 651, 605, 653, 575, 545, 572, 594),

gpa = c(3.39, 3.30, 2.81, 3.03, 3.55, 3.07, 3.00, 3.43, 3.36, 3.13, 3.12, 2.74, 2.76, 2.88, 2.96),

n = 15)

1. Write a function in R called CI.cor that returns 95% bootstrap confidence intervals for the correlation parameter θ using the basic bootstrap interval method and the percentile interval method. Your answer should contain the R function CI.var.cor.

2. Write a function in R called CI.var.ratio. that returns 95% bootstrap confidence intervals for the variance ratio ψ using the basic bootstrap interval method and the percentile interval method.

Your answer should contain the R function CI.var.ratio.

Question 3 -

Consider the following dataset

list(t = c(94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5),

x = c(5, 1, 5, 14, 3, 19, 1, 1, 4, 22),

n = 10)

on observed failures xi of n = 10 power plant pumps. Here ti denotes the length of operation time of the pump (in 1000s of hours). The number of failures Xi is assumed to follow a Poisson distribution Xi| θi ∼ Poisson(θiti). Consider the hierarchical model

θi| α, β ∼ Gamma(α, β)

where

α ∼ Exp(λ), β ∼ Gamma(γ, δ), λ = 1 and γ = δ = 0.01.

1. What are the conditional posterior distributions of

- θi| θ-i, α, β, x;

- β | θ, α, x;

- α | θ, β, x?

Write your answer in a section called Question 3 (a) of the file.

2. Write a function in R called mcmc.pumps that implements a general McMC algorithm with components θ, β, α where θ and β are updated from the posterior conditional distribution and log α is updated via a random walk Metropolis step with normal increments. The function should return samples from the posterior distribution of θ, β and α as well as an estimate of the probability of accepting α.

Your answer must contain the code of the function mcmc.pumps.

3. Write a function in R called predictive.pumps that returns estimates of the predictive distribution of failures for the i-th pump for a given length of operation time ti, using Monte Carlo integration.

Your answer must contain the code of the function predictive.pumps.

Question 4 -

Let x1, . . . , xn be a sample of independent and identically distributed observations assumed to have been generated from a t-distribution with ν degrees of freedom located at µ, i.e.,

f(x | µ) ∝ {1 + 1/ν(x - µ)2}-(ν+1)/2                                                 x ∈ R.                     (1)

Assume ν = 10 and suppose µ ∼ N(0, 1).

1. Write down, up to proportionality constant, the posterior µ | x. Is this a recognisable density? Write a function in R called mcmc.t that implements an McMC algorithm for evaluating the posterior distribution of µ where the updating is done using random walk Metropolis with a normal candidate generator.

Your answer should contain the posterior density of µ | x in a section called Question 4 (1) of the =matriculationA2math= file and the function mcmc.t separately in and scriptA2.R

2. Using the fact that the t-distribution is a scale mixture of normals, the sampling model in (1) can alternatively be represented as

xi| µ, zi ∼ N(µ, 1/zi)

where zi are a priori independent of µ and

f(zi) ∝ zi(ν/2)-1 exp{-(ν/2) zi}.

Using this representation together with the prior distribution µ ∼ N(0, 1), write down, up to proportionality constant, the conditional posterior densities of µ and of each zi , i = 1, . . . , n and identify the distributions corresponding to each of these densities. Write a function in R called mcmc.gibbs that implements a Gibbs sampling algorithm for computing the posterior distribution of µ.

Your answer should contain the conditional posterior densities of µ and each of the zis in the file in a section called Question 4 (2) of the =matriculationA2math= file and the function mcmc.gibbs separately in and scriptA2.R

3. Let x denote a future observable. Write a function in R called predictive.t that returns estimates of the predictive distribution x| x using Monte Carlo integration. Your answer must contain the code of the function predictive.t.

4. Write a function in R called predictive.quantile that estimates the pth quantile of the predictive distribution

xp : Pr (x ≤ xp | x) = p

and use it to construct a 95% predictive interval.

Your answer must contain the code of the function predictive.quantile as well the code used to obtain the 95% predictive interval.

I Need help with questions 1, 3, 4.

Attachment:- Assignment File.rar

Reference no: EM131734107

Questions Cloud

How much should the lender be willing to lend : In Question 1 (with 96 equal monthly payments of $1,666.67) suppose the borrower also offers to pay the lender $90,000 at the end of the eight-year period.
Describing the algorithm with words is enough : Design a divide-and-conquer algorithm that achieves this task. (describing the algorithm with words is enough)
Write an essay analyzing gibsons story using critical theory : When you have completed the reading and selected a literary theory, compose a 300-500 word essay analyzing Gibson's story using the critical theory you find.
Discuss about the pyschological factors of drugs : Critique two journal articles pertaining to the social, physiolocial, and/or pyschological factors of drugs, while the second critique should pertain.
What are the conditional posterior distributions : What are the conditional posterior distributions. Write a function in R called mcmc.pumps that implements a general McMC algorithm
Characteristic symptom of an alcoholic employee : Which of the following is characteristic symptom of alcoholic employee? Which of following is effective approach to counseling an employee who may be alcoholic.
Describe the core conflict represented in the story : Describe the core conflict represented in the story. Describe the theme of the story. Select three literary elements/techniques in the story and describe them.
How does the students revision compare to the original : How does the student's revision compare to the original. What specifically did he add or change that made the revision more effective
Did you know about intersex : Watch the following video: "Intersex People and the Physics of Judgment | Cecelia McDonald | TEDxBoulder"(YouTube Video)

Reviews

Write a Review

Applied Statistics Questions & Answers

  Hypothesis testing

What assumptions about the number of pedestrians passing the location in an hour are necessary for your hypothesis test to be valid?

  Calculate the maximum reduction in the standard deviation

Calculate the maximum reduction in the standard deviation

  Calculate the expected value, variance, and standard deviati

Calculate the expected value, variance, and standard deviation of the total income

  Determine the impact of social media use on student learning

Research paper examines determine the impact of social media use on student learning.

  Unemployment survey

Find a statistics study on Unemployment and explain the five-step process of the study.

  Statistical studies

Locate the original poll, summarize the poling procedure (background on how information was gathered), the sample surveyed.

  Evaluate the expected value of the total number of sales

Evaluate the expected value of the total number of sales

  Statistic project

Identify sample, population, sampling frame (if applicable), and response rate (if applicable). Describe sampling technique (if applicable) or experimental design

  Simple data analysis and comparison

Write a report on simple data analysis and comparison.

  Analyze the processed data in statistical survey

Analyze the processed data in Statistical survey.

  What is the probability

Find the probability of given case.

  Frequency distribution

Accepting Manipulation or Manipulating

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd