rubythinking 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/r/2_6.R ADDED
@@ -0,0 +1,11 @@
1
+ library(rethinking)
2
+
3
+ globe.qa <- quap(
4
+ alist(
5
+ W ~ dbinom(W + L, p), # Binomial likelihood
6
+ p ~ dunif(0, 1) # uniform prior
7
+ ),
8
+ data = list(W = 6, L = 3)
9
+ )
10
+
11
+ precis(globe.qa)
data/r/2_7.R ADDED
@@ -0,0 +1,5 @@
1
+ f <- 6
2
+ L <- 3
3
+
4
+ curve(dbeta(x, W+1, L+1), from = 0, to = 1)
5
+ curve(dnorm(x, 0.67, 0.16), lty = 2, add = TRUE)
data/r/4.R ADDED
@@ -0,0 +1,2 @@
1
+ # Chapter 4
2
+ library(rethinking)
@@ -0,0 +1,32 @@
1
+ require_relative 'lib/rubythinking/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "rubythinking"
5
+ spec.version = Rubythinking::VERSION
6
+ spec.authors = ["Robin Stammer"]
7
+ spec.email = ["robin.stammer@posteo.de"]
8
+
9
+ spec.summary = %q{Ruby code translations and additional material for the book "Statistical Rethinking" of Richard McElreath}
10
+ spec.description = %q{Ruby code translations and additional material for the book "Statistical Rethinking" of Richard McElreath}
11
+ spec.homepage = "https://github.com/rstammer/rubythinking"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/rstammer/rubythinking"
17
+ spec.metadata["changelog_uri"] = "https://github.com/rstammer/rubythinking"
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(notebooks|test|spec|features)/}) }
23
+ end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_runtime_dependency "vega"
29
+ spec.add_runtime_dependency "distribution"
30
+ spec.add_runtime_dependency "croupier"
31
+ spec.add_runtime_dependency "cmd_stan_rb"
32
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubythinking
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Robin Stammer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-10-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: vega
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: distribution
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: croupier
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: cmd_stan_rb
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Ruby code translations and additional material for the book "Statistical
70
+ Rethinking" of Richard McElreath
71
+ email:
72
+ - robin.stammer@posteo.de
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".DS_Store"
78
+ - ".gitignore"
79
+ - ".ipynb_checkpoints/2H1_2H2-checkpoint.ipynb"
80
+ - ".ipynb_checkpoints/2M1-checkpoint.ipynb"
81
+ - ".ipynb_checkpoints/2M2-checkpoint.ipynb"
82
+ - ".ipynb_checkpoints/2M3-checkpoint.ipynb"
83
+ - ".ruby-version"
84
+ - CODE_OF_CONDUCT.md
85
+ - Gemfile
86
+ - Gemfile.lock
87
+ - LICENSE.txt
88
+ - README.md
89
+ - Rakefile
90
+ - bin/console
91
+ - bin/setup
92
+ - lib/rubythinking.rb
93
+ - lib/rubythinking/distributions.rb
94
+ - lib/rubythinking/distributions/binomial.rb
95
+ - lib/rubythinking/version.rb
96
+ - local_reinstall.sh
97
+ - r/0_all.R
98
+ - r/2_6.R
99
+ - r/2_7.R
100
+ - r/4.R
101
+ - rubythinking.gemspec
102
+ homepage: https://github.com/rstammer/rubythinking
103
+ licenses:
104
+ - MIT
105
+ metadata:
106
+ homepage_uri: https://github.com/rstammer/rubythinking
107
+ source_code_uri: https://github.com/rstammer/rubythinking
108
+ changelog_uri: https://github.com/rstammer/rubythinking
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 2.3.0
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubygems_version: 3.0.9
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: Ruby code translations and additional material for the book "Statistical
128
+ Rethinking" of Richard McElreath
129
+ test_files: []