Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise covariates x 1 and x 2 are simulated as 1 x 1 = rand ( 1 , 4 0 ) ; x

In this exercise covariates x1 and x2 are simulated as1
x1= rand(1,40); x2= floor(10* rand(1,40))+1;
and the response variable y is obtained as
y =2+6* x1-0.5* x2+0.8*randn(size(x1));
Write a program using a Probabilistic Programming Language (PPL), like BUGS or
PyMC, that takes 20 triples (x1, x2, y) to train the linear regression model y = b0+b1x1+b2x2
and then uses the remaining 20 triples to evaluate the model by comparing the original
responses yi, i =21,...,40, with regression-predicted values yi, i =21,...,40.
The comparison would involve calculating the MSE, the mean of (yi yi)2, i =21,...,40.
This is an example of how to implement a basic train/test split to test a Bayesian inference
models predictive accuracy. How do the Bayesian estimators of \beta 0,\beta 1,\beta 2, and \sigma compare
to the true values 2,6,0.5, and 0.8?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

=+V1. Do you believe VW has a cohesive, global strategy?

Answered: 1 week ago