Skip to content

Commit e9ed971

Browse files
committed
Fixed the notebook startup part. Updated README accordingly.
1 parent 882a35f commit e9ed971

4 files changed

Lines changed: 35 additions & 33 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ To use the demonstration Pluto notebooks, you can add:
3333
[c3e4b0f8] Pluto v0.12.18
3434
[7f904dfe] PlutoUI v0.6.11
3535
```
36+
37+
To run the notebooks, I typically use an `alias`:
38+
```
39+
alias pluto="clear; j -i -e 'using Pkg; import Pluto; Pluto.run()'"
40+
```
41+
and then do:
42+
```
43+
$ cd ~/.julia/dev/ParetoSmoothedImportanceSampling
44+
$ pluto
45+
```
46+
to start Pluto from within that directory.
47+
3648
The cars WAIC example requires RDatasets.jl to be installed and functioning.
3749

3850
### Included functions

notebooks/arsenic.jl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,22 @@ using Markdown
55
using InteractiveUtils
66

77
# ╔═╡ 8183b318-5ebb-11eb-1cd8-a96e8704a378
8-
using Pkg, DrWatson, ParetoSmoothedImportanceSampling
8+
using Pkg, DrWatson
99

10-
# ╔═╡ d4f7a39c-5ebb-11eb-0a37-4b8499832108
10+
# ╔═╡ 686dac30-5ebb-11eb-00f1-434980dba906
1111
begin
12+
@quickactivate "ParetoSmoothedImportanceSamplng"
13+
using ParetoSmoothedImportanceSampling
1214
using StanSample, StatsFuns, StatsPlots
13-
using JSON
15+
using DataFrames, CSV, JSON
16+
end
1417

18+
# ╔═╡ 923212a8-630d-11eb-390f-75d21be80011
19+
begin
1520
ProjDir = joinpath(psis_path, "..", "examples", "arsenic")
1621
include(joinpath(ProjDir, "cvit.jl"))
1722
end;
1823

19-
# ╔═╡ 686dac30-5ebb-11eb-00f1-434980dba906
20-
begin
21-
cd(psis_path)
22-
@quickactivate "ParetoSmoothedImportanceSampling"
23-
pkg"instantiate"
24-
end
25-
2624
# ╔═╡ ca0d916e-5ebe-11eb-3af1-0993bf5b82c8
2725
md" ### Psis_loo."
2826

@@ -125,6 +123,9 @@ begin
125123
sm3 = SampleModel("arsenic_logistic_t", model_str_2)
126124
end;
127125

126+
# ╔═╡ d83916ba-6309-11eb-309b-474efacd9f85
127+
md" ##### Be patient... 10 cross Validations."
128+
128129
# ╔═╡ e70f73aa-5eb8-11eb-1960-bf6731681898
129130
begin
130131
cvitr, cvitst = cvit(n, 10, true)
@@ -160,7 +161,7 @@ end
160161
# ╔═╡ Cell order:
161162
# ╠═8183b318-5ebb-11eb-1cd8-a96e8704a378
162163
# ╠═686dac30-5ebb-11eb-00f1-434980dba906
163-
# ╠═d4f7a39c-5ebb-11eb-0a37-4b8499832108
164+
# ╠═923212a8-630d-11eb-390f-75d21be80011
164165
# ╟─ca0d916e-5ebe-11eb-3af1-0993bf5b82c8
165166
# ╟─2ee71b16-5ebd-11eb-3a7d-4553f2f22274
166167
# ╠═37f06bc2-5ebd-11eb-31f6-65bfa74ea9cf
@@ -177,5 +178,6 @@ end
177178
# ╟─98d7208e-5ebd-11eb-3a64-e568c1ceebc0
178179
# ╟─e86ee35c-5ebd-11eb-1932-ffbde638f11e
179180
# ╠═e86f0ab2-5ebd-11eb-1a0b-6958db3a7435
181+
# ╟─d83916ba-6309-11eb-309b-474efacd9f85
180182
# ╠═e70f73aa-5eb8-11eb-1960-bf6731681898
181183
# ╠═1bf8d5a2-5ebe-11eb-12b3-2501e2f9d288

notebooks/cars.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,22 @@ using Markdown
55
using InteractiveUtils
66

77
# ╔═╡ b9fc511c-6007-11eb-0c6b-1f6871a40710
8-
using Pkg, DrWatson, ParetoSmoothedImportanceSampling
8+
using Pkg, DrWatson
99

10-
# ╔═╡ 20d3ad36-6008-11eb-2f2a-d379b234b0e9
10+
# ╔═╡ 20d377b2-6008-11eb-364a-617b6934ecb2
1111
begin
12+
@quickactivate "ParetoSmoothedImportanceSamplng"
13+
using ParetoSmoothedImportanceSampling
1214
using StanSample, StatsFuns, StatsPlots
13-
using DataFrames, RDatasets
14-
end;
15+
using DataFrames, CSV, RDatasets
16+
end
1517

1618
# ╔═╡ af6b0b20-6008-11eb-2fa1-2f61145ab7db
1719
md"
1820
!!! note
1921
2022
This script assumes that RDatasets.jl is loaded. RDatasets.jl is not included in the dependencies of PSIS.jl (as it would require R to be installed)."
2123

22-
# ╔═╡ 20d377b2-6008-11eb-364a-617b6934ecb2
23-
begin
24-
cd(psis_path)
25-
@quickactivate "ParetoSmoothedImportanceSampling"
26-
pkg"instantiate"
27-
end
28-
2924
# ╔═╡ 20d43cda-6008-11eb-09f0-53489a26110d
3025
df = RDatasets.dataset("datasets", "cars");
3126

@@ -110,7 +105,6 @@ pk_plot(pk)
110105
# ╟─af6b0b20-6008-11eb-2fa1-2f61145ab7db
111106
# ╠═b9fc511c-6007-11eb-0c6b-1f6871a40710
112107
# ╠═20d377b2-6008-11eb-364a-617b6934ecb2
113-
# ╠═20d3ad36-6008-11eb-2f2a-d379b234b0e9
114108
# ╠═20d43cda-6008-11eb-09f0-53489a26110d
115109
# ╠═20e22570-6008-11eb-1565-f13541b41861
116110
# ╠═20e2ebb6-6008-11eb-34f5-61f1ec3d024c

notebooks/roaches.jl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@ using Markdown
55
using InteractiveUtils
66

77
# ╔═╡ dcb4d418-5ec2-11eb-29d8-214f38b4d3ae
8-
using Pkg, DrWatson, ParetoSmoothedImportanceSampling
9-
10-
# ╔═╡ c9e1486c-5e9f-11eb-08ed-671b762dd075
11-
begin
12-
using StanSample, StatsFuns, StatsPlots
13-
using DataFrames
14-
end
8+
using Pkg, DrWatson
159

1610
# ╔═╡ d20c24f8-5ec2-11eb-3d45-d97fedebee8e
1711
begin
18-
cd(psis_path)
1912
@quickactivate "ParetoSmoothedImportanceSamplng"
20-
pkg"instantiate"
13+
using ParetoSmoothedImportanceSampling
14+
using StanSample, StatsFuns, StatsPlots
15+
using DataFrames, CSV
2116
end
2217

2318
# ╔═╡ e3552750-5e9f-11eb-324b-8df36d671c79
@@ -165,7 +160,6 @@ pk_plot(pk2; title="PSIS diagnostic plot for neg-binomial model.", leg=:topright
165160
# ╔═╡ Cell order:
166161
# ╠═dcb4d418-5ec2-11eb-29d8-214f38b4d3ae
167162
# ╠═d20c24f8-5ec2-11eb-3d45-d97fedebee8e
168-
# ╠═c9e1486c-5e9f-11eb-08ed-671b762dd075
169163
# ╠═e3552750-5e9f-11eb-324b-8df36d671c79
170164
# ╠═e3691972-5e9f-11eb-20b2-a766ef562598
171165
# ╠═e371fde4-5e9f-11eb-39ad-8d25ac3034fc

0 commit comments

Comments
 (0)