## Teaching, Spring 2017

### ACMS 20620: Applied Linear Algebra

#### Important dates:

• Midterm 1, Monday, Feb 20.
• Midterm 2, Monday, Mar 6.
• Midterm 3, Monday, Apr 10.
• Final, Thursday, May 11, 4:15--6:15pm.

#### Homework:

• Week 1, Due, Wednesday, Jan 25 :
• Week 2, Due, Wednesday, Feb 1 :
• Mon 1.23, Section 1.2, 2, 3(d,e,f), 5(e,f),9,10; Section 1.3, 4
• Wed 1.25, Section 1.3, 4, 6, 7; Section 1.4, 1, 3 (hint: use a certain linear system and its solutions)
• Fri 1.27, Section 1.4, 5, 7, 10(a--d); Section 1.5, 1, 4 (problem should be for finding matrix E instead of elementary matrix), 9 (Note (a) just requires verifying in stead of solving and comparing)
• Solution of HK 2
• Week 3, Due, Wednesday, Feb 8:
• Mon 1.30, Section 1.6, 1, 16; MATLAB task (in Sakai/Resources/Matlab code)
• Wed 2.1, Section 2.1, 2(a), 3(a,d)
• Fri 2.3, Section 2.1, 1, 5, 6, 7, 11(hint: Use examples if you refute the argument); Section 2.2, 1, 3(a--d), 4, 5, 6, 7; Section 2.3, 2(c)
• Solution of HK 3
• Week 4, Due, Wednesday, Feb 15:
• Week 5, Due, Wednesday, Feb 22:
• Mon 2.13, Section 3.2, 11(a--c)
• Wed 2.15, Section 3.3: 1(a--c), 2(a--c), 6
• Fri 2.17, None
• Solution of HK 5
• Week 6, Due, Wednesday, Mar 1:
• Mon 2.20, None
• Wed 2.22, Section 3.3, 8, 16
• Fri 2.24, Section 3.4, 3, 4, 5, 9
• Solution of HK 6
• Week 7, Due, Wednesday, Mar 8:
• Mon 2.27, Section 3.5, 1(a--b), 3, 4, 5, 6, 8; Section 3.6, 2, 4(a,d), 6, 15(a,b(i))
• Wed 3.1, Section 3.6, 1, 14, 17, 22, 24, 26; Section 4.1, 1, 3, 5
• Fri 3.3, None
• Solution of HK 7
• Week 8, Due, Wednesday, Mar 22:
• Mon 3.6, None
• Wed 3.8, MATLAB task: write a script to compute MATLAB Exercise 4 (a--c) (rank-1 updates of linear systems, page 166); Section 4.2, 2, 3, 4, 5
• Fri 3.10, Section 4.2, 6, 7, 8
• Solution of HK 8
• ##### Spring Break
• Week 10, Due, Wednesday, Mar 29:
• Mon 3.20, Section 4.3, 1, 2, 3, 4
• Wed 3.22, Section 5.1, 1(c--d), 2(c--d), 3(b--c), 4, 6, 18; MATLAB task: write a script and repot the results for MATLAB Exercise 1 (a--d) of Page 198.
• Fri 3.24, Section 5.1, 5, 8, 11, 12; Section 5.2, 2, 3, 4.
• Solution of HK 9
• Week 11, Due, Wednesday, Apr 5:
• Mon 3.27, Section 5.2, 1, 5, 6, 8, 9, 12
• Wed 3.29, Section 5.3, 1, 2, 3, 4, 5
• Fri 3.31, Section 5.3, 10 (a); Section 5.4, 1, 2, 7, 18
• Solution of HK 10
• Week 12, Due, Wednesday, Apr 12:
• Mon 4.3, Section 5.4, 3; Section 5.5, 1, 2, 3, 4. (Note: "orthonormal" means "othogonal" and "unit". {e1, e2, e3} forms an orthonormal basis.)
• Wed 4.5, Section 5.5, 5, 6, 7, 21(a)
• Fri 4.7, None
• Solution of HK 11
• Week 13, Due, Wednesday, Apr 19:
• Week 14, Due, Wednesday, Apr 26:
• Mon 4.17, None
• Wed 4.19, Section 5.5, 30, 32, 33, 34; Section 5.6, 1, 3, 7, 8
• Fri 4.21, Section 5.6, 13, 15 (the first part, and don't do the general theorem); Matlab Task, Page 283, problem 2; Section 6.1, 1(a-g), 2, 3
• Solution of HK 13
• Week 15, Due, Wednesday, May 3:
• Mon 4.24, Section 6.1, 4, 7, 8; Section 6.3, 1(a-d), 2(do 1(a-d)), 3(do 1(a-d)), 6
• Wed 4.26, Section 6.3, 11 (hint for a: conjugate of lambda1 is an eigenvalue as well, and it has its own eigenvector, then use Theorem 6.3.1), 16, 22, 23
• Fri 4.28, Section 6.2, 1(a-d), 2(a, b), 3, 4; Matlab task: numerical solution of ODE: ODE45
• Solution of HK 14

### ACMS 30600 Stat Methods & Data Analysis

#### Important dates:

• Midterm 1, Friday, Feb 24.
• Midterm 2, Wednesday, Apr 12.
• Final, Friday, May 12, 8:00--10:00am.

#### Homework:

• Homework 1, Due, Monday, Feb 6:
• Wed 1.18, Chapter 1, 1.4, 1.8, 1.13
• Fri 1.20, Chapter 1, 1.22(a,c,d), 1.29, 1.33
• Wed 1.25, Chapter 1, 1.46(a, c), 1.48(a, b, c)
• Fri 1.27, Chapter 1, 1.56(a, b, c, e, f)
• Mon 1.30, Chapter 1, 1.66(a)
• Wed 2.1, Chapter 1, 1.70 ( VOLTAGE data, the variable LOCATION consists of 1's and 0's, where 1=new, 0=old), R implementation: WSR test (write a report for your answer in a document, and paste your code at the end of the report.)
• Fri 2.3, Chapter 3, for data of 3.31 (pain empathy and brain activity), report coefficients and give a practical interpretation of both; Compute and interpret s, the estimated standard error of the regression model (hint: you can read from report of linear regression).
• Solution of HK 1
• Homework 2, Due, Monday, Feb 20:
• Mon 2.6, Chapter 3, for data of 3.31, compute 95% CI of beta_1 (you may use information from report of linear regression)
• Wed 2.8, Chapter 3, (1) how does the CI you calculated for beta_1 relate to the p-value for estimated beta_1 reported in the computer output? (2)Report and interpret the coefficient of determination for the model, and coefficient of correlation for the data.
• Fri 2.10, Chapter 3, (1) For the data of 3.31, obtain from R or SAS and interpret a 95% confidence interval for the mean value of y for x=17; obtain from R or SAS and interpret 95% prediction interval for the mean value of y for x=17; R implementation: Bootstrap C. I. (write a report for your answer in a document, and paste your code at the end of the report.)
• Mon 2.13, the file savings.txt contains averages from 1960 to 1970 of several economic indicators for 50 different countries: dpi is per capita disposable income in US dollars; ddpi is the percentage rate of change in per capita disposable income; sr is aggregate personal savings divided by disposable income; pop15 and pop75 are the percentages of the population under age 15 and over 75, respectively. Using R, fit a multiple regression model with y=sr and the other four variables as predictors. Report and interpret the p-value for the Model Utility F-test.
• Wed 2.15, following the Saving data, (1) report the individual tests for each coefficient; (2) compute the 95% C.I.'s for each coefficient and paste your R-code; (3) compute the variance-covariance matrix of coefficients and paste your R-code (hint: For 2, 3, sample code for Mileage data posted in Sakai: Resources/CodeInClass will be helpful)
• Fri 2.17, None
• Solution of HK 2
• Homework 3, Due, Monday, Mar 6:
• Mon 2.20, None
• Wed 2.22, None
• Fri 2.24, (Saving data continued) test the hypothesis: the null H_0: beta_pop15 = beta_pop75=0 vs Ha: at least one of these not 0. Paste the R command used, state the p-value, state your conclusion (i.e., reject the null or not), and state whether this means pop15 and pop75 can be removed from the model; Compute the correlation matrix for the predictor variables(Paste the R command you used to do this, and report the correlation matrix you get). Which two predictors are most highly correlated?
• Mon 2.27, fit a model with interaction term of dpi and ddpi, report the individual test of it, and interpretate this interaction term in the model.
• Wed 3.1, (1) perform variable selection using the stepAIC() function. What is the optimal model selected by this method? (2) Comment on the change in the Rsquare and the adjusted Rsquare for the model recommended in (1) vs. the original model with all four predictors. (3) In general, can Rsquare and adjusted Rsquare ever be equal for a given model? If so, in what situation are they the same?
• Fri 3.3, None
• Solution of HK 3
• Homework 4, Due, Monday, Mar 27:
• Mon 3.6, for the saving data, compute the variance inflation factor (VIF) for pop75. Paste the R commands you used to do this (about 2 lines of code should be enough). Assuming this is the largest VIF for any of the predictors, would you conclude there is significant multicollinearity present in the model?
• Wed 3.8,PCA regression on the data file UNYEAR1997.txt . Answer questions in PCAtask.
• Fri 3.10, DW statistic computation using data LIFEINS.txt . Following the instructions and answer questions in DW . You don't exactly implement the test, but just compute the DW STAT.
• ##### Spring break
• Mon 3.20, statistical inference on a contigency table: SES_Delinquent .
• Wen 3.22, fit a logistic regression for the SES data, and interprete the coefficients. Delinquent status is the response.
• Fri 3.24, fit a multiple logistic reg. model for Titanic grouped data in a table in Titanic , and answer the questions.
• Solution of HK 4
• Homework 5, Due, Monday, Apr 10:
• Mon 3.27, [Taken from Faraway (2006)] the National Institute of Diabetes and Digestive Kidney Diseases conducted a study on 768 adult female Pima Native Americans living near Pheonix. The purpose of the study was to investigate factors related to diabetes. The data PIMA contains the variables pregnant=number of times pregnant, Glucose=plasma glucose concentration at 2 hours in an oral glucose tolerance test, diastolic=diastolic blood pressure (mm Hg), triceps=triceps skin fold thickness (mm), insulin=2-hour serum insulin (mu U/ml), bmi=Body mass index (weight in kg/(height in meters squared)), diabetes=diabetes pedigree function, age=age (years), test=test whether the patient shows signs of diabetes (coded 0 if negative, 1 if positive). (1) Fit a logistic regression model to the above data in R with test as the response variable and all other variables as predictors. Paste the code you used to do this. (2)Is this response variable binary or binomial? Explain.
• Wed 3.29, following the PIMA data, (3) fit six reduced models, i.e., six different models each containing a different subset of predictors used in the full model in (1). You can just use your intuition to choose the reduced models; everybody’s can be different. Then, use the AIC to decide which is the optimal reduced model and report the AIC's; (4) Are there any influential observations in your chosen model? Explain.
• Fri 3.31, (5) Make a receiver operating characteristic (ROC) curve to summarize the predictive power of the variables in the data set to predict the test variable. Use the full model fit in (1). Paste below a plot of the ROC curve and also the code you used. You can use the ROCR package, but you should still understand how to construct it “by hand”; (6) What does the shape of the ROC curve constructed in (5) suggest about how well the variables predict whether the patients will show signs of diabetes? (7) What does the ROC curve analysis reveal to be the optimal probability threshold pi_0 for predicting whether patients will show signs of diabetes? You may probe the optimal pi_0, and compare the result of your predicted response with your true response.
• Mon 4.3, None.
• Wed 4.5, the file Debt contains the data set debt, which consists of the variables ccarduse=how often the subject uses a credit card (1=never, 2=sometimes, 3=regularly), cigbuy=whether the subject buys cigarettes (1=yes, 0=no), bankacc=whether the subject has a bank account (1=yes, 0=no), and prodebt=the respondent’s score on a scale of attitudes toward debt, where higher values are more favorable toward having debt. Write up a PO model with ccarduse as an ordinal response by using the other three variables as predictors using appropriate notations.
• Fri 4.7, (a) fit a proportional odds model with ccarduse as an ordinal response using the other three variables as predictors; (2) Give an intuitive explanation of the slope parameter estimates for all three predictors; (3) Compute the predicted probability that a subject never uses her credit card, given that she has her own bank account, does not buy cigarettes, and has an attitude score of 1.50.
• Solution of HK 5
• Homework 6, Due, Monday, May 1:
• Mon 4.10, None
• Wed 4.12, None
• Wed 4.19, log linear model fit for data Cold-Vitamin
• Fri 4.21, implement a chi-square test to determine whether the 2 way interation term should be included in the log linear model for Cold-Vitamin data; Find the certain association of the data Berkeley Admission .
• Mon 4.24, 10.4 Opec crude oil imports (a) (Chapter 10, Regression Analysis text book)
• Wed 4.26, 10.4 (b, c), report the first four values, respectively
• Fri 4.28, do problems in Timeseries
• Solution of HK 6
• ##### Course project, Due Wednesday, May 3, 5:00pm
You are required to submit a report. Here is the direction: Data project .

### ACMS 40390 Numerical Analysis

#### Important dates:

• Midterm 1, Wednesday, Feb 22.
• Midterm 2, Wednesday, Mar 22.
• Final, Thursday, May 11, 8:00--10:00am.

#### Homework:

• Homework 1, Due, Wednesday, Jan 25:
• Homework 2, Due, Wednesday, Feb 1:
• Mon 1.23, Section 1.1, 21; Section 1.2, 3(c), 6(d), 19(b), 26 (hint: assume the data are rounded values accurate to the places given)
• Wed 1.25, Section 1.2, 15(d), 21, 25; Supplemented problem: Use three-digit chopping arithmetic to compute the following sums: (1+1/8+1/27), (1/27 + 1/8 + 1). Point out which way is more accurate, and the reason.
• Fri 1.27, Section 1.3, 6(a,b)(hint: Note sin(x)<=x as x>=0), 7(a, b) (Taylor expansions around h0=0)
• Solution of HK 2
• Homework 3, Due, Wednesday, Feb 8:
• Mon 1.30, Section 2.1, 1, 7(a, b)(in b, just compute p3); Computation task: Use bisection to compute the root of x/2=sin(x) on [1.5, 2.5]. Use more than 7 iterations, and report outcomes in each steps. (sample code is in Sakai/Resources/Codes/MATLAB: it first sketch the graph of the function, then use bisections to locate the root.)
• Wed 2.1, Section 2.1, 12(a,d), 18(Modify this problem as follows: Use Thm 2.1 to find a bound for the number of iterations needed to achieve an approximation with absolute error within 10^-3 to the solution of x^3 + x-4 = 0 lying in the interval [1,4]); Section 2.2, 10 (Modify it as follows: Use Thm 2.3 to show that g(x) = 2^-x has a unique fixed point on [1/3, 1]. Use fixed-point iteration to find p_3 approximation to the fixed point. Choose p_0 = 1.)
• Fri 2.3, Section 2.2, 8(revised as follows: report p_1, p_2, p_3); Section 2.3, 2.
• Solution of HK 3
• Homework 4, Due, Wednesday, Feb 15:
• Mon 2.6, Section 2.3, 8(Use secant method to compute p_2, p_3 for 6(b)); Section 2.4, 6(a)
• Wed 2.8, Section 2.4, 7(a,b)
• Fri 2.10, Section 2.4, 4 (modified as follows: Use the modified Newton's method to solve 2c. Let p0 = 3.5. Compute p_1 and p_2.)
• Solution of HK 4
• Homework 5, Due, Wednesday, Feb 22:
• Mon 2.13, Section 3.1: 6(d) (Using Lagrange interpolating polynomial of degree three to approximate f(0.25); hint: All points are used for interpolation), 6(c) (Using Lagrange interpolating polynomial of degree two to approximate f(0.18)), 14(d), 17 (Determine a bound for the step size for this table.)
• Wed 2.15, Section 3.3, 2(a) (Modified as follows: Using the divided difference approach to construct interpolating polynomial of degree three to approximate f(0.43)), 14
• Fri 2.17, Section 3.3, 16; Section 3.4, 1(c) (Modified as follows: use Theorem 3.9 to construct Hermite interpolating polynomial), 2(c) (Modified as followsL: use divided differences to construct Hermite interpolating polynomial)
• Solution of HK 5
• ##### Computation project 1, Due, Wednesday, Mar 1
Implement the Newton's method to solve the lambda in Problem 2.3.22 in the following steps:
• Rewrite the given equation of the problem as f(lambda) = 0 for solving for lambda
• Calculate derivative of f(lambda)
• Use the base code of MATLAB or C++ to start
• Draw a graph of f(lambda) in MATLAB
• Modify the function in the code to evaluate the problem function f(lambda)
• Modify the function of the code to evaluate derivative of f(lambda)
• Use relative error |p_n - p_n-1|/|pn|< 10^-4 as the criterion to stop iteration
• Report the last lambda and iteration steps needed. Write up a report with plots, outcome, necessary descriptions, and codes
• Homework 6, Due, Wednesday, Mar 1:
• Mon 2.20, None
• Wed 2.22, None
• Fri 2.24, Section 3.5, 4(a, c)(For c, Using steps outlined on page 10 of the notes to construct natural cubic spline.), 6(a); Computation project 1.
• Solution of HK 6
• Homework 7, Due, Wednesday, Mar 8:
• Mon 2.27, Section 3.5, 12(Hint: First use at x=2, s_0(x) = s_1(x), s'_0(x) = s'_1(x) and s''_0(x) = s''_1(x) to solve B, D, b. Then use natural BC to solve d at x = 3)
• Wed 3.1, Section 4.1, 6, 13, 20
• Fri 3.3, Section 4.3, 2(a), 4(find error bound for exercise 2(a)), 6(use Simpson's (1/3) rule to evaluate 2(b)), 8(find error bound for Simpson's (1/3) rule for 2(b)).
• Solution of HK 7
• Homework 8, Due, Wednesday, Mar 22:
• Mon 3.6, Section 4.3, 17 (using Closed and Open Newton-Cotes formulas), 19; Section 4.4, 1(b), 3(use composite Simpson's rule to approximate 1(d)
• Wed 3.8, Section 4.4, 6(use composite Midpoint rule to approximate 2(a)), 12
• Fri 3.10, None
• Solution of HK 8
• ##### Spring Break
• Homework 9, Due, Wednesday, Mar 29:
• Mon 3.20, None
• Wed 3.22, None
• Fri 3.24, Section 4.7, 6 (compute 2(a))
• Solution of HK 9
• ##### Computation project 2, Due, Wednesday, Apr 5
Use Lagrange's interpolating polynomials to observe Runge's phenomena in the following steps:
• Clarify what Runge's phenomena is briefly. You may google it, or look it up in wikipedia.
• For concrete example f(x)=1/(1+25x^2) on [-1, 1] (an example in wiki), apply Lagrange interpolating MATLAB codes in class, such as lagrange2(xi,fi).
• You may generate the nodes with step size h=0.1, and h=0.01.
• Draw graph of interpolating polynomial with the original f in MATLAB for comparison. You will have two graphs according to different two h's.
• Describe what you observe. Write a report with plots, appended with the code.
• Homework 10, Due, Wednesday, Apr 5:
• Mon 3.27, Section 5.2, 2(c), 4(Find the absolute error at each step for exercise 2(c)).
• Wed 3.29, Section 5.2, 3(c); Section 5.3, 2(a), 4(Solve 2(a) by using Taylor method of order four), 9.b.ii (The Taylor method of order two gives: at t_5 = 1.5, w_5 = 4.902607; at t_6 = 1.6, w_6 = 6.737714).
• Fri 3.31, Section 5.4, 2(a), 6(do ex 2(b)) (You can write a script using our codes for computation).
• Solution of HK 10
• Homework 11, Due, Wednesday, Apr 12:
• Mon 4.3, Section 5.4, 13 (do ex 1b)
• Wed 4.5, Section 5.6, 2(a)( Use Adams-Bashforth 2-step explicit method to compute w2, w3 at time points 1.2 and 1.3, respectively. Use the actual solution to get starting value w1), 2(b)(Use Adams-Bashforth 4-step explicit method to compute w4, w5 at time points 0.4 and 0.5, respectively. Use the actual solution to get starting values w1, w2, and w3), 5(Use Adams-Moulton 2-step implicit method to solve exercise 1(a) by computing w2, w3 at time points 0.4 and 0.6, respectively. Use the actual solution to get starting value w1)
• Fri 4.7, Section 5.10, (1) show that midpoint Runge-Kutta method is consistent and stable; (2) how about the 4-step Runge-Kutta method?
• Solution of HK 11
• ##### Computation project 3, Due, Wednesday, Apr 19
Computing ODE system using RK 4 method:
• Implement a computation for assignment Chemical reaction. Sample code for an ODE system called ODEsystem_RK2.m is in Sakai
• If you still can't observe the phenomena, you may try beta's in [2, 4]
• Write a report with what you observe and code, and submit with homework
• Homework 12, Due, Wednesday, Apr 19:
• Mon 4.10, Section 5.10, find the stability of the multistep method in Exercise 4(b). Use the method to solve y' =0, y(0) = 0 by finding w_2, ..., w_6. Let w0 =0, and w1 = \epsilon, where \epsilon represents a small rounding error introduced by computer.
• Wed 4.12, Section 5.11, 1(a), 2(a), 10 (You can solve 1a, 2a, numerically and plot graphs)
• Fri 4.14, None
• Solution of HK 12
• Homework 13, Due, Wednesday, Apr 26:
• Mon 4.17, None
• Wed 4.19, Section 5.11, 12 (Solve 1(a), and you may solve numerically and plot the solution); Section 6.1, 6 (c, d)
• Fri 4.21, Section 6.2, 14 (do 10b). Hint: result of every arithmetic operation needs to be rounded to 3 digits.
• Solution of HK 13
• Suggested exercises, for rest of the semester:
• ##### Final Exam: Thursday, May 11 8:00 AM - 10:00 AM, 229 Hayes-Healy Center

last updated: May 6, 2017