GithubHelp home page GithubHelp logo

spedygiorgio / mbbefd Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 7.0 4.31 MB

Destruction rate modeling with the Maxwell Boltzmann Bose Einstein Fermi Dirac (MBBEFD) distribution

R 84.87% C++ 4.51% TeX 10.61%
actuarial reinsurance r destruction-rate-modeling cran

mbbefd's People

Contributors

aursiber avatar dutangc avatar mages avatar spedygiorgio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mbbefd's Issues

markus issue

Hi Giorgio,

I run into a problem with the function mbbefdExposure. It doesn’t seem to like parameter of c>4.1, in particular I can’t reproduce the Lloyd’s curve (c=5):

mbbefdExposure(0.5, b=swissRe(5.0)['b'], g=swissRe(5.0)['g'])
b
NaN
Warning messages:
1: In log(a + b^x) : NaNs produced
2: In log(a + b) : NaNs produced

I ended up writing the following function, taken from the Bernegger paper:

mbbefdCurve <- function(x, C){
g <- exp((0.78 + 0.12_C)C)
b <- exp(3.1 - 0.15
(1+C)_C)
if(identical(g, 1) | identical(b, 0))
x
if(identical(b, 1) & g > 1)
log(1+(g-1)_x)/log(g)
if(identical(b_g, 1) & g>1)
(1-b^x)/(1-b)
else
log(((g-1)_b + (1-g_b)_b^x)/(1-b))/log(g_b)
}

port all function to roxygen2

Hi, Cran says:
so I would move all the help into roxygen2 files.

Dear maintainers,

This concerns CRAN packages maintained by one of you, see the long list
at the end of this message.

These packages document package metadata (specifically, package
versions) in their *-package Rd file(s) which have gotten out of sync
with the actual package metadata in the DESCRIPTION file.

Most likely, these Rd files were generated by older versions of
utils::promptPackage() (maybe via utils::package.skeleton()), which
generated package documentation shells/skeletons with copies of the
current package metadata. This was not a good idea, as inevitably such
copies go out of sync with their master values. The R 3.2.0 release
(3 years ago) did

A number of macros have been added in the new 'share/Rd' directory for
use in package overview help pages, and promptPackage() now makes use
of them.

(so that package documentation shells/skeletons generated with current
versions of utils::promptPackage() use Rd macro references to the
package metadata values instead of making copies).

Can you please bring package Rd files "up to date"? The simplest may be
using a current utils::promptPackage() to re-generate the
shell/skeleton, and merge with the content of the current package Rd
file. (In case the updated package Rd file would more or less only
duplicate the package metadata, feel free to drop the package Rd file
from your package sources.)

Best
-k

bug from new release of fitdistrplus

Maybe it has been already solved btw I copy and paste

Dear maintainer,

Presumably following a recent update of 'fitdistrplus', we now see

  • checking R code for possible problems ... NOTE
    fitDR: warning in mledist(x, distr = "mbbefd", start =
    initparmbbefd[[1]], custom.optim = constrOptim.nl, hin =
    constrmbbefd1, control.outer = list(trace = FALSE), gr = grLL):
    partial argument match of ‘gr’ to ‘gradient’
    fitDR: warning in mledist(x, distr = "mbbefd", start =
    initparmbbefd[[2]], custom.optim = constrOptim.nl, hin =
    constrmbbefd2, control.outer = list(trace = FALSE), gr = grLL):
    partial argument match of ‘gr’ to ‘gradient’
  • checking examples ... ERROR
    Running examples in ‘mbbefd-Ex.R’ failed
    The error most likely occurred in:

base::assign(".ptime", proc.time(), pos = "CheckExEnv")

Name: fitDR

Title: Fit of destruction rate models

Aliases: fitDR

Keywords: distribution

** Examples

(1) fit of a one-inflated beta distribution by maximum likelihood estimation

n <- 1e3
set.seed(12345)
x <- roibeta(n, 3, 2, 1/6)

f1 <- fitDR(x, "oibeta", method="mle")
Warning in cbind(as.matrix(f1$vcov), rep(0, npar - 1)) :
number of rows of result is not a multiple of vector length (arg 2)
Warning in rbind(cbind(as.matrix(f1$vcov), rep(0, npar - 1)), c(rep(0, npar - :
number of columns of result is not a multiple of vector length (arg 2)
Error in fitDR(x, "oibeta", method = "mle") :
length of 'dimnames' [1] not equal to array extent
Execution halted

  • checking for unstated dependencies in ‘tests’ ... OK
  • checking tests ... ERROR
    Running the tests in ‘tests/test-beaonre.R’ failed.
    Last 13 lines of output:
    [1] "oistpareto"
    [1] "oibeta"
    Error in fitDR(x, d, method = "mle") :
    length of 'dimnames' [1] not equal to array extent
    Calls: lapply -> FUN -> fitDR
    In addition: Warning messages:
    1: In mledist(data, distname, start, fix.arg, ...) :
    The BFGS method cannot be used with bounds without provided the gradient. The method is changed to L-BFGS-B.
    2: In cov2cor(f1$vcov) :
    diag(.) had 0 or NA entries; non-finite result is doubtful
    3: In cbind(as.matrix(f1$vcov), rep(0, npar - 1)) :
    number of rows of result is not a multiple of vector length (arg 2)
    4: In rbind(cbind(as.matrix(f1$vcov), rep(0, npar - 1)), c(rep(0, npar - :
    number of columns of result is not a multiple of vector length (arg 2)
    Execution halted
  • checking for unstated dependencies in vignettes ... OK
  • checking package vignettes in ‘inst/doc’ ... OK
  • checking re-building of vignette outputs ... WARNING
    Error in re-building vignettes:
    ...
    Loading required package: fitdistrplus
    Loading required package: MASS
    Loading required package: survival
    Loading required package: alabama
    Loading required package: numDeriv
    Package: mbbefd
    Version: 0.8-0
    Date: 2016-02-23 22:30:54
    BugReport: http://github.com/spedygiorgio/mbbefd/issues

Warning in cbind(as.matrix(f1$vcov), rep(0, npar - 1)) :
number of rows of result is not a multiple of vector length (arg 2)
Warning in rbind(cbind(as.matrix(f1$vcov), rep(0, npar - 1)), c(rep(0, npar - :
number of columns of result is not a multiple of vector length (arg 2)
Quitting from lines 682-688 (Introduction_to_mbbefd.Rmd)
Error: processing vignette ‘Introduction_to_mbbefd.Rmd’ failed with diagnostics:
length of ‘dimnames’ [1] not equal to array extent
Execution halted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.