HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
A Function is special relationship where each input has an output
A Function is special relationship where each input has an output.
A function is often written as f(x) where x is the input:
// Generate values var xValues = []; var yValues = []; for (var x = 0; x <= 10; x += 1) { xValues.push(x); yValues.push(x); } // Display using Plotly var data = [{x:xValues, y:yValues, type:"lines"}]; var layout = {title: "f(x) = x"}; Plotly.newPlot("myPlot1", data, layout);
Results from f(x) = x
x | y | y = x |
---|---|---|
1 | 1 | y = x = 1 |
2 | 2 | y = x = 2 |
3 | 3 | y = x = 3 |
4 | 4 | y = x = 4 |
5 | 5 | y = x = 5 |
// Generate values var xValues = []; var yValues = []; for (var x = 0; x <= 10; x += 1) { xValues.push(x); yValues.push(x*2); } // Display using Plotly var data = [{x:xValues, y:yValues, type:"lines"}]; var layout = {title: "f(x) = 2x"}; Plotly.newPlot("myPlot2", data, layout);
Results from f(x) = 2x
x | y | y = 2x |
---|---|---|
1 | 2 | y = 2x = 2 |
2 | 4 | y = 2x = 4 |
3 | 6 | y = 2x = 6 |
4 | 8 | y = 2x = 8 |
5 | 10 | y = 2x = 10 |
A Linear Equation is an equation for a straight line:
var exp1 = "x"; var exp2 = "x*2"; var exp3 = "x*2 + 7"; // Generate values var x1Values = []; var x2Values = []; var x3Values = []; var y1Values = []; var y2Values = []; var y3Values = []; for (var x = 0; x <= 10; x += 1) { x1Values.push(x); x2Values.push(x); x3Values.push(x); y1Values.push(eval(exp3)); y2Values.push(eval(exp2)); y3Values.push(eval(exp1)); } // Define Data var data = [ {x: x1Values, y: y1Values, mode:"lines"}, {x: x2Values, y: y2Values, mode:"lines"}, {x: x3Values, y: y3Values, mode:"lines"} ]; var layout = {title: "[y=" + exp3 + "] [y=" + exp2 + "] [y=" + exp1 + "]"}; // Display using Plotly Plotly.newPlot("myPlot4", data, layout);
A Linear Equation can NOT contain exponents or square roots:
A Linear regression tries to model the relationship between two variables by fitting a linear graph to data.
One variable (x) is considered to be data, and the other (y) is considered to be dependent.
For example, a Linear Regression can be a model to relate the price of houses to their size.
Linear algebra is used to solve Linear Equations.
Linear Least Squares (LLS) is a set of formulations for solving statistical problems involved in Linear Regression.