Suppose I have a set of tabulated data, defined in Desmos as $(x_1, y_1)$, that I want to model with an $n$ degree polynomial, $$y_{1} \sim a_1x_{1}^1 +a_2x_{1}^2+\ldots+a_nx_{1}^n $$ Is there a way I could condense this with a regression feature such that the degree can be controlled by the slider for $n$, $$y_1 \sim \sum^n_{i=1} a_ix_{1}^i\;?$$ I want to do this specifically for a summation of sine functions of the form $y=a\sin{b(x-c)}+d$, so that instead of going, $$y_{1} \sim a_0+a_{1} \sin{b_{1}(x_{1}-c_1)} + a_2\sin{b_{2}(x_{1}-c_2)}+\ldots+a_n\sin{b_{n}(x_{1}-c_n)}$$ And spending a lot of time doing that, I can simply just go: $$y_1 \sim a_0+\sum^n_{i=1} a_i\sin{b_i(x_1 - c_i)}$$ Adjusting the subsequent slider for $n$ as I see fit. I have tried to do just this, but it doesn't seem to work as the index is considered as a variable not as a part of the summation. I have been looking around but cannot seem to find anything. Another way to frame this question is to ask: is there a way in Desmos to shortcut having long expansions. If this is possible, is it also possible to do with the product function?
I know it works for a normal function, but I want to use this for regressions to save the time from writing out long winded polynomial functions et al.
If this is not possible in Desmos, can it be done in other programs e.g. MATLAB?
The simplified answer is no, as Desmos treats variables like $a_i$ in their own right, thus saying you have a variable that isn't defined. However, you could use a list and do something like $a[i]$ (where $a$ is a list). As for Matlab, it's a programming language I don't understand...