Showing posts with label classical linear regression. Show all posts
Showing posts with label classical linear regression. Show all posts

## What is regression?

Regression helps to solve the problem of complete uncertainty and decision making and guided planning.

### How do we solve the linear regression model(CLRM)?

The linear regression model is a way of examining the nature and form of the relationship between two or more variables. Also, we want to know which variable is affecting the other.
From -R
install.packages("lmPerm")
set.seed(1234)
> states <- as.data.frame(state.x77)
fit <- lmp(weight~height, data=women, perm="Prob")
summary(fit)
Call:
lmp(formula = weight ~ height, data = women, perm = "Prob")

Residuals:
Min      1Q  Median      3Q     Max
-1.7333 -1.1333 -0.3833  0.7417  3.1167

Coefficients:
Estimate Iter Pr(Prob)
height     3.45 5000   <2e-16 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’
0.1 ‘ ’ 1

Residual standard error: 1.525 on 13 degrees of freedom
Multiple R-Squared: 0.991, Adjusted R-squared: 0.9903
F-statistic:  1433 on 1 and 13 DF,  p-value: 1.091e-14

> plot(fit)
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:

### Black-Scholes formula-R

Black-Scholes formula-R > BlackScholes <- function(TypeFlag = c("c", "p"), S, X, Time, r, b, sigma) { TypeFla...