Edit or run this notebook

HW 3 for CS 4220

You may (and probably should) talk about problems with the each other, with the TAs, and with me, providing attribution for any good ideas you might get. Your final write-up should be your own.

202 μs
258 μs
55.3 ms

1: Artificial inference

In the code block below, we create an artificial data set for a linear function on the unit square in R2:

f(x,y)=c1+c2x+c3y

Based on noisy measurements bi=f(xi,yi)+ϵi, we want to use least squares to find an estimator c^ for the underlying c. Fill in the TODO line to do this least squares computation.

230 μs
0.1732050807568878
71.8 μs

2: Retargeting Reflections

Given a nonzero vector xRn and a target unit vector u, find a unit vector v such that

(I2vvT)x=σu

178 μs
householder (generic function with 1 method)
278 μs
test_householder (generic function with 1 method)
602 μs
1.4953224590177732
1.4 ms

3: Continuous least squares

For a general inner product, the normal equations for finding the closest point pV to a target f is

q,pf=0, for all qV.

Use this approach to find the cubic polynomial p(x)=αx+βx3 that minimizes

psin()22=11(p(x)sin(x))2dx

You may use without further note the following integrals:

11xsin(x)dx=2sin(1)2cos(1)11x3sin(x)dx=10cos(1)6sin(1)

218 μs
24.7 μs

We also provide a sanity check – this should be down around 1016 if everything is done correctly.

117 μs
712 ms
Loading...
ii