7. Regression model using time as x-variable

The exercise was created 2024-03-26 by Makizon. Question count: 20.




Select questions (20)

Normally, all words in an exercise is used when performing the test and playing the games. You can choose to include only a subset of the words. This setting affects both the regular test, the games, and the printable tests.

All None

  • regression för adj.close från training set regression <- lm(formula=adj.close~time, data=training)
  • gör summary för regression summary(regression)
  • vad ska du kommentera på från "summary(regression)" ? adjusted R-squared, b1 och b0
  • vad är b0? time, slope
  • vad är b1? intercept
  • the estimated regression model formeln? y_hat= b0+b1*time
  • vad betyder en positiv b1 en positiv slope
  • gör en vector till din regression forecast, steg 1 forward_data <- data.frame(time=81:84)
  • gör en vector till din regression forecast, steg 2 regression_forecast <- predict.lm(regression, newdata=forward_data)
  • command för att visa regression forecast regression_forecast
  • plot regression forecast (xlim=c(70,84) kan börja från 0 också dene bara inzoomad så) plot(1:nrow(COST), COST$adj.close, type="l", xlim=c(70,84), ylab="Adjusted close", xlab="Time", main="Regression forecast")
  • steg 1: efter "plot regression forecast" lägg till fitted values linje lines(1:80, regression$fitted.values, col="red", lwd=2, lty=2)
  • steg 2: efter "plot regression forecast" lägg till real values linje lines(81:84, testing$adj.close, type="o", col="magenta", lwd=2)
  • steg 2: efter "plot regression forecast" lägg till forecasted values linje lines(81:84, regression_forecast, type="o", col="purple", lwd=2)
  • vad visar den röda linjen? fitted values
  • vad visar den rosa linjen real values
  • vad visar den lila linjen forecasted values
  • skapa vector som heter regression_forecast_error regression_forecast_error <- testing$adj.close - regression_forecast
  • skapa vector som heter regression_table regression_table <- data.frame(cbind(testing$adj.close, regression_forecast, regression_forecast_error))
  • ändra namn i vector regression_table names(regression_table) <- c("testing", "estimated", "residuals")

All None

Shared exercise

https://spellic.com/eng/exercise/7-regression-model-using-time-as-x-variable.11989242.html

Share