Last active
April 28, 2022 04:36
-
-
Save SirmaXX/5d6e232c0de7b3d46e695519f7bc2bf2 to your computer and use it in GitHub Desktop.
multivarite dersinde yazılan kodlar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#y=ax+b^ | |
#y<-matrix(c(12,10,8,11,6,7,2,3,3),nrow=9,ncol=1) | |
#y | |
#x<-matrix(0:8,nrow=9,ncol=1) | |
#x | |
#b<-solve(t(x)%*%x)%*%t(x)%*%y | |
#b | |
y<-matrix(c(12,10,8,11,6,7,2,3,3),nrow=9,ncol=1) | |
y | |
x1<-matrix(c(0,1,2,3,4,5,6,7,8),nrow=9,ncol=1) | |
x1 | |
X<-matrix(c(rep(1,9),x1),nrow = 9,ncol = 2) | |
X | |
bhat <- solve(t(X)%*%X)%*%t(X)%*%y | |
bhat | |
model <-lm(y~x1) | |
model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment