# tlmrgpa: Compute Select TL-moment ratios of the Generalized Pareto

### Description

This function computes select TL-moment ratios of the Generalized Pareto distribution for defaults of ξ = 0 and α = 1. This function can be useful for plotting the trajectory of the distribution on TL-moment ratio diagrams of τ^{(t_1,t_2)}_2, τ^{(t_1,t_2)}_3, τ^{(t_1,t_2)}_4, τ^{(t_1,t_2)}_5, and τ^{(t_1,t_2)}_6. In reality, τ^{(t_1,t_2)}_2 is dependent on the values for ξ and α. If the message

 `1` ```Error in integrate(XofF, 0, 1) : the integral is probably divergent ```

occurs then careful adjustment of the shape parameter κ parameter range is very likely required. Remember that TL-moments with nonzero trimming permit computation of TL-moments into parameter ranges beyond those recognized for the usual (untrimmed) L-moments.

### Usage

 ```1 2``` ```tlmrgpa(trim=NULL, leftrim=NULL, rightrim=NULL, xi=0, alpha=1, kbeg=-.99, kend=10, by=.1) ```

### Arguments

 `trim` Level of symmetrical trimming to use in the computations. Although `NULL` in the argument list, the default is 0—the usual L-moment ratios are returned. `leftrim` Level of trimming of the left-tail of the sample. `rightrim` Level of trimming of the right-tail of the sample. `xi` Location parameter of the distribution. `alpha` Scale parameter of the distribution. `kbeg` The beginning κ value of the distribution. `kend` The ending κ value of the distribution. `by` The increment for the `seq()` between `kbeg` and `kend`.

### Value

An R `list` is returned.

 `tau2` A vector of the τ^{(t_1,t_2)}_2 values. `tau3` A vector of the τ^{(t_1,t_2)}_3 values. `tau4` A vector of the τ^{(t_1,t_2)}_4 values. `tau5` A vector of the τ^{(t_1,t_2)}_5 values. `tau6` A vector of the τ^{(t_1,t_2)}_6 values.

### Note

The function uses numerical integration of the quantile function of the distribution through the `theoTLmoms` function.

### Author(s)

W.H. Asquith

`quagpa`, `theoTLmoms`

### Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43``` ```## Not run: tlmrgpa(leftrim=7, rightrim=2, xi=0, alpha=31) tlmrgpa(leftrim=7, rightrim=2, xi=143, alpha=98) # another slow example ## End(Not run) ## Not run: # Plot and L-moment ratio diagram of Tau3 and Tau4 # with exclusive focus on the GPA distribution. plotlmrdia(lmrdia(), autolegend=TRUE, xleg=-.1, yleg=.6, xlim=c(-.8, .7), ylim=c(-.1, .8), nolimits=TRUE, nogev=TRUE, noglo=TRUE, nope3=TRUE, nogno=TRUE, nocau=TRUE, noexp=TRUE, nonor=TRUE, nogum=TRUE, noray=TRUE, nouni=TRUE) # Compute the TL-moment ratios for trimming of one # value on the left and four on the right. Notice the # expansion of the kappa parameter space from k > -1. J <- tlmrgpa(kbeg=-3.2, kend=50, by=.05, leftrim=1, rightrim=4) lines(J\$tau3, J\$tau4, lwd=2, col=2) # RED CURVE # Notice the gap in the curve near tau3 = 0.1 # Compute the TL-moment ratios for trimming of four # values on the left and one on the right. J <- tlmrgpa(kbeg=-1.6, kend=8, leftrim=4, rightrim=1) lines(J\$tau3, J\$tau4, lwd=2, col=3) # GREEN CURVE # The kbeg and kend can be manually changed to see how # the resultant curve expands or contracts on the # extent of the L-moment ratio diagram. ## End(Not run) ## Not run: # Following up, let us plot the two quantile functions LM <- vec2par(c(0,1,0.99), type='gpa', paracheck=FALSE) TLM <- vec2par(c(0,1,3.00), type='gpa', paracheck=FALSE) F <- nonexceeds() plot(qnorm(F), quagpa(F, LM), type="l") lines(qnorm(F), quagpa(F, TLM, paracheck=FALSE), col=2) # Notice how the TLM parameterization runs off towards # infinity much much earlier than the conventional # near limits of the GPA. ## End(Not run) ```

Search within the lmomco package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.