I need a well-annotated R code to fill in gaps in a dataset, which represents temperature measurements made on the two dimensional grid. Over the course of the measurements some of my sensors died. Due to this I lost data for some time periods and now need to use simple algorithm to approximate these values.
The data is temperature measurements made on a grid of 50 points every three hours over the course of few years.
This is algorithm which should be applied to the data (which exists as a text file):
1. locate point with NA (no data) - walk from point to point (outer cycle), and from month to month (inner cycle)
2. select 5 nearest points to our focal point with missing data
3. for each neighbouring point – select the same month in year-1 or year +1 when both (neighbouring and focal) have data
4. regress data from focal point (for a given month) against data from selected neighbours, keeping regression coefficients and R2
5. select neighbouring point, whose data regresses with the highest R2 against data from the focal point.
6. use that neighbouring point to project upon NA region of the focal point, filling up the data gap
7. if no points are found, select 10 nearest points and repeat # 3
As you see the algorithms involves very straightforward data manipulation. Since my R programming skills are not up to the level which would allow me to do this project quickly, so I need help from a more experienced coder.
4 freelancere byder i gennemsnit $148 på dette job
Hello, expert in programming and regression on structured and unstructured meshes of data points. I can help you estimating the missing data from your dataset. Thanks, Paul