-
Notifications
You must be signed in to change notification settings - Fork 290
/
censored-api.html
255 lines (212 loc) · 11.8 KB
/
censored-api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<html>
<head>
<title>censored - Incanter 1.4.1 API documentation</title>
<link rel="icon" href="../static/incanter.ico" />
<link rel="shortcut icon" href="../static/incanter.ico" />
<link rel="stylesheet" href="../static/clojure.css" type="text/css" media="all" />
<link rel="stylesheet" href="../static/wiki.css" type="text/css" media="all" />
<link rel="stylesheet" href="../static/internal.css" type="text/css" media="all" />
<style>.menuWrapper{height: 36px;}</style>
<!--[if lte IE 6]>
<link rel="stylesheet" href="http://www.wikispaces.com/_/2009051601/s/internal_ie.css" type="text/css" />
<![endif]-->
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a href="index.html" id="Logo"><img src="../static/clojure-icon.gif" width="100" height="100" alt="Clojure" /></a>
<h1><a href="index.html" id="page-header" title="page header title">Incanter</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<span class="toc-header"><span id="project-name">Incanter</span> <span id="version">1.4.1</span> API</span><br />
<ul>
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
<div class="NamespaceTOC">
<span class="toc-header">Namespaces</span>
<ul id="left-sidebar-list">
<li><a class="wiki_link" href="backstage.zoo-commons-api.html">backstage.zoo-commons</a></li><li><a class="wiki_link" href="bayes-api.html">bayes</a></li><li><a class="wiki_link" href="censored-api.html">censored</a></li><li><a class="wiki_link" href="charts-api.html">charts</a></li><li><a class="wiki_link" href="core-api.html">core</a></li><li><a class="wiki_link" href="datasets-api.html">datasets</a></li><li><a class="wiki_link" href="distributions-api.html">distributions</a></li><li><a class="wiki_link" href="excel-api.html">excel</a></li><li><a class="wiki_link" href="infix-api.html">infix</a></li><li><a class="wiki_link" href="internal-api.html">internal</a></li><li><a class="wiki_link" href="io-api.html">io</a></li><li><a class="wiki_link" href="latex-api.html">latex</a></li><li><a class="wiki_link" href="mongodb-api.html">mongodb</a></li><li><a class="wiki_link" href="optimize-api.html">optimize</a></li><li><a class="wiki_link" href="pdf-api.html">pdf</a></li><li><a class="wiki_link" href="som-api.html">som</a></li><li><a class="wiki_link" href="sql-api.html">sql</a></li><li><a class="wiki_link" href="stats-api.html">stats</a></li><li><a class="wiki_link" href="symbolic-api.html">symbolic</a></li><li><a class="wiki_link" href="zoo-api.html">zoo</a></li>
</ul>
</div>
<div class="BranchTOC">
<span class="toc-header">Other Versions</span>
<ul id="left-sidebar-branch-list">
<li><a class="wiki_link" href="../index.html">1.5.5 (stable)</a></li><li><a class="wiki_link" href="../branch-master/index.html">2.0 (in development)</a></li>
</ul>
</div>
<a class="wiki_link" href="http://clojure.org">Clojure Home</a>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div class="wiki wikiPage" id="content_view">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#toc0">Overview</a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#var-section">Vars and Functions</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-mean-lower" class="toc-entry-anchor">censored-mean-lower</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-mean-two-sided" class="toc-entry-anchor">censored-mean-two-sided</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-mean-upper" class="toc-entry-anchor">censored-mean-upper</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-variance-lower" class="toc-entry-anchor">censored-variance-lower</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-variance-two-sided" class="toc-entry-anchor">censored-variance-two-sided</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/censored-variance-upper" class="toc-entry-anchor">censored-variance-upper</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#incanter.censored/truncated-variance" class="toc-entry-anchor">truncated-variance</a>
</div>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="censored">censored</span>
- <span id="header-project">Incanter</span> <span id="header-version">1.4.1</span><span id="header-status-block"> (<span id="header-status">legacy</span>)</span>
</h1>
<br />Full namespace name: <span id="long-name">incanter.censored</span>
<p></p>
<h2>Overview</h2>
<pre id="namespace-docstr"></pre>
<br />
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-mean-lower">censored-mean-lower</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-mean-lower a mu sigma)
</pre>
<pre id="var-docstr"> Returns the mean of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L56">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-mean-two-sided">censored-mean-two-sided</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-mean-two-sided a b mu sigma)
</pre>
<pre id="var-docstr"> Returns the mean of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a' and the upper
tail censored at 'b'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L21">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-mean-upper">censored-mean-upper</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-mean-upper b mu sigma)
</pre>
<pre id="var-docstr"> Returns the mean of a normal distribution (with mean mu and standard
deviation sigma) with the upper tail censored at 'b'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L84">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-variance-lower">censored-variance-lower</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-variance-lower a mu sigma)
</pre>
<pre id="var-docstr"> Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L67">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-variance-two-sided">censored-variance-two-sided</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-variance-two-sided a b mu sigma)
</pre>
<pre id="var-docstr"> Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a' and the upper
tail censored at 'b'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L36">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/censored-variance-upper">censored-variance-upper</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (censored-variance-upper b mu sigma)
</pre>
<pre id="var-docstr"> Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the upper tail censored at 'b'</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L94">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="incanter.censored/truncated-variance">truncated-variance</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (truncated-variance & {:keys [mean sd a b], :or {mean 0, sd 1, a NEGATIVE_INFINITY, b POSITIVE_INFINITY}})
</pre>
<pre id="var-docstr"> Returns the variance of a normal distribution truncated at a and b.
Options:
:mean (default 0) mean of untruncated normal distribution
:sd (default 1) standard deviation of untruncated normal distribution
:a (default -infinity) lower truncation point
:b (default +infinity) upper truncation point
Examples:
(use '(incanter core stats))
(truncated-variance :a -1.96 :b 1.96)
(truncated-variance :a 0)
(truncated-variance :b 0)
(use 'incanter.charts)
(def x (range -3 3 0.1))
(def plot (xy-plot x (map #(truncated-variance :a %) x)))
(view plot)
(add-lines plot x (map #(truncated-variance :b %) x))
(def samp (sample-normal 10000))
(add-lines plot x (map #(variance (filter (fn [s] (> s %)) samp)) x))
(add-lines plot x (map #(variance (mult samp (indicator (fn [s] (> s %)) samp))) x))
References:
DeMaris, A. (2004) Regression with social data: modeling continuous and limited response variables.
Wiley-IEEE.
<a href="http://en.wikipedia.org/wiki/Truncated_normal_distribution">http://en.wikipedia.org/wiki/Truncated_normal_distribution</a></pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/incanter/incanter/blob/a5d2d5afca3244cc534f6d3b426850f5418473c1/modules/incanter-core/src/incanter/censored.clj#L111">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div id="copyright" style="text-align: center;">No copyright info </div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a href="http://www.tomhickey.com" title="Visit Tom Hickey's website.">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>