Skip to content

Commit 61e23dc

Browse files
committed
Student T Process Mixture
1 parent 2303079 commit 61e23dc

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/StochasticProcessModel.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ package io.github.mandar2812.dynaml.models
2121
import breeze.linalg.DenseVector
2222
import breeze.stats.distributions.{ContinuousDistr, Moments}
2323
import io.github.mandar2812.dynaml.kernels.CovarianceFunction
24+
import io.github.mandar2812.dynaml.models.gp.{AbstractGPRegressionModel, GaussianProcessMixture}
25+
import io.github.mandar2812.dynaml.models.stp.{AbstractSTPRegressionModel, MVStudentsTModel, MVTMixture, StudentTProcessMixture}
2426
import io.github.mandar2812.dynaml.pipes.DataPipe
2527
import io.github.mandar2812.dynaml.probability._
2628
import io.github.mandar2812.dynaml.probability.distributions.HasErrorBars
@@ -150,6 +152,26 @@ I, Y, W <: ContinuousMixtureRV[_, _]] extends
150152
ContinuousProcessModel[Seq[(I, Y)], I, Y, W]
151153

152154

155+
object StochasticProcessMixtureModel {
156+
157+
def apply[T, I: ClassTag](
158+
component_processes: Seq[AbstractGPRegressionModel[T, I]],
159+
weights: DenseVector[Double]) =
160+
new GaussianProcessMixture[T, I](component_processes, weights)
161+
162+
def apply[T, I: ClassTag](
163+
component_processes: Seq[AbstractSTPRegressionModel[T, I]],
164+
weights: DenseVector[Double]) =
165+
new StudentTProcessMixture[T, I](component_processes, weights)
166+
167+
168+
def apply[T, I: ClassTag](
169+
component_processes: Seq[MVStudentsTModel[T, I]],
170+
weights: DenseVector[Double]) =
171+
new MVTMixture[T, I](component_processes, weights)
172+
173+
}
174+
153175
/**
154176
* A process which is a multinomial mixture of
155177
* continuous component processes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.github.mandar2812.dynaml.models.stp
2+
3+
import breeze.linalg.DenseVector
4+
import io.github.mandar2812.dynaml.algebra.{PartitionedPSDMatrix, PartitionedVector}
5+
import io.github.mandar2812.dynaml.analysis.InnerProductPV
6+
import io.github.mandar2812.dynaml.models.GenContinuousMixtureModel
7+
import io.github.mandar2812.dynaml.probability.MultStudentsTPRV
8+
import io.github.mandar2812.dynaml.probability.distributions.BlockedMultivariateStudentsT
9+
import spire.algebra.VectorSpace
10+
11+
import scala.reflect.ClassTag
12+
13+
/**
14+
* @author mandar2812 date 21/06/2017.
15+
* */
16+
class StudentTProcessMixture[T, I: ClassTag](
17+
override val component_processes: Seq[AbstractSTPRegressionModel[T, I]],
18+
override val weights: DenseVector[Double]) extends
19+
GenContinuousMixtureModel[
20+
T, I, Double, PartitionedVector,
21+
PartitionedPSDMatrix, BlockedMultivariateStudentsT,
22+
MultStudentsTPRV, AbstractSTPRegressionModel[T, I]](
23+
component_processes, weights) {
24+
25+
protected val blockSize: Int = component_processes.head._blockSize
26+
27+
override protected def toStream(y: PartitionedVector): Stream[Double] = y.toStream
28+
29+
override protected def getVectorSpace(num_dim: Int): VectorSpace[PartitionedVector, Double] =
30+
InnerProductPV(num_dim, blockSize)
31+
}

0 commit comments

Comments
 (0)