2025-11-10

Intro

The luminosity of a star depends on its surface temp.
We can model this relationship using simple linear regression, a basic statistical method that helps us predict one variable based on another.

Theoretical background

To relate luminosity \(L\) to temperature \(T\), we can use the Stefan–Boltzmann Law: \[ L= 4\pi R^2 \sigma T^4 \] where \(\sigma\) is the Stefan-Boltzmann constant. If we assume the stars radii, we are able to approximate: \[ L \propto T^4 \]

Generate Example Data

set.seed (42)

T<-  seq (3000 ,10000 ,length.out =50)
L <- 1e-4*T ^4 +  rnorm (50 ,0 ,1e10 )
data<- data.frame ( T ,L )

Luminosity vs Temperature Plot

Log-Log Luminosity vs Temperature

Conclusion

Looking at out data, we can confirm that luminosity and temperature have a strong correlation, following the Stefan-Boltzmann law \(L \propto T^4\). The log-log regression model shows us a clear linear trend, showing how luminosity and temperature scale together. The model demonstrates how simple linear regression applies to astrophysical data. Finally, out 3D Plotly plot allows usto see a 3D visualization of this same relationship.