-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from andrechalom/dev
Small fixes
- Loading branch information
Showing
16 changed files
with
99 additions
and
77 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
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,25 @@ | ||
# Version 0.2.0 (Milestone) | ||
### Major changes | ||
- Reworked the Volkov distribution for performance. | ||
- Reworked density, quantile and distribution functions for more consistent behaviour, | ||
error handling and large performance gains. | ||
- Added some missing functions for mzsm, poig and poix families. | ||
- New function *updatesad* to update a fitsad with better fit from profile. | ||
- *radpred* now uses exact solutions for extreme data points. | ||
- Reimplemented the *AIC* and *AICc* functions for better integration with fitsad and fitrad classes. | ||
|
||
### Enhancements | ||
- Improved grammar and clearer text in some manual pages and vignette. | ||
- Improved starting values for several distributions. | ||
- Replaced table(cut(x)) for hist for improved performance. | ||
- octav and rad classes now have validation functions and are more consistent. | ||
- More informative calls in *show* and *summary*. | ||
- Reduced code redundancy and improved readability. | ||
|
||
### Bugfixes | ||
- Fixed the Broken-Stick family to behave like a Discrete distribution. | ||
- Small but importante fixes in *octavpred*. | ||
- Workarounds for bugs and issues of the bbmle package. | ||
|
||
# Version 0.1.10 | ||
- Initial release on CRAN. |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
dpoig <- function(x, frac, rate, shape, log=FALSE) { | ||
x[ ! is.wholenumber(x) | x < 0 ] <- NaN | ||
frac[ !is.finite(frac) | frac <= 0 ] <- NaN | ||
rate[ !is.finite(rate) | rate <= 0 ] <- NaN | ||
shape[ !is.finite(shape) | shape <= 0 ] <- NaN | ||
b <- x*log(frac)+shape*log(rate)+lgamma(x+shape) | ||
c <- lfactorial(x)+lgamma(shape)+(x+shape)*log(frac+rate) | ||
vals<-b-c | ||
if (any(is.nan(vals))) warning ("NaNs produced") | ||
if (any(!is.wholenumber(x))) warning("non integer values in x") | ||
vals[ ! is.wholenumber(x) | x < 0] <- -Inf | ||
if(log)vals else exp(vals) | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -7,25 +7,28 @@ | |
\usepackage{Sweave} | ||
\usepackage{natbib} | ||
\usepackage{framed, color} | ||
\usepackage{xspace} | ||
\definecolor{shadecolor}{rgb}{0.9, 0.9, 0.9} | ||
\setlength{\parindent}{0pt} | ||
\setlength{\hoffset}{-0.5in} | ||
\setlength{\textwidth}{6in} | ||
\setlength{\voffset}{-0.1in} | ||
%\pdfpagewidth=\paperwidth | ||
%\pdfpageheight=\paperheight | ||
\newcommand{\R}{{\sf R}} | ||
\newcommand{\R}{\textnormal{\sffamily\bfseries R}\xspace} | ||
% altered bc \sf is obsolete, see: | ||
% http://tex.stackexchange.com/questions/74478/latex-command-incantation-for-r | ||
\newcommand{\code}[1]{\texttt{#1}} | ||
\SweaveOpts{eval=TRUE, keep.source=TRUE, echo=TRUE} | ||
%\VignetteIndexEntry{Introduction to sads} | ||
|
||
\begin{document} | ||
|
||
\title{Fitting species abundance models with maximum likelihood \\ Quick reference for \code{sads} package} | ||
\author{Paulo In\'acio Prado and Murilo Dantas Miranda \\ Theoretical Ecology Lab \\ LAGE at the Dep of Ecology, USP, Brazil \\ | ||
\author{Paulo In\'acio Prado, Murilo Dantas Miranda and Andre Chalom \\ Theoretical Ecology Lab \\ LAGE at the Dep of Ecology, USP, Brazil \\ | ||
\url{http://ecologia.ib.usp.br/let/} \\ \url{[email protected]}} | ||
|
||
\date{February, 08, 2015} | ||
\date{May, 21, 2015} | ||
|
||
\maketitle | ||
|
||
|
@@ -56,7 +59,6 @@ The package is available on CRAN and can be installed in \R with the command: | |
@ | ||
<<installation, eval=FALSE>>= | ||
install.packages('sads') | ||
library(sads) | ||
@ %def | ||
|
||
then loaded by | ||
|
@@ -76,9 +78,6 @@ library(devtools) | |
install_github(repo = 'piklprado/sads', ref= 'dev') | ||
@ | ||
|
||
|
||
|
||
|
||
\section{Exploratory analyses} | ||
\label{sec:analise-exploratoria} | ||
|
||
|
@@ -320,6 +319,11 @@ legend("topright", | |
lty=1, col=c("blue","red", "green")) | ||
@ %def | ||
|
||
\textbf{NOTICE} that the information criterion methods do not differentiate between | ||
\code{fitsad} and \code{fitrad} methods. Because of this, it is possible to include | ||
\code{fitsad} and \code{fitrad} objects in the same IC-table without generating an error, | ||
but the result will be meaningless. | ||
|
||
\section{Simulations} | ||
|
||
The function \code{rsad} returns random samples of a community with $S$ species. The mean abundances of the species in the communities | ||
|