Linear Regression proof of concept#123
Conversation
Sorry for answering that late, did not notice the PR until now. Yes, I am interested in that feature! I started a huge refactoring for |
|
I can't tell you either. If you were to finish your refactoring, I think it would be possible for me to update my feature to your refactored code. |
|
@johannes-wolf - I generally think that ideas behind |
|
I think being more low-level – more of a sandbox kind of lib to build plots and diagrams would be a better fit for |
|
If you are looking for some APIs for insipiration, I would recommend the APIs from Apache eCharts - for example the APIs for xAxis - https://echarts.apache.org/en/option.html#xAxis - it has "knobs" for almost eveything (axisLine, axisTick, minorTick, axisLabel, splitLine etc) |
Hi!
Thanks for all your work on the
cetzand related project, I love it!For my past work, I have been experimenting with linear regression plotting.
Herein, I want to propose to you a proof of concept:
The
xmarks plot a simulated measurement error (see utility function in my example).The dashed trend line is automatically fitted by
cetz-plotfor least square error.(The fourth example is simply random data where I attempt to fit a sine function.)
With this PR you find the code that I used for this proof of concept.
The main implementation challenge is that this needs some matrix operations (transpose, inverse, multiply). I don't think they are builtin to
typstand neither is there a package for these.Therefore, I have added a very basic implementation using the Gaussian algorithm.
In a real application, I think this would rather be done using wasm, as this implementation already exceeds 1 sec of compilation time on my machine...
With these matrix operations available, the rest is pretty straight-forward.
Let me know whether you would be interested in this feature for
cetz-plotand I will continue working on this code, write docs and tests etc.!