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

  Develop a confidence interval for the mean

Choo Choo Paper Company produces papers of various thicknesses. A random sample of 49 cuts had a mean thickness of 30.3 mils with a sample standard deviation of 4 mils. a) Develop a 99% confidence interval for the mean thickness of the population. b)..

  Describe the components for the chi square formula

The overall predicted portion of Y score variability is measured by r squared. SS regression is the denominator in the F-ratio inference test for regression.SS residual is the numerator in the F-ratio inference test for regression.No correlation betw..

  Determine the sample size needed so that we are confident

Determine the sample size needed so that we are 95 percent confident that pˆ, the sample proportion of voters who favor the candidate.

  An investigator wants to estimate caffeine consumption in hi

An investigator wants to estimate caffeine consumption in high school students. How many students would be required to estimate the proportion of students who consume coffee? Suppose we want the estimate to be within 5% of the true proportion with 95..

  Determine the option price at time zero

Determine the option price at time zero by the Black-Scholes formula. That's what your customers pay and cumulative distribution function of the standard normal distribution function, satisfies the Black- Scholes PDE with the terminal condition fo..

  Generating the greatest good for the greatest number

Generating the greatest good for the greatest number.

  Develop a process map about the prescription filling process

Develop a process map about the prescription filling process for HMO's pharmacy, in which you specify the key problems that the HMO's pharmacy might be experiencing. Next, use the supplier, input, process steps, output, and customer (SIPOC) model to ..

  Determine the association between the predictive variables

Determine the association between the predictive variables described below and having a low birth baby using separately the dichotomous outcome

  Describe the distribution of revenue growth rates

The following are the revenue growth rates for 30 fast-growing companies. Develop a dot plot for these data and describe the distribution of revenue growth rates.

  A random variable x follows a normal distribution

A random variable X follows a normal distribution with standard deviation 13.  A random sample of 30 individuals is selected from the population, and a confidence interval for  is calculated to be (87.348, 96.652).  What is the confidence level for t..

  How is the rejection region defined

How is the rejection region defined and how is that related to the z-score and the p value? When do you reject or fail to reject the null hypothesis? Why do you think statisticians are asked to complete hypothesis testing? Can you think of examples i..

  Risk factors using a multivariate analysis

The authors stated that they controlled for confounding many risk factors using a multivariate analysis. State an alternative method that the authors could have used to control for confounding in the design or analysis.

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