uscale_search: Searching for the best values of u_scale for ruin_prob_ls

Description Usage Arguments Details Value Examples

View source: R/main_uscale_search.R

Description

It turns out with limited precision, scale change in ruin_prob_ls has a huge impact on the calculation. With good u_scale, reliable ruin_prob_ls is computed.

Usage

1
uscale_search(n = 100, .cand = NULL, ...)

Arguments

n

Numerical of length 1, valued at least 2. Default to be 100. Ignore if .cand is used.

.cand

Numerical vector of length at least 2. Candidates for u_scale in ruin_prob_ls. Automatically generated using n if not provided.

...

Other arguments to be passed to ruin_prob_ls, i.e. u, t, c, lambda and family.

Details

This function tries different values of u_scale and attach the corresponding ruin_prob_ls value and the error of ruin_prob_ls(u=0,t=Inf). A table is then return to assist to either chosing u_scale for a separate run of ruin_prob_ls, or decision for a value for the ruin probability (if the top values are close to each other).

It can take some time depending on the value of n and the family used.

Value

A data.frame object with columns "u_scale", "res" and "err", sorted in the absolute value of "err".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(pruin)

## reliable example (small "err", top "res" are close and reasonable)
e <- exponential()(beta=1)
uscale_search(n=20,u=10,t=2,c=1.1,lambda=1,family=e)

## unreliable example (large "err", "res" unreasonable)
g <- gig()(a=0.32497,b=0.61543,alpha=-0.75)
uscale_search(n=20,u=4,t=4,c=1.1,lambda=1,family=g)

## default n is 100. It takes some time to run
## Not run: 
  uscale_search(u=4,t=4,c=1.1,lambda=1,family=g) # no need to specify n

## End(Not run)

haydo1117/pruin documentation built on Feb. 12, 2022, 11:08 a.m.