kill(all)$

 MAXIMA:"SIMPLE LINEAR REGRESSION", version 1.0
peter.vlasschaert@gmail.com,22/01/2019

How to use parametric plot, plotting ordinary functions
=================================================
y = f(x) = sin(x)  =>  ' see below : conversion to' parametric' 

x1(t):=t;
y1(t):= sin(t);

wxplot2d([parametric,x1(t),y1(t),[t,-6.28,6.28]],[x,-7,7],[y,-1.2,1.2],
[xlabel,"t=time,'x'"],[ylabel,"f(t),'y'"]);

------------------------------------------------------------------------------------------------------------------------

data : experiment
===============
x values , y values
1              ,3
2              ,5
3              ,9
4              ,11
5              ,13

------------------------------------------------------------------------------------------------------------------------

'x - data 'experiment'
-------------------------------

l1:[1,2,3,4,5];

'y - data 'experiment'  : result
-------------------------------------------

l2:[3,5,9,11,13];

How convert : list => matrix
=======================

aa:matrix(l1,l2);

aa:transpose(aa);

statistics (linear regression)
=======================

p5:simple_linear_regression(%);

f(x) = a*x+b
=========

p5a:part(p5,2,1,2);

f(t) = a*t+b ( use  : 'subst' )
=========

p6:subst([x=t],p5a);

find : a,b
========

p6a:a=coeff(p6,t);
p6b:b = ev(p6,t=0);

rem:  y2(t)  with use  ''
---------------------------------

x2(t) := t;
y2(t) := ''p6;

graph : data, linear regression.
==========================

wxplot2d([[discrete,l1,l2],[discrete,l1,l2],[parametric,x2(t),y2(t),[t,0,7]]],
               [x,-1,10],[y,0,15],[style,[lines,.5,blue],[points,.5,red],[lines,.9,green]],
             [xlabel," x data"],[ylabel,"y data"] , [title," x-data vs y-data"],[same_xy],grid2d);

'-----------------------------------------------------------------------------------------------------------------------------------------------'