Description
1. (Bonus Credit: 2pt) Write your own functions to use LOO-CV and GCV to select the optimal span for loess. Check [Coding3 BonusCredit.html] on Piazza.
• Test your code on data set Coding3 Bonus Data.csv, which can be downloaded from Piazza.
• Report your CV and GCV for 15 span values: 0.20, 0.25, …, 0.90.
What you need to submit?
A PDF file (maximum two-page) and the R/Python code that produces the
PDF file. Your code will be run in a directory that has the file Coding3 Bonus Data.csv.
• The PDF file should contain the 15 values for LOO-CV and 15 values for GCV.
• In [Coding3 BonusCredit.html], I include some figures, but you do not have to include them in your PDF file. The essential part of your PDF file are the LOO-CV and GCV values.
• Students are allowed to use R/Python code to generate Markdown file in PDF. Since the file size is restricted to be two pages, suggest to hide your code and only display the results.
• Name your R/Python file (Rmd files are allowed) starting with
For example, the submission for Max Y. Chen with UID 672757127 and netID mychen12 would be named
Assignment 3 Bonus 7127 mychen12 MaxChen.R.
You can add whatever characters after your netID.
• Name the PDF file (submitted along with your code) similarly, starting with
AssignmentOutput 3 Bonus xxxx netID…pdf,
2. (3pt) Implement the Baum-Welch algorithm and the Viterbi algorithm for a hidden Markov model (HMM) with Two hidden states (A or B) and whose outcome is a discrete random variable taking Three unique values. Check [Coding3 HMM.html] on Piazza.
• Test your code on data set Coding3 HMM Data.csv, which can be downloaded from Piazza, with number of iterations for EM to be 100.
• Report the output from your Baum-Welch algorithm, and save your output from your Viterbi algorithm.
What you need to submit?
A PDF file (maximum two-page) and the R/Python code that produces the
PDF file. Your code will be run in a directory that has the file Coding3 HMM Data.csv.
• Report the estimated transition matrix A2×2 and emission matrix B2×3 from your Baum-Welch algorithm with 100 iterations in the PDF file.
• Save the output, a sequence of length 500 taking values either ”A” or ”B”, from your Viterbi algorithm in a file named Coding3 HMM Viterbi Output.txt. Then we will compare your result with the sequence from Coding3 HMM True Viterbi Output.txt.
• Students are allowed to use R/Python code to generate Markdown file in PDF. Since the file size is restricted to be two pages, suggest to hide your code and only display the results.
• Name your R/Python file (Rmd files are allowed) starting with
For example, the submission for Max Y. Chen with UID 672757127 and netID mychen12 would be named
Assignment 3 HMM 7127 mychen12 MaxChen.R.
You can add whatever characters after your netID.
• Name the PDF file (submitted along with your code) similarly, starting with
AssignmentOutput 3 HMM xxxx netID…pdf,
2




Reviews
There are no reviews yet.