-1

I need to minimize the following expression with respect to $\theta$. In this expression $X$ is a $(N × 2)$ matrix that contains a column of 1's and an explanatory variable in the second column. $\theta_s$ is a parameter vector that contains a constant and the coefficient for the explanatory variable.

Maybe a bit unclear in the notation, but the index $i$ refers to the $N$ in the summation and $t$ refers to $T$ in the summation.

$$\sum_{NT} p_{i s}\left(y_{i t}-X \theta_s\right)^2$$

Q: What is the analytical expression of the optimal $\theta$?

Tim
  • 684
  • What does the index $s$ refer to? It would help if you made your sums either $\sum_{i=1}^N\sum_{t=1}^T$ or $\sum_{s=1}^N\sum_{t=1}^T$, or whatever it is that you want. – Michael Dec 02 '23 at 13:48
  • @Michael the original optimization problem is to optimize a matrix of parameters, where each column represents its own segment/s.

    However as we split the optimization over the segments, the index s is just a result of the original notation, which can ignored here.

    Note that the subindex i refers the the "shop" and goes from 1,....,N.

    – Tim Dec 02 '23 at 14:59

1 Answers1

0

It looks like $y_{it} - X\theta$ is a $N$-dimensional vector, so $(y_{it}-X\theta)^2$ does not make sense.

I think you want to minimize $$\sum_{i=1}^N\sum_{t=1}^Tp_i||y_{it}-X\theta||^2$$


Let us assume $p_i\geq 0$ for all $i$. If you want, you can write this as a minimization of $$\sum_{i,t}||\sqrt{p_i}y_{it}-\sqrt{p_i}X\theta||^2$$ which can be written as a minimization of $$||a-M\theta||^2$$ for some vector $a$ and some matrix $M$.


However, it sounds like your vector $\theta$ has the form $\theta = (1,z) \in \mathbb{R}^2$ in which case you really have a function of one variable $z\in\mathbb{R}$, you can take a derivative with respect to $z$. Note that for known $v,z\in\mathbb{R}^n$ and $z\in\mathbb{R}$ we have $$||v-rz||^2=(v-rz)^{\top}(v-rz)=||v||^2 - 2rv^{\top}z + ||r||^2z^2$$ So you have a sum of $NT$ such expressions, meaning your overall expression is of the form $a+bz+cz^2$ for some $c\geq 0$, where $a,b,c$ are sums of inner products of the data.

Michael
  • 23,905