Public
Edited
Mar 25, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
timeSeries = {
const runs = []
for (let r = 0; r < numberOfRuns; r = r+1) {
const run = []
run[0] = {time: timeSteps[0], value: initialValue }
const noiseSteps = Array.from({length: numberOfSamples}, d3.randomNormal(0, Math.sqrt(timeStepDuration)))
for(let i = 1;i < numberOfSamples+1;i = i + 1){
const previousValue = run[i-1]['value']
run[i] = {time: timeSteps[i], value: (muStep * previousValue) + (previousValue * sigma * noiseSteps[i-1]) }
}
runs.push(run)
}
return runs
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
growthRateStep = Math.pow(growthRate, timeStepDuration)
Insert cell
finalValues = timeSeries.map((run) => (run[numberOfSamples-1]['value']))
Insert cell
finalEnsembleAverage = finalValues.reduce((a, b) => (a + b))/numberOfRuns
Insert cell
finalExpectEnsembleAverage = initialValue * Math.pow(mu, timePeriod)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pachinko(noiseSteps2)
Insert cell
test= Math.sqrt(0.1)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more