Everything is a number

By Siby Chakraborty

Everything is a number: As Pythagoras said, God is a Mathematician, and in fact, God is Number. Pythagoras thought numbers were divine, an expression of God’s mind. All of existence is number.

Whatever we could see or hear can be represented in a sequence of numbers, and it can be a simple piece of music or even never-ending complex motions. Every sequence of numbers is data, and every data has its pattern. To understand the pattern completely, we must give a form to those numbers, and those forms are commonly called as equations. Forming such equations from numbers can be done using regression.

Linear regression is most commonly used for predictive analysis. The overall idea of the regression is to examine two things:

  • Do a set of predictor (independent) variables predicts an outcome of the (dependent) variable with accuracy?
  • In the case of many independent variables, which variables in particular, are significant predictors of the outcome (dependent) variable?

The simplest form of the regression equation with one dependent and one independent variable is

y = a + b x

where y = estimated dependent variable , a = constant (y-intercept ), b = regression coefficient (slope) , and x = independent variable.

For example: In a simple case, if you want to sell a house of size 2500 sq feet area without any loss from your side and you don’t know the exact worth of the house, but you have a data of houses of different size and its cost.

Size (sq feet)         1000  1250  1720  2000  2800  3250
Cost  (Rs)  470000  570000  790000  900000  1250000  1500000

We can use some simple codes in MATLAB to obtain the regression equation.

Steps:

  1. Input data (x and y).
  2. Compute b (slope) from the formula.
  • a can be found  by substituting  x = 0 in the equation:
  • y = y’ + b(x – x’), where y’ and x’ are the mean of y and x respectively
  • With a and b the regression equation y = a + b x can be formed.

By using equation  y = 7385.342585 +  452.220295 x , For x = 2500 sq feet we get y= 1137936.08008 Rs. So statistically you won’t face loss if you sell the house at cost anything above Rs 11,37,937.

This method is just an example to form a simple linear regression equation; here it’s simple, we got the results directly by using formulas, but in case of higher-order non-linear regression we need the help of machine learning algorithms to form the higher-order polynomial equations. While using machine learning to fit the curve, we might get any one of the following cases.

MATLAB has an inbuild curve-fitting toolbox; we can fit curves by using Gaussian, Polynomial, Fourier and exponential equations.

For example, I have shown to fit a sine wave using a polynomial equation.

2 comments

    • Thank you for your appreciation and time . Matlab is really user-friendly and much easier than other programing codes. Especially for research purposes.

      Liked by 2 people

Leave a reply to Math Sux Cancel reply