-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cambios interfaz, parte del script de las graficas
- Loading branch information
1 parent
234fe61
commit 04598d7
Showing
4 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const e=2.7182818; | ||
|
||
function fSat(alpha,gamma){ | ||
function f(x){ | ||
return x**alpha/(x**alpha+gamma**alpha); | ||
} | ||
return f; | ||
} | ||
|
||
function fGeoAdStock(theta){ | ||
function f(actual,previous){ | ||
return actual + theta*previous; | ||
} | ||
return f; | ||
} | ||
|
||
function fWeibullAdStock(shape,scale,type='pdf'){ | ||
function pdf(t){ | ||
return scale*shape*(scale*t)**(shape-1)*e**((-1)*(scale*t)**shape); | ||
} | ||
|
||
function cdf(t){ | ||
return 1-e**((-1)*(scale*t)**shape) | ||
} | ||
let funMap = { | ||
'pdf':pdf, | ||
'cdf':cdf | ||
} | ||
function f(actual,previous,t){ | ||
return actual + funMap[type](t)*previous; | ||
} | ||
return f; | ||
} | ||
|
||
function getChart(){ | ||
return document.getElementById('Grafica'); | ||
} | ||
|
||
function genXRange(min,max,step){ | ||
let xValues = []; | ||
for (let x=min; x<=max; x+=step){xValues.push(x);} | ||
return xValues; | ||
} | ||
|
||
function getGraphData(xValues,yFunc){ | ||
let dataList = []; | ||
let previous = 0; | ||
for (let i=1; i<xValues.length; i++){ | ||
let actual = x[i] | ||
data = {'x':x,'y':yFunc(x)}; | ||
dataList.push(data); | ||
} | ||
return {'dataset':dataList} | ||
} | ||
|
||
function plotGeometric(){ | ||
let config = { | ||
'type':'line', | ||
'data': [], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters