VegCurveFit.jl
VegCurveFit.nlminb
— Functionnlminb(start, objective, ...; )
Arguments
args
: Other parameters to objective, e.g. t, y, w, FUNfevalmax, itermax: The default value in fortran is 200 and 150. But they
are set to 1000 at here.
Return
par
objective
convergence
:0
: convergent1
: not convergent
iterations
evaluations
References
David M. Gay (1990), Usage summary for selected optimization routines. Computing Science Technical Report 153, AT&T Bell Laboratories, Murray Hill.
Example
t = Array(1.0:8:366)
y = doubleLog_Beck(par, t)
ypred = doubleLog_Beck(par0, t)
par0 = [0.05, 0.6, 45, 0.1, 200, 0.2]
@time opt_par = nlminb(par0, goal!, doubleLog_Beck!, y, t, ypred,
feval_max = 1000, iter_max = 1000)
VegCurveFit.findpeaks
— Functionfindpeaks(x::AbstractVector{T};
nups::Int=1,
ndowns::Int=nups,
zerostr::Char='0',
peakpat=nothing,
verbose=false,
options...)
Examples
References
VegCurveFit.wBisquare_Kong2023
— FunctionwBisquare(y, yfit, w; iter = 2, wmin, to_upper = true)
Arguments
iter
: not usedoptions
: currently ignored
Bad points
- under the yfit, in the growing season (yfit > 0.3 * A + ymin)
Examples
VegCurveFit.cal_diag
— Functionretrieve the diagonal of the inverse of a banded matrix B
一种带状矩阵对角阵
的快速算法,用于Whittaker smoother
求解。
\[B = (U' * D * U) # Hutchinson 1985, Eq. 3.1 B^(-1) = B * U^(-1)' + (1 - U) * B^(-1) # Hutchinson 1985, Eq. 3.3\]
Arguments
U
: A = L D L' = U' * D * U. NoteU = L'
!
U = [
1 c₁ e₁ f₁ 0
0 1 c₂ e₂ f₂
0 0 1 c₃ e₃
0 0 0 1 c₄
0 0 0 0 1]
U2 = [
c₁ e₁ f₁ 0
c₂ e₂ f₂ 0
c₃ e₃ 0 0
c₄ 0 0 0
0 0 0 0 ]
Dongdong Kong, CUG, 2024-05-07
VegCurveFit.whit2_cv
— FunctionR version Whittaker Cross validation
Whittaker smoothing with second order differences Computation of the hat diagonal (Hutchinson and de Hoog, 1986)
In
: data vector (y), weigths (w), smoothing parameter (lambda)Out
: list with smooth vector (z), hat diagonal (dhat)
#author: Gianluca Frasso and Paul HC Eilers, 2015
#references
- Gianluca Frasso and Paul HC Eilers, L- and V-curves for optimal smoothing, 2015
VegCurveFit.whit2
— Functionwhit2(y::AbstractVector{T}, w::AbstractVector{T2}, lambda::Float64; include_cve=true)
z, cve = whit2(y, w;lambda=2.0) whit2(y, w; lambda) whit2(y, w; lambda)
VegCurveFit.whit2!
— FunctionSecond-order differences Whittaker-Henderson smoothing
LU decompose was used.
Ax = y A = LU, LUx = y let b = Ux
, Lb = y
References
'Smoothing and interpolation with finite differences' Eilers P. H. C, 1994