Statistics 481: Homework


Final:

The Final is related to testing out the code from the bayestestR R package. Dowload the .Rmd file, modify the code as instructed, answer the questions in the .Rmd file, knit it to a .docx or .pdf file, and submit it on Blackboard


Project:

The project is to try to determine the number of event that Pres. Trump held since the start of the COVID-19 Lockdown and to determine an average number of people who attened each event. Using the the code in the rose_garden_ver08.Rmd, update the values of k, the number of events, and n, the average number of people at each event, estimate the predicted number of people who may have tested positive after the events Py[i] and the total number of people who may have tested postive, Py_tot.

Write a summary of your findings in a separate .docx file. Incude a table for each event and the estimated number of people who tested positive. Report the total number of people who may have tested positive with a 95% Bayesian Credible Interval.


Quiz:

The quiz is to experience the difference between running JAGS using single threaded rjags and running JAGS in parallel using runjags.

Run rose_garden_ver08.Rmd using the following values of (k,n): (5, 300), (10, 400), (50, 1000), (100, 5000). Determine the elapsed time using rjags. Determine the elapsed time using runjags.

Write a summary of finding in a separate .docx file. Include a table of your results. Explain the differences in the elapsed times.


Homework 8:


Homework 7:

(due Monday November 16, 2020)

Do the following: Complete all of the problems in your R Notebook.

  1. Find a dataset to perform Bayesian Linear Regresion with, using linear_regression_ver01.Rmd.
  2. Run the JAGS code for the pumps_ver01.Rmd.
  3. Do Exercise 9.1 chapter9_problems Hint: When running this code on Windows remove the saveName=fileRoot from the genMCMC and symMCMC function calls and it should run.
  4. Do Exercise 9.4 the code for this problem is at the bottom of the R Notebook.

Midterm:

(due in Blackboard Friday October 23, 2020)


Homework 6:

(due Monday October 12, 2020)

Do the following: Complete all of the problems in your R Notebook.

  1. Find a function of x and evaluate the area under the curve between two points, a and b, using random sampling. See the code below.
  2. Do Exercise 7.1 use BernMetrop.zip.

Code for Problem 1.

B <- 10000; a <- ????, b <- ???? # you need to specify a and b

x <- runif(B, a, b)

y <- ???? # apply the funtion to x

mean(y) * ( b - a )


Quiz Practice:

(due Monday October 5, 2020)

Do the following: Complete all of the problems in your R Notebook.

  1. What is a good probability model for observed 0, 1 data observed 100 times?
  2. What is the parameter of interest in the model?
  3. Name the likelihood function that represents the model.
  4. Name a conjugate prior distribution for the parameter of interest in the model?
  5. Name the posterior distribution for the parameter of interest given the data?

Homework 5:

(due Monday October 5, 2020)

Do the following: Complete all of the problems in your R Notebook.

  1. Run the R Notebook from the JagsExample.zip. Change the dbeta(1, 1) prior to a more informative prior, dbeta(4,4). Compare the Bayesian estimates of the parameter Theta and compare 95% HDIs (95% Bayesian credible intervals) using the two priors.

Homework 4:

(due Monday September 28, 2020)

Using an R Notebook produce your solutions to the following questions. Start by making an R Notebook with file name Lastname_Firstname_Stat481_hw4.Rmd. Then knit the .Rmd file to either Lastname_Firstname_Stat481_hw4.docx or preferably Lastname_Firstname_Stat481_hw4.pdf. Use your own last name and first name in the filename.

At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your R Notebooks should include

title: "Stat. 481 Homework 4"

author: "Your name"

date: "September 28, 2020"

Upload one file to Blackboard.

AND/OR If you are more comfortable write the solutions on paper by hand, then take a photo or scan your work and upload it to Blackboard.

Do the following: Complete all of the problems in your R Notebook.

  1. Do Exercise 6.1
  2. Do Exercise 6.2
  3. Do Exercise 6.5

Homework 3:

(due Monday September 21, 2020)

Using an R Notebook produce your solutions to the following questions. Start by making an R Notebook with file name Lastname_Firstname_Stat481_hw3.Rmd. Then knit the .Rmd file to either Lastname_Firstname_Stat481_hw3.docx or preferably Lastname_Firstname_Stat481_hw3.pdf. Use your own last name and first name in the filename.

At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your R Notebooks should include

title: "Stat. 481 Homework 3"

author: "Your name"

date: "September 21, 2020"

Upload one file to Blackboard.

AND/OR If you are more comfortable write the solutions on paper by hand, then take a photo or scan your work and upload it to Blackboard.

Do the following: Complete all of the problems in your R Notebook.

  1. Do Exercise 5.2
  2. Do Exercise 5.4

Homework 2:

(due Monday September 14, 2020)

Using an R Notebook produce your solutions to the following questions. Start by making an R Notebook with file name Lastname_Firstname_Stat481_hw2.Rmd. Then knit the .Rmd file to either Lastname_Firstname_Stat481_hw2.docx or preferably Lastname_Firstname_Stat481_hw2.pdf. Use your own last name and first name in the filename.

At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your R Notebooks should include

title: "Stat. 481 Homework 2"

author: "Your name"

date: "September 14, 2020"

Upload one file to Blackboard.

AND/OR If you are more comfortable write the solutions on paper by hand, then take a photo or scan your work and upload it to Blackboard.

Do the following: Complete all of the problems in your R Notebook.

  1. Do Exercise 4.3.
  2. From the Additional Exericises, from the Book website, complete problem Chapter 4, Hands-on experience approximating probability density from a large sample, as in Figures 4.2 and 4.3.
  3. Complete the following exercises. simplebayes.pdf

Homework 1:

(due Monday August 31, 2020)

Using an R Notebook produce your solutions to the following questions. Start by making an R Notebook with file name Lastname_Firstname_Stat481_hw1.Rmd. Then knit the .Rmd file to either Lastname_Firstname_Stat481_hw1.docx or preferably Lastname_Firstname_Stat481_hw1.pdf. Use your own last name and first name in the filename.

At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your R Notebooks should include

title: "Stat. 481 Homework 1"

author: "Your name"

date: "August 31, 2020"

Upload one file to Blackboard.

Do the following: Complete all of the problems in your R Notebook.

  1. Do Exercise 2.1
  2. Do Exercise 2.2
  3. Do Exercise 3.3
  4. Run the R programs prog1.R through prog6.R in separate R chunks in your R Notebook.