Skip to content

Commit

Permalink
doc: updated expected perfs and model description
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoudan committed Nov 27, 2023
1 parent d3afe5d commit c6faa06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ <h1>Going NUTS with WASM!</h1>
target="_blank">here</a>.

FYI with the stations <a href="https://www.ncdc.noaa.gov/cdo-web/datasets/GHCND/stations/GHCND:USW00023293/detail"
target="_blank">USW00023293</a> (San Jose, CA), the sampling takes about 10 seconds. If you don't
want to wait, use the fake data provided and just run the sampling.
target="_blank">USW00023293</a> (San Jose, CA), the downloading takes few seconds and the sampling less than 1s.
If you don't want to wait, use the fake data provided and just run the sampling.
</div>

<input type="text" id="input_url" value="https://noaa-ghcn-pds.s3.amazonaws.com/csv/by_station/USW00023293.csv" />
Expand Down Expand Up @@ -179,11 +179,11 @@ <h1>Going NUTS with WASM!</h1>
intercept
(alpha) and the slope (beta). Sigma has a a flat prior.
<p class="equation">
TMAX[DATE-DATE0] ~ Normal(alpha + beta * (DATE-DATE0), sigma) <br />
TMAX[DATE-DATEM] ~ Normal(alpha + beta * (DATE-DATEM), sigma) <br />
alpha ~ Normal(0, 10) <br />
beta ~ Normal(0, 10) <br />
sigma ~ Uniform <br />
DATE0 is the first date in the dataset.
DATEM is the mean of the dates in the dataset.
</p>
Beta is then the trend in C/years.
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ pub fn run_with(

// Use the middle of the time period as reference
// to prevent strong correlations between alpha and beta
let x0 = x.iter().sum::<f64>() / x.len() as f64;
let x_m = x.iter().sum::<f64>() / x.len() as f64;

let x = x.iter().map(|x| x - x0).collect::<Vec<_>>();
let x = x.iter().map(|x| x - x_m).collect::<Vec<_>>();

let model = Regression::new(x.clone(), y.clone());

Expand Down

0 comments on commit c6faa06

Please sign in to comment.