# Blog Archives

## R and Python: Gradient Descent

December 22, 2015
By

One of the problems often dealt in Statistics is minimization of the objective function. And contrary to the linear models, there is no analytical solution for models that are nonlinear on the parameters such as logistic regression, neural networks, and nonlinear regression models (like Michaelis-Menten model). In this situation, we have to use mathematical programming or optimization. And one...

## R and Python: Theory of Linear Least Squares

December 15, 2015
By In my previous article, we talked about implementations of linear regression models in R, Python and SAS. On the theoretical sides, however, I briefly mentioned the estimation procedure for the parameter $\boldsymbol{\beta}$. So to help us understand how software does the estimation procedure, we'll look at the mathematics behind it. We will also perform the estimation manually in R...

## R, Python, and SAS: Getting Started with Linear Regression

August 16, 2015
By Consider the linear regression model, $$y_i=f_i(\boldsymbol{x}|\boldsymbol{\beta})+\varepsilon_i,$$ where $y_i$ is the response or the dependent variable at the $i$th case, $i=1,\cdots, N$ and the predictor or the independent variable is the $\boldsymbol{x}$ term defined in the mean function $f_i(\boldsymbol{x}|\boldsymbol{\beta})$. For simplicity, consider the following simple linear regression (SLR) model, $$y_i=\beta_0+\beta_1x_i+\varepsilon_i.$$ To obtain the (best) estimate of...

## Parametric Inference: Karlin-Rubin Theorem

July 20, 2015
By A family of pdfs or pmfs $\{g(t|\theta):\theta\in\Theta\}$ for a univariate random variable $T$ with real-valued parameter $\theta$ has a monotone likelihood ratio (MLR) if, for every $\theta_2__\theta_1$, $g(t|\theta_2)/g(t|\theta_1)$ is a monotone (nonincreasing or nondecreasing) function of $t$ on $\{t:g(t|\theta_1)__0\;\text{or}\;g(t|\theta_2)__0\}$. Note that $c/0$ is defined as $\infty$ if $0__ c$. Consider testing $H_0:\theta\leq \theta_0$ versus $H_1:\theta__\theta_0$. Suppose that $T$ is...

## R: Canonical Correlation Analysis on Imaging

January 5, 2015
By In imaging, we deal with multivariate data, like in array form with several spectral bands. And trying to come up with interpretation across correlations of its dimensions is very challenging, if not impossible. For example let's recall the number of s...

## R: Principal Component Analysis on Imaging

December 25, 2014
By Ever wonder what's the mathematics behind face recognition on most gadgets like digital camera and smartphones? Well for most part it has something to do with statistics. One statistical tool that is capable of doing such feature is the Principal Component Analysis (PCA). In this post, however, we will not do (sorry to disappoint you) face recognition as we...

## R: k-Means Clustering on Imaging

September 11, 2014
By Enough with the theory we recently published, let's take a break and have fun on the application of Statistics used in Data Mining and Machine Learning, the k-Means Clustering.k-means clustering is a method of vector quantization, originally from signa...

## R: Interval Estimation of the Population Mean

June 14, 2013
By

Interval estimation of the population mean can be computed from functions of the following R packages:stats - contains the t.test;TeachingDemos - contains the z.test; and,BSDA - contains the zsum.test and tsum.test.The t.test of the stats package is a ...

## R: Measures of Skewness and Kurtosis

June 10, 2013
By Skewness and kurtosis in R are available in the moments package (to install a package, click here), and these are:Skewness - skewness; and,Kurtosis - kurtosis.Example 1. Mirra is interested on the elapse time (in minutes) she spends on riding a tricycl...