Author: ongiavotu

# Karush-Kuhn-Tucker Condition (Or Langrange Multipliers Inequalities Constraints)

Ref: http://homes.soic.indiana.edu/classes/spring2012/csci/b553-hauserk/constrained_optimization.pdf

# What is the intuitive explanation for the duality in optimization?

Ref: https://www.quora.com/What-is-the-intuitive-explanation-for-the-duality-in-optimization-Why-are-the-primal-problem-and-the-dual-problem-equivalent Let us a consider the problem minimizef(x) subject to g(x)≤0minimizef(x) subject to g(x)≤0 where f and g are convex.  Let x∗x∗ denote the constrained minimizer and p∗=f(x∗)p∗=f(x∗). The dual function is defined as h(λ)=minxf(x)+λg(x)h(λ)=minxf(x)+λg(x), and given appropriate conditions, we have maxλh(λ)=p∗maxλh(λ)=p∗.  Why is that? Let's plot all the possible values that (g(x), f(x)) can take for every point … Continue reading What is the intuitive explanation for the duality in optimization?

# Sample Mean Variance

Ref: https://onlinecourses.science.psu.edu/stat414/node/167 Let X1, X2, ... , Xn  be a random sample of size n from a distribution (population) with mean μ and variance σ2. What is the variance of X¯? Var(X¯) named sample mean variance. Solution. Starting with the definition of the sample mean, we have: Var(X¯)=Var(X1+X2+⋯+Xnn)Var(X¯)=Var(X1+X2+⋯+Xnn) Rewriting the term on the right so that it is clear that we have a linear combination of … Continue reading Sample Mean Variance

# Subsampling Python array using Slice

Slicing sampled = sample[start:end:step] Example import numpy as np x = np.zeros(shape=(10,4)) print (x.shape) # 10 4 y = x[::2] print (y.shape)# 5 4

# Confidence Interval of Normal Distribution

Ref: https://www.quora.com/What-is-the-difference-between-99-and-95-confidence-interval Confidence intervals are a little bit tricky in a sense that people don't define what they really mean by confidence interval. Now let me tell you a scenario using which you can start understanding CIs on a very basic level. Imagine you want to find the mean height of all the people in a … Continue reading Confidence Interval of Normal Distribution

# Z-Score

Z score normalize a distribution to a standard form of mean = 0, variance = 1. Z = (X-mean)/(standard variation)