File:Visualizing Loglog Normal Data.png
Original file (2,400 × 1,200 pixels, file size: 439 KB, MIME type: image/png)
Captions
Summary edit
DescriptionVisualizing Loglog Normal Data.png |
English: This image presents two plots generated from a dataset of 10,000 points.
The first plot, titled 'Concave Line with Log-Normal Noise', displays a scatter plot of the observed data (y_observed) against the independent variable (x). The red line represents the 'Median line', while the blue line is the 'Mean line'. The y-axis is limited to a range of 0 to 20. The second plot, titled 'Log-Log Linear Line with Normal Noise', also displays a scatter plot of the observed data against the independent variable, but both axes are on a logarithmic scale. Here, both the mean and median lines are the same (red) line. |
Date | |
Source | Own work |
Author | Talgalili |
# Reproducible R code # Load necessary libraries library(ggplot2) library(patchwork) # Set seed for reproducibility set.seed(123) # Generate data n <- 10000 x <- sort(runif(n, min = 1, max = 100)) intercept <- 0.000001 slope <- 0.5 y_true_log <- intercept + slope * log10(x) noise <- rnorm(n, mean = 0, sd = .1) y_observed_log <- y_true_log + noise y_observed <- 10^y_observed_log y_true <- 10^y_true_log # Create data frame df <- data.frame(x = x, y_true = y_true, y_observed = y_observed) # For jupyter notebook options( repr.plot.width = 20, # in inches (default = 7) repr.plot.height = 10 # in inches (default = 7) ) # Plot data p1 <- ggplot(df, aes(x = x, y = y_observed)) + geom_point() + geom_line(aes(y = y_true, color = 'Median line'), size = 3) + geom_smooth(aes(color = 'Mean line'), size = 3, se = F) + coord_cartesian(ylim = c(0, 20)) + # Set the limits of the plot without excluding obs scale_color_manual(values = c('Median line' = 'red', 'Mean line' = 'blue')) + theme_bw() + theme(text = element_text(size = 25)) + theme(legend.position="bottom") + labs(x = 'X', y = 'Y', title = 'Concave Line with Log-Normal Noise') p2 <- ggplot(df, aes(x = x, y = y_observed)) + geom_point() + geom_line(aes(y = y_true, color = 'Mean and Median line'), size = 3) + scale_x_log10() + scale_y_log10() + scale_color_manual(values = c('Mean and Median line' = 'red')) + theme_bw() + theme(text = element_text(size = 25)) + theme(legend.position="bottom") + labs(x = 'X (log scale)', y = 'Y (log scale)', title = 'Log-Log Linear Line with Normal Noise') p1 + p2 + plot_annotation( title = 'Visualizing Loglog Normal Data: Scatter-plots in Original and Log10 Scales', theme = theme(plot.title = element_text(hjust = 0.5, size = 40)) )
Licensing edit
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 11:25, 15 April 2024 | 2,400 × 1,200 (439 KB) | Talgalili (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 47.24 dpc |
---|---|
Vertical resolution | 47.24 dpc |