Skip to content

Instantly share code, notes, and snippets.

@conormm
Created November 27, 2017 17:47
Show Gist options
  • Save conormm/27015b1f14d2de7225a0c04adb18d246 to your computer and use it in GitHub Desktop.
Save conormm/27015b1f14d2de7225a0c04adb18d246 to your computer and use it in GitHub Desktop.
predict_from_theta <- function(x) {
x <- cbind(x, rep(1, length(x)))
dot(x, theta)
}
predict_from_theta(rnorm(10))
[,1]
[1,] -1.530065
[2,] 8.036859
[3,] 6.895680
[4,] 3.170026
[5,] 4.905467
[6,] 2.644702
[7,] 12.555390
[8,] 1.172425
[9,] 3.776509
[10,] 4.849211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment