trait Stochastic[+A] extends AnyRef
A random variable of concrete type A.
- A
the concrete type of the random variable
- Alphabetic
- By Inheritance
- Stochastic
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
sample: A
Returns a sample from the random variable.
Returns a sample from the random variable.
- returns
a sample from the random variable
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter(f: (A) ⇒ Boolean): Stochastic[A]
Creates a new random variable by filtering the values of the underlying random variable.
Creates a new random variable by filtering the values of the underlying random variable. This implements rejection sampling. Same as
withFilter.- f
the filter function
- returns
a random variable
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (A) ⇒ Stochastic[B]): Stochastic[B]
Creates a new random variable by applying a stochastic function to the underlying random variable.
Creates a new random variable by applying a stochastic function to the underlying random variable. A sample from the new random variable is a sample from the random variable created by applying
fto a sample of the underlying random variable.- B
the concrete type of the output of stochastic function
fand of the new random variable- f
the stochastic function to apply
- returns
a random variable
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[B](f: (A) ⇒ B): Stochastic[B]
Creates a new random variable by applying a deterministic function to the underlying random variable.
Creates a new random variable by applying a deterministic function to the underlying random variable. Samples from the new random variable will be samples from the underlying one to which function
fis applied.- B
the output type of function
fand the concrete type of the new random variable- f
the deterministic function to apply
- returns
a random variable
-
def
markov[B >: A](f: (B) ⇒ Stochastic[B]): Stochastic[Stream[B]]
Creates a new random variable which represents a Markov chain of the first order.
Creates a new random variable which represents a Markov chain of the first order. The relationship between two consecutive terms in the chain is defined by the stochastic function
f.- B
the type of the next term (mainly for covariance)
- f
the distribution of the next term given the previous one
- returns
a random variable in the space of infinite sequences of
B.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
repeat[B >: A, F[_]](f: (⇒ B) ⇒ F[B]): Stochastic[F[B]]
Creates a new random variable which is a collection or any higher-kinded type of independent and identically distributed copies of the underlying random variable.
Creates a new random variable which is a collection or any higher-kinded type of independent and identically distributed copies of the underlying random variable. This can be used to create Lists or even Streams of random variables.
- B
the type of the new random variable (mainly for covariance)
- F
the type of the collection or higher-kinded type
- f
the function that performs the lifting
- returns
a random variable
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withFilter(f: (A) ⇒ Boolean): Stochastic[A]
Creates a new random variable by filtering the values of the underlying random variable.
Creates a new random variable by filtering the values of the underlying random variable. This implements rejection sampling. Same as
filter, but needed forfor-comprehensions.- f
the filter function
- returns
a random variable