Platform
Resources
Pricing
Sign in
Get started
Zihou Ng
software engineer
Workspace
Fork
Public
By
Zihou Ng
Edited
Jan 12, 2023
ISC
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data
=
{
const
xs
=
d3
.
range
(
100
)
.
map
(
x
=>
x
*
Math
.
PI
)
,
ys
=
xs
.
map
(
f
)
;
return
{
xs
,
ys
,
ewmabc
:
ys
.
map
(
ewmabc
(
beta
)
)
,
ewma
:
ys
.
map
(
ewma
(
beta
)
)
}
;
}
Insert cell
f
=
x
=>
Math
.
cos
(
x
)
*
Math
.
exp
(
.01
*
x
)
-
10
*
Math
.
exp
(
-
.01
*
x
)
Insert cell
ewma
=
(
beta
=
.8
)
=>
{
let
z
=
0
;
return
x
=>
z
=
beta
*
z
+
(
1
-
beta
)
*
x
;
}
Insert cell
ewmabc
=
(
beta
=
.8
,
t
=
1
)
=>
{
let
z
=
0
,
bc
=
beta
**
(
t
-
1
)
+
1e-8
;
return
x
=>
(
z
=
beta
*
z
+
(
1
-
beta
)
*
x
)
/
(
1
-
(
bc
*=
beta
)
)
;
}
Insert cell
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
beta
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
f
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ewma
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ewmabc
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML