Skip to content

Commit

Permalink
Additions to randomVariables real script
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar2812 committed Jan 5, 2017
1 parent 8bd60e8 commit 6184d6f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/randomvariables.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import io.github.mandar2812.dynaml.DynaMLPipe._
import io.github.mandar2812.dynaml.analysis.{DifferentiableMap, PushforwardMap}
import io.github.mandar2812.dynaml.pipes.DataPipe
import io.github.mandar2812.dynaml.probability.GaussianRV
import io.github.mandar2812.dynaml.probability.{GaussianRV, RandomVariable}
import spire.implicits._
import com.quantifind.charts.Highcharts._
import io.github.mandar2812.dynaml.probability.distributions.SkewGaussian
/**
* @author mandar date 22/12/2016.
*/

val g = GaussianRV(0.0, 0.25)

val sg = RandomVariable(SkewGaussian(1.0, 0.0, 0.25))

implicit val detImpl = identityPipe[Double]

val h: PushforwardMap[Double, Double, Double] = PushforwardMap(
Expand All @@ -21,5 +24,12 @@ val h: PushforwardMap[Double, Double, Double] = PushforwardMap(

val p = h->g

val q = h->sg

val y = Array.tabulate[(Double, Double)](100)(n => (n*0.03, q.underlyingDist.pdf(n*0.03)))
spline(y.toIterable)
hold()
val x = Array.tabulate[(Double, Double)](100)(n => (n*0.03, p.underlyingDist.pdf(n*0.03)))
spline(x.toIterable)
unhold()
legend(List("Log Skew Gaussian", "Log Gaussian"))

0 comments on commit 6184d6f

Please sign in to comment.