Výpočet LOO odhadu
Teď si vyzkoušíme práci s balíčkem loo na našem Spotify modelu, abychom zjistili, který model nejlépe odpovídá našim datům. Dataset songs je již načtený.
Toto cvičení je součástí kurzu
Bayesovská regresní analýza s balíčkem rstanarm
Pokyny k cvičení
- Odhadni model predikující
popularityz proměnnésong_age - Vypiš LOO aproximaci pro tento model s 1 prediktorem
- Odhadni model predikující
popularityz proměnnýchsong_age,artist_namea jejich interakce - Vypiš LOO aproximaci pro tento model se 2 nezávislými proměnnými
Interaktivní cvičení na vyzkoušení si v praxi
Vyzkoušejte si toto cvičení dokončením tohoto ukázkového kódu.
# Estimate the model with 1 predictor
model_1pred <- ___(___ ~ ___, data = songs)
# Print the LOO estimate for the 1 predictor model
___(model_1pred)
# Estimate the model with both predictors
model_2pred <- ___(___ ~ ___ * ___, data = songs)
# Print the LOO estimates for the 2 predictor model
___(model_2pred)