[SOLVED] ME8813 Homework 1

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW1-yr2sm3.zip (281.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
๐Ÿ”’ Securely Powered by:
Secure Checkout
Rate this product

A simple python file regr_data.py is given, where a small dataset ๐‘ฅ , ๐‘ฆ is generated for regression. Implement the quasi-Newton optimization method, Davidon-Fletcher-Powell Method, to perform the data fitting process. The model to be fitted is:

๐‘Œ ๐‘ ๐‘ cos 2๐œ‹๐‘ฅย ย ย ย ย ย ย ย ย ย ย ย ย  ๐‘ cos 4๐œ‹๐‘ฅย ย ย ย ย ย ย ย  ๐‘ cos 6๐œ‹๐‘ฅ

 

Your implementation of the optimization method should be included in a function p=DFP_fit(x,y,epsilon) where x and y are the vectors of training data corresponding to the input and output of the model, and epsilon is the error threshold users can specify for the stopping criteria. You can choose to implement any of the stopping criteria discussed in the lecture. The function should return the fitted parameters p = [p0, p1, p2, p3].

 

Plot the predictions from your fitted model right below the original data as the comparison.

 

As the hint, the loss function or objective function to be minimized is:

_

๐ฟ ๐‘ , ๐‘ , ๐‘ , ๐‘ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย  ๐‘ ๐‘ cos 2๐œ‹๐‘ฅ ๐‘ cos 4๐œ‹๐‘ฅ ๐‘ cos 6๐œ‹๐‘ฅ ๐‘ฆ

The search space for the optimization is 4-dimensional as (p0, p1, p2, p3). The gradient function โˆ‡L as the first derivative respect to pโ€™s can be derived analytically and hard coded.

 

 

  • HW1-yr2sm3.zip