Finding a linear regression model with polynomial basis function?

149 Views Asked by At

I've stumbled across this question and honestly don't really know where to begin, I understand the general idea behind a polynomial basis function and its role in regression, but don't know how to approach this, any help would be greatly appreciated!

The following is a method of creating data for supervised learning. Y is generated from the following distribution: $$ y \sim N(\sin(2x), \sigma ^ 2), \quad \sigma = 0.3 $$ where x is generated from a uniform distribution from $-4$ to $4$, yi and xi, for $i=1,...,n$ represent n observations. Propose a linear regression model for y and x using polynomial basis functions.

1

There are 1 best solutions below

0
On BEST ANSWER

Taylor expension of $\sin (x)$ at $x =0$ is

$$ \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1} $$ hence, you can estimate, e.g., $y = \beta_0 + \beta_1 x + \beta_2 x ^ 3 + \beta_3 x ^ 5 + \beta_4 x ^ 7 + \beta_5 x ^ 9 + \epsilon$. The following figure illustratesenter image description here $n=100$ data points generated from $N(\sin(2x), 0.3^2)$, where $X \sim U[-2, 2]$. You can see that practically the polynomial regression was as good as the true regression model $y = \alpha_0 + \alpha_1 \sin ( 2x ) + \xi$