



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
ITS ABOUT AYESIAN INFERENCE USING R, A PRACTICE ON CODING USING R STUDIO, SO THAT YOU CAN FIND THE INFERENCE, USING THESE SOFTWARE, YOU CAN EASILY IDENTIFY THE RELATIONSHIP OF THE VARIABLES
Typology: Exercises
1 / 7
This page cannot be seen from the preview
Don't miss anything!




1: Coin Toss Posterior A coin is tossed 12 times and 8 heads are observed. Prior distribution: Beta(2,2). Find the posterior distribution. R code: alpha <- 2 beta <- 2 heads <- 8 tails <- 4 posterior_alpha <- alpha + heads posterior_beta <- beta + tails posterior_alpha posterior_beta
alpha <- 2+ beta <- 2+ Step 5: Plot Posterior curve(dbeta(x,9,5), from=0,to=1, main="Posterior Distribution", col="red") Step 6: Generate Posterior Samples samples <- rbeta(10000,9,5) hist(samples)