Skip to content

Instantly share code, notes, and snippets.

@SirmaXX
Last active April 28, 2022 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirmaXX/5d6e232c0de7b3d46e695519f7bc2bf2 to your computer and use it in GitHub Desktop.
Save SirmaXX/5d6e232c0de7b3d46e695519f7bc2bf2 to your computer and use it in GitHub Desktop.
multivarite dersinde yazılan kodlar
#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