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.

  • $\begingroup$ It isn't clear whether you want to approximate the given sine function using polynomials over that interval, or you're supposed to model only using the points given, ignoring what you know of the function generating the points. The results in the former case are bound to be better, though the latter situation is usually more realistic. $\endgroup$
    – Macavity
    Commented May 28, 2021 at 14:22
  • $\begingroup$ Hi there! I think it's asking to approximate the given sine function using polynomials and over that interval. $\endgroup$
    – KLM117
    Commented May 28, 2021 at 15:20

1 Answer 1


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$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .