AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Geodist radian stata1/2/2023 ![]() Hist(all_data$WSEL_transformed, breaks = 25) all_data$WSEL_transformed <- log(all_data$WSEL_calc + (1-min(all_data$WSEL_calc))) We use log transformation here while other box-cox transformations can be ultilized. We can double check the distribution of the transformed variable. We would consider to properly transform the response variable for the purposes of normality and variance stabilizing in modeling. Since response variable groundwater levels is calculated by adding Ground Surface Elevation to either the Water Surface reading or the negative Reference Point reading, the WSEL can be negative. level.),ĭata = sj_gwl, size=2, bins = 4, geom = "polygon") +įacet_wrap(~ Year) + guides(alpha=FALSE, fill=guide_legend(title ="Measurements Density")) ![]() Stat_density2d(aes(x = LONGITUDE, y = LATITUDE, fill =. Map <- get_map(location = 'San Joaquin', zoom =10, filename = 'gwl_map.png') Let’s also visualize the well locations on a map. GEODIST RADIAN STATA HOW TOGgtitle('Groundwater Levels change for the well location 2774 ') # Don't know how to automatically pick scale for object of type yearmon. Ggplot(all_data, aes(x = MEASUREMENT_DATE, y = WSEL_calc)) + geom_line() + Ggtitle('Average Solar Radiation change for the well location 2774 ') # Don't know how to automatically pick scale for object of type yearmon. Ggplot(all_data, aes(x = MEASUREMENT_DATE, y = Sol_Rad_avg)) + geom_line() + Ggtitle('ETo change over time for the well location 2774 ') # Don't know how to automatically pick scale for object of type yearmon. Ggplot(all_data, aes(x = MEASUREMENT_DATE, y = ETO_avg)) + geom_line() + all_data$MEASUREMENT_DATE <- as.yearmon(paste(all_data$Year, all_data$Month), "%Y %m") We can see that the ETo and groundwater levels are time dependent and possibly have correlation with each other, although we just made one example to illustrate our “guess” here. Labs(x= "Year", y= "Wells", title="Number of Measurements per year & well") ![]() Theme(=element_blank(), =element_blank()) + Ggplot(newcount_byyear, aes(x= variable, y=CASGEM_STATION_ID)) + geom_tile(aes(fill = value)) + Newcount_byyear$variable <- as.character(newcount_byyear$variable) Newcount_byyear$CASGEM_STATION_ID <- as.character(count_byyear$CASGEM_STATION_ID) Mutate(total_records = rowSums(.,na.rm = TRUE))Ĭount_byyear % select(-total_records) %>% reshape2::melt(id = c("CASGEM_STATION_ID")) Reshape2::dcast(CASGEM_STATION_ID ~ Year, value.var = "num_records") %>% Library(spTimer) sj_gwl = read.csv("sj_gwl_cleaned.csv")Īll_data % group_by(CASGEM_STATION_ID, Year) %>% summarise(num_records = n()) %>% ![]() Library(ggthemes) # Warning: package 'ggthemes' was built under R version 3.2.5 library(viridis) The initial data cleaning script can be found here.Įxploratory Data Analysis library(tidyverse) # Warning: package 'tidyverse' was built under R version 3.2.5 # Warning: package 'ggplot2' was built under R version 3.2.5 # Warning: package 'tibble' was built under R version 3.2.5 # Warning: package 'tidyr' was built under R version 3.2.5 # Warning: package 'readr' was built under R version 3.2.5 # Warning: package 'purrr' was built under R version 3.2.5 library(lubridate) # Warning: package 'lubridate' was built under R version 3.2.5 library(reshape2) Outlying cases had been removed for robustness concern in modeling. We used the data from 2011 to 2016 as the training set to train our model and the data of 2017 as the test set for model evaluation. Note that we focused on the San Joquain Valley as our first investigation, since the spatial-temporal analysis and modeling tends to be more robust and sound in the relatively same area. In the end, we had to clean and process the data sources to merge the well information, monthly ETo data and the groundwater measurement data. Most of the CIMIS stations produce estimates of reference evapotranspiration (ETo) for the station location and their immediate surroundings, often in agricultural areas. ETo data is often used as a proxy metric to indicate the demand of argriculture water usage. Thus, we incorporate the evapotranspiration(ETo) data from the California Irrigation Management Information System (CIMIS) which currently manages over 145 active weather stations throughout the state. Besides, as we know that groundwater is very related to argriculture usage, we are specially interested in some probably useful variables to predict the ground water levels. The data is provided from the Center for Water-Electricity Efficiency, which is also public available from the California Department of Water Resources. ![]()
0 Comments
Read More
Leave a Reply. |