Skip to content

Commit

Permalink
Implement lognormal
Browse files Browse the repository at this point in the history
  • Loading branch information
thouska committed Oct 31, 2022
1 parent 0671c66 commit af50404
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/spotpy/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import numpy as np
import numpy.random as rnd
from scipy.stats import loguniform


class _ArgumentHelper(object):
Expand Down Expand Up @@ -290,7 +291,27 @@ def __init__(self, *args, **kwargs):
"""
super(Uniform, self).__init__(rnd.uniform, "Uniform", *args, **kwargs)

class Loguniform(Base):
"""
A specialization of the Base parameter for loguniform distributions
"""

__rndargs__ = "low", "high"

def __init__(self, *args, **kwargs):
"""
:name: Name of the parameter
:low: lower bound of the uniform distribution
:high: higher bound of the uniform distribution
:step: (optional) number for step size required for some algorithms,
eg. mcmc need a parameter of the variance for the next step
default is median of rndfunc(*rndargs, size=1000)
:optguess: (optional) number for start point of parameter
default is quantile(0.5) - quantile(0.4) of
rndfunc(*rndargs, size=1000)
"""
super(Loguniform, self).__init__(loguniform, "Loguniform", *args, **kwargs)

class List(Base):
"""
A specialization to sample from a list (or other iterable) of parameter sets.
Expand Down

0 comments on commit af50404

Please sign in to comment.