Fine Curve fitting for INPUT time-series.
curvefits( INPUT, brks, methods, wFUN, iters = 2, wmin = 0.1, nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minT = 0, minPercValid = 0, use.rough = FALSE, use.y0 = TRUE, ... )
INPUT | A list object with the elements of 't', 'y', 'w', 'Tn' (optional)
and 'ylu', returned by |
---|---|
brks | A list object with the elements of 'fit' and 'dt', returned by
|
methods | Fine curve fitting methods, can be one or more of
|
wFUN | Character or function, weights updating function of fine fitting
function.
If not specified, it will be determined by phenofit options |
iters | How many times curve fitting is implemented. |
wmin | Double, minimum weigth (i.e. weight of snow, ice and cloud). |
nextend | Extend curve fitting window, until |
maxExtendMonth | Search good or marginal good values in previous and
subsequent |
minExtendMonth | Extending perid defined by |
minT | (optional). If Tn not provided in |
minPercValid | (optional, default not use). If the percentage of good
and marginal quality points is less than |
use.rough | Whether to use rough fitting smoothed time-series as input?
If |
use.y0 | boolean. whether to use original |
... | other parameters passed to curve fitting function. |
List of phenofit fitting object.
#> Error in library(phenofit): there is no package called ‘phenofit’#> Warning: data set ‘MOD13A1’ not found#> Error in tidy_MOD13(MOD13A1$dt): object 'MOD13A1' not foundst <- MOD13A1$st#> Error in eval(expr, envir, enclos): object 'MOD13A1' not founddate_start <- as.Date('2013-01-01') date_end <- as.Date('2016-12-31') sitename <- 'CA-NS6' # df$site[1] d <- df[site == sitename & (date >= date_start & date <= date_end), ]#> Error in eval(expr, envir, enclos): object 'site' not foundsp <- st[site == sitename, ]#> Error in eval(expr, envir, enclos): object 'st' not foundsouth <- sp$lat < 0#> Error in eval(expr, envir, enclos): object 'sp' not foundnptperyear <- 23 # global parameter IsPlot = TRUE print = FALSE ypeak_min = 0.05 wFUN = wTSM # add one year in head and tail # d <- add_HeadTail(d, south = south, nptperyear = nptperyear) INPUT <- check_input(d$t, d$y, d$w, QC_flag = d$QC_flag, nptperyear = nptperyear, south = south, maxgap = nptperyear/4, alpha = 0.02, wmin = 0.2)#> Error in check_input(d$t, d$y, d$w, QC_flag = d$QC_flag, nptperyear = nptperyear, south = south, maxgap = nptperyear/4, alpha = 0.02, wmin = 0.2): object 'd' not found# Rough fitting and growing season dividing brks2 <- season_mov(INPUT, rFUN = smooth_wWHIT, wFUN = wFUN, plotdat = d, IsPlot = IsPlot, print = FALSE, IsPlot.OnlyBad = FALSE)#> Error in season_mov(INPUT, rFUN = smooth_wWHIT, wFUN = wFUN, plotdat = d, IsPlot = IsPlot, print = FALSE, IsPlot.OnlyBad = FALSE): object 'INPUT' not found# Fine fitting fit <- curvefits( INPUT, brks2, methods = c("AG", "Beck", "Elmore", "Zhang"), #,"klos", "Gu" wFUN = wFUN, nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minPercValid = 0.2)#> Error in curvefits(INPUT, brks2, methods = c("AG", "Beck", "Elmore", "Zhang"), wFUN = wFUN, nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minPercValid = 0.2): object 'INPUT' not found