holt_winters

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HoltWinters

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

HoltWinters forecasts a series into the future. This is done using the Holt-Winters damped method.

  1. The initial values are calculated using a SSE.
  2. The series is forecast into the future using the iterative relations.

func New

func New(n, s int, withFit bool, alloc memory.Allocator) *HoltWinters

New creates a new HoltWinters. HoltWinters uses the given allocator for memory tracking purposes, and in order to build its result.

func (*HoltWinters) Do

func (r *HoltWinters) Do(vs *array.Float64) *array.Float64

Do returns the points generated by the HoltWinters algorithm given a dataset.

type Optimizer

type Optimizer struct {
	// Maximum number of iterations.
	MaxIterations int
	// Reflection coefficient.
	Alpha,

	Beta,

	Gamma float64
	// contains filtered or unexported fields
}

Optimizer is an implementation of the Nelder-Mead optimization method. Based on work by Michael F. Hutt: http://www.mikehutt.com/neldermead.html

func NewOptimizer

func NewOptimizer(alloc memory.Allocator) *Optimizer

NewOptimizer returns a new instance of Optimizer with all values set to the defaults.

func (*Optimizer) Optimize

func (o *Optimizer) Optimize(
	objfunc func(*mutable.Float64Array) float64,
	start *mutable.Float64Array,
	epsilon,
	scale float64,
) (float64, *mutable.Float64Array)

Optimize applies the Nelder-Mead simplex method with the Optimizer's settings. Optimize returns a new Float64Array, it is responsibility of the caller to Release it.

Jump to

Keyboard shortcuts

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