Posts

Showing posts from 2016

What is Covariance?

I have no idea how many times to search "What is Covariance?" in Google... Here hope one simple page easily summarizes Covariance.   Variance X Name Math score English score Smith 78 80 Alice 90 55 Lee 45 92 George 65 85 Ben 83 76 mean 72.2 77.6   X-E[X]     Smith 5.8 2.4 ->(times) 13.92 Alice 17.8 -22.6 -> -402.28 Lee -27.2 14.4 -> -391.68 George -7.2 7.4 -> -53.28 Ben 10.8 -1.6 -> -17.28 COV= -170.12 Covariance value is -170.12

Cluster Analysis In SPSS (Hierarchical, Non-hierarchical & Two-step)

Image

How to calculate the Upper Bound in 0-1 Knapsack problem

Image
How to calculate the Upper Bound in 0-1 Knapsack problem. It is very simple. Example: 1. Calculate Profit/weight to know each profit of each weight 2. Sort Profit/weight by descending 8/5=1.65 11/7=1.57 6/4=1.5 4/3=1.3 3. Add each item once (due to 0-1 Knapsack problem) from the top of the list Profit = 8+11 Weight = 5+7 Knapsack's capacity is 14. To now those takes 5+7=12. So it only has 2 spare weight. Third item has 4 weight and 6 profit. Make it fraction so it's profit goes 6*1/2 = 3 (third item's profit) Profit = 8+11+3=22 Weight = 5+7+2=14 The possible maximum profit (in the situation of fraction available) is 22. 22 is the Upper Bound. Ref:  http://math.stackexchange.com/questions/1267331/0-1-knapsack-upper-bound

What is the Shadow price?

The shadow price can be thought that is the profit increase by the resource increase. In other words on the decision making purpose if you want to know how much profit would increase depending on the resources invested or spends, then the shadow price shows the level of profit increase from that. I believe there provide great explanation on the internet enough so wouldn't describe here more but for Korean here translated for those. 섀도우 금액은 자원의 추가 투자 또는 소비에 대해 늘어나는 단위 이익을 말한다.

Primal problem and Dual problem

Image
When we face the problem that can be solved by the linear problem method, there will be provided two approaches solving the issues called first 'Primal problem' and second is 'Dual problem'. These two methods can be always introduced together against the problem. However it can different results and we call it 'Duality gap'. Primal problem is the original problem given. Dual problem is converted from the original by 'Lagrangian dual problem', 'Wolfe dual problem' or 'Fenchel dual problem'. As usual method 'Lagrangian dual problem' introduces a variable (gamma) having the positive value in order to add the equation into the object function and formulize it as Lagrangian format. And find the minimal value of Dual problem to find the solution of Primal problem. The result value of Primal and Dual problem can be different and we call it 'Duality gap'. Duality gap is always non-negative or zero. References http://m...

North-West / Least cost / VAM solution for optimization

Image
Here recommending the nice Youtube video https://youtu.be/ItOuvM2KmD4

What is Linear combination?

Image
The concept of Linear combination is simple that you already learnt to find the 'X' value from the equation. ex. y = aX +b When you replace 'b' with 'X2' then it will be: y = aX + X2 When you add another constant value for 'X2' with c then: y = aX + cX2 Finally you have two constant values 'a' and 'c' which weight to 'X' and 'X2'. Hence Linear combination is you multiply the constant values ('a', 'c') with Xs and you sum them. Like below. x(t) = ax1(t) + bx2(t) To know more Vector combination with this Click .

Pandas installation on Visual Studio

Image
Visual Studio provides very simple UI and guidance to install Pandas which should be manually installed yourself when suing Visual Studio. Go to 'Tool' --> 'Python Tools' --> 'Python Environments' Then you will the 'Python Environments' window on the right hand side. Click the small button on the right and 'PIP' and enter keyword 'pandas' to search it. Don't forget to 'Refresh Python DB' as the last step by clicking the button on the next.

matplotlib installation

Image
This takes few minutes to install 'matplotlib' lilbrary on your computer. 1. Download https://pypi.python.org/pypi/matplotlib My case is having Python 2.7 version and 64 bit platform so downloaded as below. matplotlib-1.5.1- cp27 -none-win_ amd64 .whl 2. Install command > python -m pip install "[Download path]\matplotlib-1.5.1-cp27-none-win_amd64.whl" Done!!!

NumPy installation

Image
I spent 2 hours ...to know how to install NumPy python library in my computer. This post can help you to install NumPy quick and easy. I am sure. It takes only 15 minutes for NumPy installation. What is NumPy? Wiki will help me from here . Requirement: - Already Python (higher 2.7) programming tool installed in your computer. 1. Download Download NumPy package from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy My computer is 64bit platform having Python 2.7 version. So choose "...+mkl-cp27...amd64.." as below. 2. Run 'Command prompt' (cmd) and enter as below > python -m pip install "[Download Path]\numpy-1.10.4+mkl-cp27-cp27m-win_amd64.whl" You know where the downloaded file is. My case was "C:\...\download". 3. DONE!!! ======================================================================== But if you see the below print. Then it's also simple. Just enter the following command to upgrade your ...