خرید بک لینک

Vote count: 0

I am trying to find a code for interpolating daily temperature values through 12 monthly mean values. The spline function yields a simple solution. However, I need to implement a restriction, so that the mean value of interpolated daily values for each month equals the original monthly mean values (difference <= 0.001 degC). I arbitrarily place the monthly mean values at the 15th of each month.

I haven't used the spline functions so far and am not familiar with interpolation techniques. This is how far I have come yet:

mod <- splinefun(df$numd, dati$TA, method = "fmm", ties=mean)
#monoH.FC
x <- seq(as.numeric(as.Date("1999-12-15")), as.numeric(as.Date("2000-12-15")), by = 1)
mod <- data.frame(x = x, y = mod(x))
mod$Date <- as.Date(mod$x, origin = "1970-01-01")

ggplot() +
geom_point(data = df, aes(x = md, y = TA)) +
geom_line(data = mod, aes(x = Date, y = y))

mod <- mod[-1,]
mod$month <- as.numeric(format(mod$Date, "%m"))
mm <- aggregate(y ~ month, mod, mean)
colnames(mm)[2] <- "mm"
comp <- merge(mm, df[1:12,1:2])
comp$diff <- comp$TA - comp$mm

I need to supplement the code with some restriction so that comp$diff <= 0.001.

Thanks in advance for any help!

asked 38 secs ago

برچسب: spline interpolation with matlab,spline interpolation with constraints,spline interpolation with example,spline interpolation with excel,spline interpolation with barriers,quintic spline interpolation with minimal feed fluctuation,cubic spline interpolation with 4 points,cubic spline interpolation with excel,cubic spline interpolation with example,interpolation with spline, نویسنده: استخدام کار تاريخ: سه شنبه 9 شهريور 1395 ساعت: 1:13

صفحه بندی