Skip to main content


A recent unrelated comment reminded me of the time when I was looking for software to plot plain text charts in #Perl ...

Plaintext plot - existing software? 20210721,
https://perlmonks.org/?node_id=11135247

... one suggested Chart::Gnuplot https://metacpan.org/pod/Chart::Gnuplot package; other response prompted me to find Scatterplot, https://metacpan.org/pod/ScatterPlot .

Software in R (not plain text output) & Go were also suggested.

Related, initially used Statistics::OLS https://metacpan.org/pod/Statistics::OLS for linear regression. But switched to Math::Symbolic https://metacpan.org/pod/Math::Symbolic & Algorithm::CurveFit https://metacpan.org/pod/Algorithm::CurveFit to find coefficients for regression polynomials of degree [1-3].

#statistics #polynomialRegression

This entry was edited (2 months ago)
in reply to parvXtl

... First 3 days of data transfer -- zfs send | ssh zfs recv -- tracked with plain linear regression of degree 1;
after day 4, up to 5|6 days with polynomial of degree 2;
after day 6|7, up to ~16 days (transfer finished) with polynomial of degree 3.

After getting the coefficients for regression of degree [23], plotted the equations in LibreOffice.

This entry was edited (2 months ago)
in reply to parvXtl

... Besides setting up the code to drive Algorithm::CurveFit, time most spent was attaching a date to a current hour:minute:second value that "#zfs-send(8)" emits. (Why the fuck does it not include a date anyway?🤬 "-P" option is utterly useless for time value)

Initially I had not realized that adding time difference to an DateTime https://metacpan.org/pod/DateTime object does not produce a new one, original was modified instead. Over thousands of iterations, the program was using more than "expected" amount of memory & had slowed down.

Faster overall was to attach a date to a time (fuck "zfs-send(8)", again, on that point), store the result as string instead of as an #DateTime object; reconvert to DateTime object elsewhere.

If I would have found #polynomialRegression understanding at the time in #Python (like "Polynomial Regression in Python using scikit-learn (with a practical example)", 2021116 by Tamas U, https://data36.com/polynomial-regression-python-scikit-learn/ ), use of its datetime package would have been saner.

#Perl #statistics

This entry was edited (2 months ago)