evidence

package module
v0.0.0-...-8a31bdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-evidence

A library for working with evidence theory models.

Requires Go 1.10+

GoDoc Widget Build Widget Coverage Widget Maintainability Widget


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func K

func K(focals ...string) functionKey

K generates a mass key from a set of string values.

Types

type BeliefFunction

type BeliefFunction struct {
	Function
}

A BeliefFunction is a mapping of possibilities to levels of support/belief.

func (*BeliefFunction) Valid

func (bf *BeliefFunction) Valid() bool

Valid verifies that a given BeliefFunction meets the defined requirements for one. All probabilities must be in the range 0.0 >= p >= 1.0.

type CommonalityFunction

type CommonalityFunction struct {
	Function
}

A CommonalityFunction is a mapping of possibilities to levels of commonality.

func (*CommonalityFunction) Valid

func (pf *CommonalityFunction) Valid() bool

Valid verifies that a given CommonalityFunction meets the defined requirements for one. All probabilities must be in the range 0.0 >= p >= 1.0.

type Function

type Function struct {
	// contains filtered or unexported fields
}

A Function is a mapping of possibilities to values in the 0.0 to 1.0 range, usually probabilities.

func (*Function) Get

func (f *Function) Get(key functionKey) (probability float64)

Get assigns a probability to a given possibility.

func (*Function) Possibilities

func (f *Function) Possibilities() (fks []functionKey)

Possibilities returns a lexically sorted slice of possibilities

func (*Function) Powerset

func (f *Function) Powerset() (fks []functionKey)

Powerset returns all combinations of function keys for this Function.

func (*Function) Select

func (f *Function) Select(fks []functionKey) (nf *Function)

Select returns a new function containing just the specified subset.

func (*Function) Set

func (f *Function) Set(key functionKey, probability float64) (err error)

Set assigns a probability to a given possibility.

type MassFunction

type MassFunction struct {
	Function
}

A MassFunction is a mapping of possibilities to probabilities.

func CombineConjunctive

func CombineConjunctive(mfns ...*MassFunction) *MassFunction

CombineConjunctive takes two or more MassFunctions and returns a new MassFunction according to Dempster's rule of combination. Returns nil if no MassFunctions are provided.

func CombineDisjunctive

func CombineDisjunctive(mfns ...*MassFunction) (cf *MassFunction)

CombineDisjunctive takes two or more MassFunctions and returns a new MassFunction according to the disjunctive rule of combination. Returns nil if no MassFunctions are provided.

func CombineMurphyAverage

func CombineMurphyAverage(mfns ...*MassFunction) (cf *MassFunction)

CombineMurphyAverage takes two or more MassFunctions and returns a new MassFunction according to Murphy's rule of combination, first averaging the masses and then performing a conjunctive combination. Returns nil if no MassFunctions are provided.

func (*MassFunction) Belief

func (mf *MassFunction) Belief() (bf *BeliefFunction)

Belief converts a MassFunction into a BeliefFunction

func (*MassFunction) Commonality

func (mf *MassFunction) Commonality() (cf *CommonalityFunction)

Commonality converts a MassFunction into a CommonalityFunction

func (*MassFunction) Entropy

func (mf *MassFunction) Entropy() float64

Entropy returns the Deng entropy for the MassFunction.

func (*MassFunction) FocalKeys

func (mf *MassFunction) FocalKeys() (fks []functionKey)

FocalKeys returns a slice containing just the focal keys

func (*MassFunction) Focals

func (mf *MassFunction) Focals() (f *Function)

Focals returns a function containing just the focal set

func (*MassFunction) Pignistic

func (mf *MassFunction) Pignistic() (nmf *MassFunction)

Pignistic returns a new MassFunction after application of the pignistic transformation containing only singletons.

func (*MassFunction) Plausibility

func (mf *MassFunction) Plausibility() (pf *PlausibilityFunction)

Plausibility converts a MassFunction into a PlausibilityFunction

func (*MassFunction) String

func (mf *MassFunction) String() string

func (*MassFunction) Valid

func (mf *MassFunction) Valid() bool

Valid verifies that a given MassFunction meets the defined requirements for one. All probabilities must be in the range 0.0 >= p >= 1.0, and all probabilities must ultimately sum to 1.0.

type PlausibilityFunction

type PlausibilityFunction struct {
	Function
}

A PlausibilityFunction is a mapping of possibilities to levels of plausibility.

func (*PlausibilityFunction) Valid

func (pf *PlausibilityFunction) Valid() bool

Valid verifies that a given PlausibilityFunction meets the defined requirements for one. All probabilities must be in the range 0.0 >= p >= 1.0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL