Ask Applied Statistics Expert

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

Applied Statistics, Statistics

  • Category:- Applied Statistics
  • Reference No.:- M92542793

Have any Question?


Related Questions in Applied Statistics

Question onea a factory manager claims that workers at

QUESTION ONE (a) A factory manager claims that workers at plant A are faster than those at plant B. To test the claim, a random sample of times (in minutes) taken to complete a given task was taken from each of the plant ...

You are expected to work in groups and write a research

You are expected to work in groups and write a research report. When you work on your report, you need to use the dataset, and other sources such as journal articles. If you use website material, please pay attention to ...

Assignment -for each of the prompts below report the

Assignment - For each of the prompts below, report the appropriate degrees of freedom, t statistic, p-value and plot using the statistical software platform of your choice (R/STATA) 1) A sample of 12 men and 14 women hav ...

Assignment - research topicpurpose the purpose of this task

Assignment - Research topic Purpose: The purpose of this task is to ensure you are progressing satisfactorily with your research project, and that you have clean, useable data to analyse for your final project report. Ta ...

Assessment task -you become interested in the non-skeletal

Assessment Task - You become interested in the non-skeletal effects of vitamin D and review the literature. On the basis of your reading you find that there is some evidence to suggest that vitamin D deficiency is linked ...

Part a -question 1 - an analyst considers to test the order

PART A - Question 1 - An analyst considers to test the order of integration of some time series data. She decides to use the DF test. She estimates a regression of the form Δy t = μ + ψy t-1 + u t and obtains the estimat ...

Medical and applied physiology experimental report

Medical and Applied Physiology Experimental Report Assignment - Title - Compare the working and spatial memory by EEG. 30 students were tested (2 memory games were played to test their memory - a card game and a number g ...

Business data analysis computer assignment -part 1

Business Data Analysis Computer Assignment - PART 1 - Economists believe that high rates of unemployment are linked to decreased life satisfaction ratings. To investigate this relationship, a researcher plans to survey a ...

Question - go to the website national quality forum nqf

Question - Go to the website, National Quality Forum (NQF), located in the Webliography, and download the article by WIRED FOR QUALITY: The Intersection of Health IT and Healthcare Quality, Number 8, MARCH 2008. You are ...

Go to the webliography source for the national cancer

Go to the Webliography source for the National Cancer Institute's Surveillance, Epidemiology, and End Results (SEER) Program. In the Fast Stats, create your own cancer statistical report, "Stratified by Data Type," and u ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As