Publications by Enwu Liu

Bayesian linear regression

25.12.2022

Bayesian Linear Regression \[P(\beta|y,X)=\frac{P(y,X|\beta)P(\beta)}{P(y,X)}\] where, \(P(y,X)=\int_{-\infty}^\infty P(y,X|\beta)P(\beta)d\beta\) When predicting the output for a single data point using Bayesian Linear Model, we do not get a single value but a distribution. However, we can use mean regression line to produce a single outcome...

655 sym

Kernel regression

28.12.2022

Kernel regression Kernel regressin can be used to model non-linear relationship between the outcome variable and predictors. The most common Kernel regression is Nadaraya–Watson kernel regression. First we can write the regression model as \[Y=f(x)+\epsilon \text{, and }\epsilon\sim N(0,\sigma^2)\] Then \(f(x)\) can be estimated by: \[\h...

3532 sym Python (5120 sym/8 pcs) 2 img

A simple Markov Chain Monte Carlo

30.12.2022

For Bayesian linear regression, we can write the model using the following equation: \[P(\beta|y,X)=\frac{P(y,X|\beta)P(\beta)}{P(y,X)}\] where, \(P(y,X)=\int_{-\infty}^\infty P(y,X|\beta)P(\beta)d\beta\) Usually, it is very difficult to calculate the unconditional probability \(P(y,X)\) i.e. the integral \(\int_{-\infty}^\infty P(y,X|\bet...

3220 sym

Notes for order statistics

06.01.2023

The pdf of the order statistic can be written as \[g(y_1,y_2,...,y_n)=\begin{cases} n!f(y_1)f(y_2)...f(y_n) & a<y_1<y_2<...y_n\\ 0 &\text{elsewhere} \end{cases}\] The marginal pdf of any order statistic, say \(Y_k\) can be calculated by the following formula \[\begin{align} g_k(y_k)&=\int_a^{y_2}\int_a^{y_3}...\int_a^{y_k}\int_{y_k}^b\int_{y...

1770 sym

Bivariate normal distribution in nature

09.01.2023

Bivariate normal distribution Bivariate normal distribution with mean \[\begin{bmatrix} 0 \\ 0 \end{bmatrix}\] and covariance matrix \(\begin{bmatrix} 3 &-1 \\ -1 & 3 \end{bmatrix}\) library(mnormt) #make this example reproducible set.seed(0) #create bivariate normal distribution x <- seq(-3, 3, 0.1) y <- seq(-3, 3, 0.1) ...

279 sym R (390 sym/1 pcs) 2 img