eco-detectives / eco_detective

Reading/coding group for The Ecological Detective
1 stars 3 forks source link

Ch 5 #9

Open oharac opened 6 years ago

oharac commented 6 years ago

hey all, my chapter 5 work is in the repo - I tried it with a loop (as in the pseudocode) and with dplyr::mutate() in a dataframe, and even with purrr::pmap and base::apply(), and in this case, seems like the loop is the fastest way to do it. I'd be curious to see if anyone came up with a different way to take advantage of vector operations to do it faster.

I also included some code from econometrics, calculating ordinary least squares estimators in matrix form, which is a much more efficient way (as in thousands of times faster) to find the parameters that minimize the sum of squares... but a lot less conceptually intuitive than the loop process. If folks are interested I'd be happy to show how it works on Wednesday.

couture322 commented 6 years ago

Cool, I used loops too but will look at your OLS stuff.

Did anyone try the goodness of fit stuff after pseudocode 5.2?

couture322 commented 6 years ago

Also, I think I was losing steam by using this pretty round-about pseudo code which helps to understand the concepts but isn't what we'd use to do this in real life. Maybe we could talk about this Weds if there's extra time.