-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,178 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Statistics: geofit</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script> | ||
<script type="text/javascript" async | ||
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"> | ||
</script> | ||
<style> | ||
var { | ||
font-style: italics; | ||
font-weight: bold; | ||
} | ||
td { | ||
vertical-align: top; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="bg-dark"> | ||
<div class="container-xl"> | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href=index.html> | ||
<img src="assets/statistics.png" alt="statistics" class="d-inline-block align-top" width="25" height="25"> | ||
Statistics | ||
</a> | ||
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="index.html#Distribution Fitting"> | ||
<i class="fas fa-list-alt"></i> | ||
Distribution Fitting | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="https://gnu-octave.github.io/packages/"> | ||
<img src="assets/octave-logo.svg" alt="GNU Octave logo" class="d-inline-block align-top" width="25" height="25"> | ||
Octave Packages | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="https://www.octave.org"> | ||
<i class="fas fa-home"></i> | ||
GNU Octave website | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
</div> | ||
<div class="container-xl my-4"> | ||
<div class="card rounded"> | ||
<div class="card-header card-header-mod"> | ||
<div class="row d-flex flex-wrap align-items-center"> | ||
<div class="col-sm-3 col-md-5 mb-2 mb-sm-0"> | ||
<h3 class="d-inline-block mr-2"> | ||
Function Reference: <b><code>geofit</code></b> | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-body"> | ||
<dl> | ||
<dt><u>statistics:</u> <var>pshat</var> = <b>geofit</b><i> (<var>x</var>)</i></dt> | ||
<dt><u>statistics:</u> [<var>pshat</var>, <var>psci</var>] = <b>geofit</b><i> (<var>x</var>)</i></dt> | ||
<dt><u>statistics:</u> [<var>pshat</var>, <var>psci</var>] = <b>geofit</b><i> (<var>x</var>, <var>alpha</var>)</i></dt> | ||
<dt><u>statistics:</u> [<var>pshat</var>, <var>psci</var>] = <b>geofit</b><i> (<var>x</var>, <var>alpha</var>, <var>freq</var>)</i></dt> | ||
</dl> | ||
|
||
<p> Estimate parameter and confidence intervals for the geometric distribution. | ||
</p> | ||
<div class="ms-5"> | ||
<p> <code><var>pshat</var> = geofit (<var>x</var>)</code> returns the maximum likelihood estimate | ||
(MLE) of the probability of success for the geometric distribution. <var>x</var> | ||
must be a vector. | ||
</p> | ||
<p> <code>[<var>pshat</var>, <var>psci</var>] = geofit (<var>x</var>, <var>alpha</var>)</code> also returns | ||
the <code>100 * (1 - <var>alpha</var>)</code> percent confidence intervals of the | ||
estimated parameter. By default, the optional argument <var>alpha</var> is 0.05 | ||
corresponding to 95% confidence intervals. Pass in <code>[]</code> for | ||
<var>alpha</var> to use the default values. | ||
</p> | ||
<p> <code>[…] = geofit (<var>x</var>, <var>alpha</var>, <var>freq</var>)</code> accepts a | ||
frequency vector, <var>freq</var>, of the same size as <var>x</var>. <var>freq</var> | ||
typically contains integer frequencies for the corresponding elements in | ||
<var>x</var>, but it can contain any non-integer non-negative values. By default, | ||
or if left empty, <code><var>freq</var> = ones (size (<var>x</var>))</code>. | ||
</p> | ||
<p> The geometric distribution models the number of failures (<var>x</var>) of a | ||
Bernoulli trial with probability <var>ps</var> before the first success. | ||
</p> | ||
<p> Further information about the geometric distribution can be found at | ||
<a href="https://en.wikipedia.org/wiki/Geometric_distribution">https://en.wikipedia.org/wiki/Geometric_distribution</a> | ||
</p> | ||
<p> <strong>See also: </strong> | ||
<a href="geocdf.html">geocdf</a>, | ||
<a href="geoinv.html">geoinv</a>, | ||
<a href="geopdf.html">geopdf</a>, | ||
<a href="geornd.html">geornd</a>, | ||
<a href="geostat.html">geostat</a> | ||
</p> | ||
<p><strong>Source Code: </strong> | ||
<a href="https://github.com/gnu-octave/statistics/tree/main/inst/dist_fit/geofit.m">geofit</a> | ||
</div> | ||
<div class="container-xl my-4"> | ||
<div class="card rounded"> | ||
<div class="card-header card-header-mod"> | ||
<div class="row d-flex flex-wrap align-items-center"> | ||
<div class="col-sm-3 col-md-5 mb-2 mb-sm-0"> | ||
<h3 class="d-inline-block mr-2"> | ||
Example: 1 | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-body"> | ||
<div class="container bg-light"> | ||
<div class="row"> | ||
<table><tbody><tr> | ||
<td> </td> | ||
<td><pre class="example"> | ||
|
||
## Sample 2 populations from different geometric distibutions | ||
rande ("seed", 1); # for reproducibility | ||
r1 = geornd (0.15, 1000, 1); | ||
rande ("seed", 2); # for reproducibility | ||
r2 = geornd (0.5, 1000, 1); | ||
r = [r1, r2]; | ||
|
||
## Plot them normalized and fix their colors | ||
hist (r, 0:0.5:20.5, 1); | ||
h = findobj (gca, "Type", "patch"); | ||
set (h(1), "facecolor", "c"); | ||
set (h(2), "facecolor", "g"); | ||
hold on | ||
|
||
## Estimate their probability of success | ||
pshatA = geofit (r(:,1)); | ||
pshatB = geofit (r(:,2)); | ||
|
||
## Plot their estimated PDFs | ||
x = [0:15]; | ||
y = geopdf (x, pshatA); | ||
plot (x, y, "-pg"); | ||
y = geopdf (x, pshatB); | ||
plot (x, y, "-sc"); | ||
xlim ([0, 15]) | ||
ylim ([0, 0.6]) | ||
legend ({"Normalized HIST of sample 1 with ps=0.15", ... | ||
"Normalized HIST of sample 2 with ps=0.50", ... | ||
sprintf("PDF for sample 1 with estimated ps=%0.2f", ... | ||
mean (pshatA)), ... | ||
sprintf("PDF for sample 2 with estimated ps=%0.2f", ... | ||
mean (pshatB))}) | ||
title ("Two population samples from different geometric distibutions") | ||
hold off | ||
|
||
</pre></td></tr></tbody> | ||
</table> | ||
<div class="text-center"> | ||
<img src="assets/geofit_101.png" class="rounded img-thumbnail" alt="plotted figure"> | ||
</div><p></p> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.