Skip to content

Commit

Permalink
Moved the scripts from dynaml-core to top level directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar2812 committed Dec 20, 2016
1 parent 14f8412 commit b91cd00
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import io.github.mandar2812.dynaml.analysis.VectorField
import io.github.mandar2812.dynaml.models.gp.GPRegression
import io.github.mandar2812.dynaml.optimization.{CoupledSimulatedAnnealing, GridSearch}
import breeze.stats.distributions.Uniform
import io.github.mandar2812.dynaml.kernels.{MLPKernel, PeriodicKernel}
import io.github.mandar2812.dynaml.kernels.{DiracKernel, MLPKernel, PeriodicKernel, RBFKernel}
import io.github.mandar2812.dynaml.pipes.DataPipe
import io.github.mandar2812.dynaml.probability._
import io.github.mandar2812.dynaml.probability.distributions.MultivariateUniform
import spire.implicits._
import com.quantifind.charts.Highcharts._


val num_features = 1
Expand All @@ -19,7 +21,6 @@ val iidXPrior = IIDRandomVarDistr(xPrior) _

val (training, test, noiseLevel) = (100, 500, 0.05)


val likelihood = DataPipe((x: Double) => GaussianRV(math.atan(1000.0*x*x*x), noiseLevel))

val model = ProbabilityModel(xPrior, likelihood)
Expand Down Expand Up @@ -65,7 +66,7 @@ title("Comparison of Noisy Data versus inferred function")
legend(List("Test Data samples", "Co-allocation/training data samples", "GP samples"))


val rvFTanH = MeasurableFunction(xPrior)(DataPipe((x: Double) => math.atan(1000.0*x*x*x)))
val rvFTanH = MeasurableFunction(xPrior)((x: Double) => math.atan(1000.0*x*x*x))

//Histogram of test data
histogram(testData.map(_._2))
Expand All @@ -91,7 +92,7 @@ val data2: Stream[(DenseVector[Double], Double)] =

val testData2 = (1 to test).map(_ => model2.sample()).map(c => (DenseVector(c._1), c._2)).toStream

val perKernel = new PeriodicKernel(2.0, 1.5)
//val perKernel = new PeriodicKernel(2.0, 1.5)
val noise = new DiracKernel(noiseLevel)
noise.blocked_hyper_parameters = noise.hyper_parameters

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import breeze.linalg.DenseVector
import io.github.mandar2812.dynaml.analysis.VectorField
import io.github.mandar2812.dynaml.kernels._
import io.github.mandar2812.dynaml.DynaMLPipe._
import io.github.mandar2812.dynaml.examples.AbottPowerPlant

implicit val ev = VectorField(6)
implicit val sp = genericReplicationEncoder[DenseVector[Double]](2)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import breeze.stats.distributions._
import io.github.mandar2812.dynaml.kernels.PeriodicKernel
import io.github.mandar2812.dynaml.models.gp.GPRegression
import io.github.mandar2812.dynaml.optimization.GridSearch
import io.github.mandar2812.dynaml.probability.{GaussianRV, IIDRandomVarDistr, ProbabilityModel, RandomVariable}
import io.github.mandar2812.dynaml.pipes.DataPipe
import io.github.mandar2812.dynaml.probability._
import spire.implicits._
import com.quantifind.charts.Highcharts._


val p = RandomVariable(new Beta(7.5, 7.5))

val coinLikelihood = DataPipe((p: Double) => new BinomialRV(500, p))
val coinLikelihood = DataPipe((p: Double) => BinomialRV(500, p))

val c_model = ProbabilityModel(p, coinLikelihood)

Expand Down

0 comments on commit b91cd00

Please sign in to comment.