解析C/C++编程|辅导R语言编程|讲解数据库SQL|辅导R语言编程

- 首页 >> Database作业
Applied Modeling and Optimization
Exam 2
Answer all the questions clearly showing all the steps and assumptions. A maximum of 3 students per
group allowed. Do not discuss across groups. Upload all your answers (software code with basic
documentation, plots, numerical answers, etc.) on Canvas. Only one submission per group required.
Enjoy solving these problems!
1. Solve the following using steepest descent algorithm. Start with 𝑥𝑥0 = [1 1]
𝑇𝑇 and use stopping
threshold ∈= 10−6.
(a) Verify that the final solution satisfies the second order necessary conditions for a minimum.
(b) Plot the value of the objective function with respect to the number of iterations and
(c) Comment on the convergence speed of the algorithm.
2. Consider the problem: 𝑚𝑚𝑚𝑚𝑚𝑚 𝑓𝑓(𝑥𝑥) 𝑠𝑠.𝑡𝑡. ℎ(𝑥𝑥) ≥ 0 where 𝑓𝑓(𝑥𝑥) = (𝑥𝑥1 − 1)2 + 2(𝑥𝑥2 − 2)2 and
ℎ(𝑥𝑥) = [1 − 𝑥𝑥1
2 − 𝑥𝑥2
2 , 𝑥𝑥1 + 𝑥𝑥2]
𝑇𝑇.
(a) Plot the contour of f(x) and the feasible set on one single figure, i.e., overlay the feasible set
on the contour plot of f(x);
(b) Find a solution to the problem using the natural logarithmic barrier function, i.e., the barrier
function is -log(h1(𝑥𝑥)) - log(h2(𝑥𝑥)). Use initialization vector [0.5 0.5]T and the initial penalty
parameter equal to 1 and reduce it by ½ in each iteration. Use a stopping threshold of 0.002;
(c) In a 2-D figure, plot the trajectory (i.e., the values connected by lines with arrows) of the
computed solution vector as the number of iteration progresses.
3. Collect the stock price for Tesla (NASDAQ: TSLA) for the past 30 days.
(a) Plot the data (date vs. stock price)
(b) Implement the stochastic gradient descent algorithm to fit a linear regression model for this
data set. Use any required open source libraries. Note that this specific algorithm was not
discussed in the class, but all the key ingredients have been covered. So, you must be able to
understand how this works.
(c) Plot the raw data and your linear regression model together for visual comparison.
(d) What does your model predict for Tesla’s stock price for the next three months into the
future?
(e) Explain the pros and cons of gradient descent and stochastic gradient descent.

站长地图