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...
-
Fireworks manufacturers face a dilemma. They must be sure that the rockets work properly, but test-firing a rocket essentially destroys it. On the other hand, not testing the product leaves open the...
-
Identify the relative advantages and disadvantages of probability-proportional-tosize sampling.
-
McCool Corporation wholesales repair products to equipment manufacturers. On April 1, 2010, McCool Corporation issued $30,000,000 of five-year, 10% bonds at a market (effective) interest rate of 8%,...
-
What are Drawings? Write a note of 200-300 words .
-
a. Decipher the message YITJP GWJOW FAQTQ XCSMA ETSQU SQAPU (5 SOGKC POTYJ using the Hill cipher with the inverse key (;). calculations and the result. b. Decipher the message MWALO LIAIW WTGBH JNTAK...
-
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.
-
Following are the unit costs of making and selling a single product at a normal level of 5,000 units per month and a current unit selling price of $90: Manufacturing costs Direct materials . $35...
-
What are class diagram and object diagram?
-
List down the steps in identifying and developing a class diagram for a given application domain.
-
How do we achieve generalization and specialization?
-
The second of the two steps in building the sequence diagram is to (a) define how the system uses the problem domain resources (b) define how the actor uses the system resources (c) define how the...
-
Suppose that you are designing a computer-based system that plays a multiplayer game online. Which UML diagrams you will choose to design the system? Why?
-
What is a species? What types of observations do researchers analyze when trying to identify species?
-
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...
-
Iguana, Incorporated, manufactures bamboo picture frames that sell for $25 each. Each frame requires 4 linear feet of bamboo, which costs $2.00 per foot. Each frame takes approximately 30 minutes to...
-
Why does the government intervene in the economy? Explain two ways the government seeks to direct the economy in a mixed economic system like the United States. How can ordinary citizens influence...
-
What strategies do businesses have in place that promote equal opportunity within the organization? Do most businesses offer career development and training to its employees? If so, why? How do...
Study smarter with the SolutionInn App