BLRPM.est: BLRPM Parameter Estimation function

Description Usage Arguments Value Author(s) Examples

View source: R/BLRPM.R

Description

BLRPM.est estimates the five Bartlett-Lewis rectangular pulse model parameters lambda,gamma,beta,eta,mux for a given time series data. At first the time series statistics at given accumulation levels acc.vals are calculated. These statistics are given over to the parameter estimation algorithm together with parameter starting values par. An objective function O.Fun can be specified, default is BLRPM.OF. In addition the weights for different statistics and accumulation levels weights.mean, weights.var, weights.cov, weights.pz can be specified. For the BLRPM objective function the user can select the measure of distance between observation and model with OF: =1 quadratic, =2: quad extended, =3: absolute, =4: abs extended. A scale parameter controls different cases in the objective function for differences in the scale of duration parameters gamma and eta. If a debugging is wished, debug can be set to TRUE and a log file is created in working directory. Several optim parameters can be also defined. For specifics see ?optim.

Usage

1
2
3
BLRPM.est(RR,acc.vals,pars.in,O.Fun,
weights.mean,weights.var,weights.cov,weights.pz,OF,debug,
scale,method,lower,upper,use.log,maxit,ndeps,trace)

Arguments

RR

vector of a precipitation time series

acc.vals

vector of different accumulation levels at which statistics are to be calculated

pars.in

vector specifying starting values of lambda,gamma,beta,eta,mux for optimization

O.Fun

objective function to be used during optimization

weights.mean

value for weight for mean value at first accumulation level

weights.var

vecotr of weights for variances, has to have length(acc.vals)

weights.cov

vecotr of weights for covariances, has to have length(acc.vals)

weights.pz

vecotr of weights for probability of zero rainfall, has to have length(acc.vals)

OF

value specifying the type of objective function. 1: quadratic, 2: quad symmetrized, 3: absolute, 4: abs symmetrized Note: quadratic symmetrized proofed to be most effective and fastest

debug

set TRUE if debugging is wished, default FALSE. Creates a log file in working directory

scale

value specifying the scaling between gamma and eta in the objective function

method

character defining the method to be used in optim, preferences are: "Nelder-Mead", "BFGS", "L-BFGS-B"e

lower

vector specifying the lower boundary of parameters for "L-BFGS-B" method

upper

vector specifying the upper boundary of parameters for "L-BFGS-B" method

use.log

logical, set TRUE if logarithmic parameters during optimization should be used. Advantage: zero as lower boundary for parameters

maxit

value specifying the maximum number of itereations durion optimization

ndeps

vector specifying the change for each parameter during one interation step

trace

value specifying output information of optim

Value

$est returns vector of estimated parameters lambda,gamma,beta,eta,mux

$conv returns value of convergence of optimization, see optim for details

$mess returns character message about optimization if using "L-BFGS-B" method

$Z returns value of objective function for estimated parameters

Author(s)

Christoph Ritschel [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
t.sim=240

lambda <- 4/240
gamma <- 1/10
beta <- 0.3
eta <- 2
mux <- 4

pars <- c(lambda,gamma,beta,eta,mux)

sim <- BLRPM.sim(lambda,gamma,beta,eta,mux,t.sim)
est <- BLRPM.est(sim$RR,pars.in=pars,method="BFGS",use.log=TRUE)

BLRPM documentation built on Oct. 6, 2017, 5:08 p.m.

Related to BLRPM.est in BLRPM...