# ABC_P2_norm: ABC Extimation of P2 for Normal Distribution In ABCp2: Approximate Bayesian Computational Model for Estimating P2

## Description

This function fits offspring data to a special case of the normal distribution, in which zero and negative values of offspring are excluded, and estimates P2 based on that distribution and the specificed priors.

## Usage

 `1` ```ABC_P2_norm(n, ObsMean, M_Lo, M_Hi, SD_Lo, SD_Hi, delta, iter) ```

## Arguments

 `n` number of observations. `ObsMean` the observed mean number of offspring sired by the second male. `M_Lo` minimum mean value for the distribution. `M_Hi` maximum mean value for the distribution. `SD_Lo` minimum standard deviation value for the distribution. `SD_Hi` maximum standard deviation value for the distribution. `delta` maximum allowed difference between the estimated mean and observed mean number of offspring produced by the second male. `iter` number of iterations used to build the posterior.

## Value

 `posterior` Posterior distribution of P2 values. `Avg` Vector of values for the mean parameter. `Std` Vector of values for the standard deviation parameter.

## Author(s)

M. Catherine Duryea, Andrew D. Kern, Robert M. Cox, and Ryan Calsbeek

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```#Fit the Mean and Standard Deviation hyperpriors to a distribution of offspring. data(fungus) fit_dist_norm(fungus\$Total_Offspring) #Use hyperiors and priors calculated from the data to estimate P2. #Plot the saved distributions for the Mean and Standard Deviation parameters. #Adjust, if necessary. fungus_P2<-ABC_P2_norm(12, 9.9, 11.35, 17.31, 8.22, 12.44, 0.1, 100) hist(fungus_P2\$posterior) hist(fungus_P2\$Avg) hist(fungus_P2\$Std) ```

ABCp2 documentation built on May 1, 2019, 6:31 p.m.