Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ME3255F2017/extra_credit/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
64 lines (44 sloc)
2.19 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extra Credit Assignment \#1 | |
## Due 9/15 by 11:59 pm | |
Go to Mathworks [Matlab Onramp](http://bit.ly/2q97vcS) and create an account. Complete | |
Part 10 - "Review Problems" (Project - Electricity Usage) and (Project - Audio Frequency). | |
Save your progress report and put it in a repository called 'ME3255-Extra_Credit'. | |
# Extra Credit Assignment \#2 | |
## Due 11/1 by 11:59 pm | |
Find a dartboard e.g. [Sports Bar](https://www.yelp.com/biz/the-sports-bar-north-windham). And tack the | |
following [polar_graph.pdf](./polar_graph.pdf) to the dartboard. Throw 10 darts (that hit | |
the board) and record the radius and angle that the dart hit the target in a csv file | |
in your 'ME3255-Extra_Credit' repository called `data.csv`. Organize the csv file in | |
columns with your netid on each row as such, | |
| user | radius (cm) | angle (deg) | | |
|---| --- | ---| | |
|rcc02007 | 1 | 30 | | |
|rcc02007 | ...| ... | | |
|rcc02007 | ...| ... | | |
# Extra Credit Assignment \#3 | |
## Due 11/17 by 11:59pm | |
**Nonlinear Regression - Logistic Regression** | |
[logistic regression of Challenger O-ring failure](http://www.stat.ufl.edu/~winner/cases/challenger.ppt) | |
Use the Temperature and failure data from the Challenger O-rings | |
[challenger_oring.csv](./challenger_oring.csv). Your independent variable is temperature and your dependent | |
variable is failure (1=fail, 0=pass). Create a function called `cost_logistic.m` that | |
takes the vector `a`, and independent variable `x` and dependent variable `y`. Use the | |
function, ![sigma](./equations/sigma.png) where ![t](./equations/t.png). Use the cost function, | |
![cost](./equations/cost.png) | |
and gradient | |
![costgrad](./equations/costgrad.png) | |
where ![x](./equations/x.png) is the k-th value of temperature raised to the i-th power (0, and 1) | |
a. edit `cost_logistic.m` so that the output is `[J,grad]` or [cost, gradient] | |
b. use the following code to solve for a0 and a1 | |
```matlab | |
% Set options for fminunc | |
options = optimset('GradObj', 'on', 'MaxIter', 400); | |
% Run fminunc to obtain the optimal theta | |
% This function will return theta and the cost | |
[theta, cost] = ... | |
fminunc(@(a)(costFunction(a, x, y)), initial_a, options); | |
``` | |
c. plot the data and the best-fit logistic regression model | |
```matlab | |
plot(x,y, x, sigma(a(1)+a(2)*x)) | |
``` | |