I am working with observed weather data vs. modeled weather data at the same location. The observed weather data is recorded every 6 hours and the modeled weather data has daily resolution (averaged over the whole day). Given the poor temporal resolution of the modeled weather data, I want to add data to it that matches the distribution of the observed weather data while keeping it's original data points. For this example, I will only include the Temperature columns from each dataset for 20 days of a year.
Obs = c(265.9328, 268.9379, 273.2499, 271.6766, 270.9370, 270.8728, 270.8097, 270.2863, 269.7002, 270.7541, 272.2853, 272.5288, 272.5497, 272.3303, 272.7226, 273.0089, 273.3442, 274.1492, 274.4493, 272.8262,265.9328, 268.9379, 273.2499, 271.6766, 270.9370, 270.8728, 270.8097, 270.2863, 269.7002, 270.7541, 272.2853, 272.5288, 272.5497, 272.3303, 272.7226, 273.0089, 273.3442, 274.1492, 274.4493, 272.8262,265.9328, 268.9379, 273.2499, 271.6766, 270.9370, 270.8728, 270.8097, 270.2863, 269.7002, 270.7541, 272.2853, 272.5288, 272.5497, 272.3303, 272.7226, 273.0089, 273.3442, 274.1492, 274.4493, 272.8262,265.9328, 268.9379, 273.2499, 271.6766, 270.9370, 270.8728, 270.8097, 270.2863, 269.7002, 270.7541, 272.2853, 272.5288, 272.5497, 272.3303, 272.7226, 273.0089, 273.3442, 274.1492, 274.4493, 272.8262)
Mod = c(260.8257, 260.7667, 265.2768, 267.0014, 267.7482, 269.0105, 266.1317, 264.7206, 271.3192, 271.5151, 269.7125, 270.3311, 272.2444, 271.4842, 269.0684, 268.9821, 270.6512, 268.3054, 269.4005, 268.9082)
If I want to force Mod to have the same resolution as Obs, I guess I would have to add NAs to Mod. How do I populate those NAs based on the distribution of Obs while using the information from Mod (either by keeping the values or having the daily Mod values influence the new dataset in some way)?
I imagine a function that looks something like this;
temporal.downscale <- function(observed, modeled, distribution_type = "Normal")
Where a new dataset is created with the resolution and normal distribution associated with the observed but with the data values of modeled. I'm relatively new to stats and programming, so the guts of this function is where I'm having trouble.