This project outline and background information have been provided to assist you as you complete your project. You should assume the reader of your work has no knowledge or access to this information.
Measurements have uncertainty or variation. How can we model that uncertainty and use those models to answer questions? In this project, we’ll be fitting the data to stochastic models \(f(L)\) that give the probability information about different lumen output of LED bulbs (as a percent of the initial lumens).
Create an R Markdown file.
Use the following code to read in the light bulb data.
#Uncomment and run the line below once in the console to get the devtools package.
#install.packages("devtools")
#Uncomment and run the line below once in the console to get the data4led package.
#devtools::install_github("byuidatascience/data4led")
#Use the code below to load the data4led package to your current R session.
library(data4led)
#Use the code below to load the data for all the bulbs at a time near 2100 hours.
dist <- led_time(2100)
This code creates a data frames is called “dist”. The dist data frame contains measurements for 202 light bulbs 2104 hours after the the light bulb was turned on.
The data frame named “dist” includes the columns (1) “id”, the identification number for your randomly selected bulb, (2) “hours”, the number of hours since the bulb has turned on, (3) “intensity”, the lumen output of the bulb, and (4) “percent_intensity”, the bulb intensity as a percent of the original lumen.
The stochastic models we will be fitting give the probability information for intensity measured as a percent of the initial brightness.
hist()
command in R to create a density histogram for the light bulb intensity as a percent of initial lumens. Use the dist data frame.Create a new R Markdown file.
Consider the following general models
For each function, use the Desmos files below with sliders to dynamically explore how changing the parameter changes the behavior of the function.
For each function, observe how changing the parameters changes the behavior of the function (or model). Try to summarize your observations in terms of transformations of functions (shifts, reflections, stretch) and the mathematical behavior of the function (increasing, decreasing, constant, positive, negative, nonnegative). Identify interesting parameter values (or ranges of values) where the behavior of function is different.
Select one of the functions to describe. In your narrative summarize your observations about the parameters in terms of transformations of functions (shifts, reflections, stretch) and the mathematical behavior of the function (increasing, decreasing, constant, positive, negative, nonnegative). Use plot()
commands in R to plot several representative curves illustrating what you learned in your parameter exploration. Use the par(mfrow())
command to organize your plots into one figure.
Organize your work into a cohesive analysis and submit it to Canvas.
hist()
and lines()
commands in R to plot your each fitted function and the density histogram of the data together. You should have 3 plots, each with one fitted function and the data. Make sure the viewing window for each plot is xlim = c(95,105)
and ylim = c(0,1)
.runif()
, rnorm()
, and rgamma()
commands in R with the parameter values you found when you fit the distribution to the data to create a sample of 5000 random measurements using each fitted model.Create a new R Markdown file.
Use this code to read in the data for when the bulbs have been on for approximately 1 day (24 hours).
dist1 <- led_time(24)
Use this code to read in the data for when the bulbs have been on for approximately 1 month (720 hours).
dist2 <- led_time(720)
Use this code to read in the data for when the bulbs have been on for approximately 6 month (4320 hours).
dist4 <- led_time(4320)
Describe in 2-4 sentences how a deterministic model is different than a stochastic model.
Organize your work from Tasks 1-5 into a cohesive analysis and submit it to Canvas. Use only the important and relevant plots, calculations, and information.
Reflect on your work for this project. At the bottom of your report include the following in a brief (1-2 paragraph) reflection.