Elaborate on the details of the R program in Example 11.6.1. Data from in Example 11.6.1 The
Question:
Elaborate on the details of the R program in Example 11.6.1.
Data from in Example 11.6.1
The prior probability prior_weights is extended over a prior grid as required in this approach. A very elementary function getc helps in this task along with the sapply function. The likelihood function is computed in the usual way. The posterior_grid as given in the program accomplishes the third step of the approach, while the sample function in the final step is obtained.
Transcribed Image Text:
> p < seq (0, 1, length=100) > X <- 11; n <- 27 > lower_limit <- seq (0,0.9,0.1); upper_limit <- seq (0.1, 1,0.1) > prior_intervals <- cbind (lower_limit, upper_limit) > prior_weights <- c(1, 5.2, 8, 7.2, 4.6, 2.1, 0.7, 0.1, 0, 0) > names (prior_weights) <- paste (prior_intervals [, 1], "-", + prior_intervals [, 2], sep="") > prior_interval_weights <- prior_weights/sum (prior_weights) > getc <- function (a,b,c) c [a>= b[,1] & a<=b[, 2]] > p_prior <- unlist (sapply (p, getc, b=prior_intervals, + c-prior_interval_weights)) > likelihood <- p^x* (1-p) ^ (n-x) > posterior_grid <- p_prior* likelihood > posterior_grid <- posterior_grid/sum (posterior_grid) > posterior_sample <- sample (p, size=500, replace=TRUE, + prob=posterior_grid) > par (mfrow=c (1,2)) > barplot (prior_weights, main="Histogram Prior",xlab="p") > hist (posterior_sample, main="Posterior Distribution",xlab="p")
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 55% (9 reviews)
The R program in Example 1161 is a simple implementation of the grid approach to Bayesian com...View the full answer
Answered By
Justin Akengo
I am writing in application for the tutor position with your organisation. I am experienced in tutoring students of all abilities and I believe I am the ideal candidate for this position.
I work with students of all ages, from elementary school to college level. Whether the subject is science, Mathematics or basic study skills, I break material down into easy-to-understand concepts. In your job posting, you asked for someone who can tutor in a variety of subjects. I am comfortable explaining calculus to a college student or working with a kindergartener on spelling fundamentals.
Below are just a few core skills and qualifications I posses as a tutor;
Adept at creating study materials in a variety of academic subjects to help students improve their test scores and GPAs.
Strong interpersonal skills in working with students to help them achieve and succeed.
Have written study books adopted by a high school and a college to help students improve their skills in English and mathematics.
Have won several “Tutor of the Year” awards for work with high school and college students.
0.00
0 Reviews
10+ Question Solved
Related Book For
A Course In Statistics With R
ISBN: 9781119152729
1st Edition
Authors: Prabhanjan N. Tattar, Suresh Ramaiah, B. G. Manjunath
Question Posted:
Students also viewed these Business questions
-
The terms prior and posterior are relative. Assume that the drug test has been performed, and the outcome is positive, which leads to the posterior probabilities in row 20 of Figure 6.28. Now assume...
-
A sample of weights (g) of M&Ms is obtained from those listed in Data Set 20 from Appendix B: 0.864, 0.825, 0.855, 0.942, 0.825, 0.869, 0.912, 0.887, 0.886. Use the data from the indicated exercise...
-
The iris data described in Example 6 are given in the stem-and-leaf diagrams below. The MINITAB output for the analysis of the iris data is given below. Individual 95% CIs For Mean Based on Pooled...
-
For problems involving composite bodies composed of two or more materials, the elasticity solution requires both boundary conditions and interface conditions between each material system. The...
-
The annual per capita sugar consumptions (in kilograms) and the average numbers of cavities of 11- and 12-year-old children in seven countries (a) Display the data in a scatter plot, (b) Calculate...
-
The contents of the stirred-tank heating system shown In figure are heated at a constant rate of Q(Btu/h) using a gas-fired heater. The flow rate w(lb/h) and volume V(ft3) are constant, but the heat...
-
Sony owed Estimated Warranty Payable of \($1,000\) at the end of 2009. During 2010, Sony made sales of \($100,000\) and expects product warranties to cost the company 3% of the sales. During 2010,...
-
Pike Seafood Company purchases lobsters and processes them into tails and flakes. It sells the lobster tails for $20 per pound and the flakes for $15 per pound. On average, 100 pounds of lobster are...
-
Please recount (list) Tim and Brad's strengths and weaknesses in running/managing/starting a company. What other skills/competencies should Tim and Brad consider adding to their team? Given Tim's and...
-
Suppose there are two types of folks in the world - Slackers and Overachievers. Overachievers are, by nature, more productive than Slackers. However, employers cannot distinguish between these types...
-
Simulate 1000 observations from the standard normal distribution using AR_Normal function and then obtain the histogram with the option freq=FALSE (why?). Add the normal curve, try curve with...
-
Using the p.as.plot function from Convergence Concepts, study the convergence in probability and almost sure convergence limit theorems.
-
In the context of the passage, the tone in lines 5266 can best be described as: F. Affectionate. G. Humorous. H. Somber. J. Informational.
-
Mackey purchased a used van for use in its business on January 1, 2020. It paid $15,000 for the van. Mackey expects the van to have a useful life of four years, with an estimated residual value...
-
Crane Corp. had a Deferred Tax Asset account with a balance of $102,300 at the end of 2022 due to a single temporary difference of $341,000 related to warranty liability accruals. At the end of 2023,...
-
Determine the composite function fog and gof. For each composite function state the domain and range. a) f(x) = 2+3x-x and g(x) = 3-x b) f(x)=4 and g(x) = log 2x c) f(x) = cos x and g(x) = 2x - 1 d)...
-
Write a C++ program called Lab3A.cpp that reads input from the keyboard and prints output to the screen using cin and cout, respectively. Specifically, you are to write a C++ program that does the...
-
Programming Assignment 1 Socket programming: Using TCP connection Use C Language. Launch two virtual machines, and execute client on one and server on the other. The client (tcpClient.c) would...
-
In each case verily that PD b is the inverse of PB D and that PE DPD B = PE B, where B, D, and E are ordered bases of V. (a) K = R3, fl = {(l, 1, 1), (1, -2, 1), (1, 0, -1)), D = standard basis,...
-
Repeat Exercise 16.6 using the t-test of the coefficient of correlation. Is this result identical to the one you produced in Exercise 16.6?
-
As the director of the multistate tax planning department of a consulting firm, you are developing a brochure to highlight the services it can provide. Part of the brochure is a list of five or so...
-
Castle Corporation conducts business in States 1, 2, and 3. Castle's $630,000 taxable income consists of $555,000 apportionable income and $75,000 allocable income generated from transactions...
-
Complete the following chart by indicating whether each item is true or false. Explain your answers by referencing the overlap of rules appearing in Federal and most state income tax laws. True or...
-
discuss the implications of mortgage rate pass-through dynamics on the behavior of mortgage-backed securities prices in response to changes in benchmark interest rates, including the factors...
-
Bill and Sue both make shirts and shoes. Bill can make 2 shirts in an hour and Sue can make 6 shirts in an hour. Bill can make 3 pairs of shoes in an hour and Sue can make 4 pairs of shoes in an...
-
As a manager and an entrepreneur, you will face a new challenge - business venture structured on the theory of the firm. You are opening a restaurant in your selected town in the State of NY (please...
Study smarter with the SolutionInn App