# Math Help - least square approximations

1. ## least square approximations

Let $t_{j}=j/100, a_{j}=j,b_{j}=-j$ for $j=0,...,99$. Determine the values of $c_{l},d_{m}$ for $l=0,...,5,m=1,...,4$, so that
$P(t)=c_{0}+\sum_{k=1}^{4}(c_{k}\textup{cos}(2\pi{k t})+d_{k}\textup{sin}(2\pi{kt}))+c_{5}\textup{cos} (10\pi{t})$
is the least squares approximation to the data points $(t_j,x_j)$ for $j=0,...,99$.

2. ## Re: least square approximations

Originally Posted by alphabeta89
Let $t_{j}=j/100, a_{j}=j,b_{j}=-j$ for $j=0,...,99$. Determine the values of $c_{l},d_{m}$ for $l=0,...,5,m=1,...,4$, so that
$P(t)=c_{0}+\sum_{k=1}^{4}(c_{k}\textup{cos}(2\pi{k t})+d_{k}\textup{sin}(2\pi{kt}))+c_{5}\textup{cos} (10\pi{t})$
is the least squares approximation to the data points $(t_j,x_j)$ for $j=0,...,99$.
More context would help with this, like is the data known and you want the actual coefficients, or do you want something like the regression equations?

CB

3. ## Re: least square approximations

Originally Posted by CaptainBlack
More context would help with this, like is the data known and you want the actual coefficients, or do you want something like the regression equations?

CB
Sorry! I realised I left out some details!

Let $t_{j}=j/100, a_{j}=j,b_{j}=-j$ for $j=0,...,99$. Define
$f(t)= \sum_{k=0}^{99}(a_{k}\textup{cos}(2\pi{kt})+b_{k}{ sin}(2\pi{kt}))$
.
Define $f(t_{j})$ by $x_{j}$ for $j=0,...,99.$Determine the values of $c_{l},d_{m}$ for $l=0,...,5,m=1,...,4$, so that
$P(t)=c_{0}+\sum_{k=1}^{4}(c_{k}\textup{cos}(2\pi{k t})+d_{k}\textup{sin}(2\pi{kt}))+c_{5}\textup{cos} (10\pi{t})$
is the least squares approximation to the data points $(t_j,x_j)$ for $j=0,...,99$.

4. ## Re: least square approximations

Originally Posted by alphabeta89
Sorry! I realised I left out some details!

Let $t_{j}=j/100, a_{j}=j,b_{j}=-j$ for $j=0,...,99$. Define
$f(t)= \sum_{k=0}^{99}(a_{k}\textup{cos}(2\pi{kt})+b_{k}{ sin}(2\pi{kt}))$
.
Define $f(t_{j})$ by $x_{j}$ for $j=0,...,99.$Determine the values of $c_{l},d_{m}$ for $l=0,...,5,m=1,...,4$, so that
$P(t)=c_{0}+\sum_{k=1}^{4}(c_{k}\textup{cos}(2\pi{k t})+d_{k}\textup{sin}(2\pi{kt}))+c_{5}\textup{cos} (10\pi{t})$
is the least squares approximation to the data points $(t_j,x_j)$ for $j=0,...,99$.
This is now a numerical problem, consider using the Excel solver to find the best fit.

(Fourier theory suggests that $c_0\approx 0$ and $c_i\approx 100$ for $i=1..5$ and $d_i\approx 100$ for $i=1 .. 4$ )

CB