GithubHelp home page GithubHelp logo

geobosh / stableestim Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 361 KB

R package for estimation of the four parameters of stable distributions. The package also provides functions to compute characteristic functions and tools to run Monte Carlo simulations.

Home Page: https://geobosh.github.io/StableEstim/

R 82.48% TeX 17.52%
r stable-distribution characteristic-functions estimation simulation r-package

stableestim's People

Contributors

geobosh avatar

Watchers

 avatar  avatar

Forkers

pengchengh

stableestim's Issues

Error in IterationControll for algo Cue and IT

Dear Colleagues,
for "Due" and "IT" in the IterationControl only the first value from the theta vector is compared with the value from the previous iteration. Therefore, the following warning is generated for the following sample code:

Code:
StableEstim::Estim_Simulation(rbind(c(0.5,1)),c(4), 4, "GMM", HandleError = TRUE, FctsToApply = StatFcts, saveOutput = TRUE, StatSummary = FALSE, CheckMat = TRUE, tolFailCheck = tolFailure, SeedOptions=NULL,algo = "CueGMM", regularization = "Tikhonov", WeightingMatrix = "OptAsym", t_scheme = "free", alphaReg = 0.005, t_free = seq(0.1,2,length.out=12))

Warning:
Warning messages: 1: In (iter < Control$NbIter) && (RelativeErr > Control$RelativeErrMax) : 'length(x) = 4 > 1' in coercion to 'logical(1)'

Since the functions are all similar in structure, I will explain the error on one example. Let's have a look at the function "ComputeITGMMParametersEstim" in the file "GMMParamsEstim.R".
In line 78 while((iter < Control$NbIter) && (RelativeErr > Control$RelativeErrMax) ) RelativeErr is compared to a numeric value. Before, the value of RelativeErr is also set to a numeric value: RelativeErr=Control$RelativeErrMax+5 . In the first iteration, the When condition works fine while two numeric values are compared. No warning is generated.

However, during the first iteration RelativeErr is assinged a vector: RelativeErr <- abs(CurrentEstimParVal-PrevEstimParVal).

To fix the error, I would suggest the following solution:
Set RelativeErr directly as a vector with length 4:
RelativeErr <- rep(Control$RelativeErrMax + 5, times = 4)

Compare for each value from RelativeErr that it satisfies the iteration condition:
while ((iter < Control$NbIter) && ((RelativeErr[1] > RelativeErrMaxArray) || (RelativeErr[2] > RelativeErrMaxArray) || (RelativeErr[3] > RelativeErrMaxArray) || (RelativeErr[4] > RelativeErrMaxArray) )) {
Yours faithfully,
Cedric Jüssen

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.