fitgammamodel: fitgammamodel

View source: R/fitgammamodel.R

fitgammamodelR Documentation

fitgammamodel

Description

A function to fit sumPH of the observed peak heights to a gamma model

Usage

fitgammamodel(
  y,
  x = NULL,
  niter = 10,
  delta = 1,
  plott = FALSE,
  alpha = 0.05,
  offset = 125,
  scale = 100,
  restrictDeg = TRUE
)

Arguments

y

Vector with sum peak heights (per loci)

x

Vector with fragment lengths (base pair) (only provided for degradation)

niter

Number of random samples

delta

Standard deviation of normal distribution when drawing random startpoints. Default is 1.

plott

Whether plotting fitted model along with data

alpha

The alpha/2 and 1-alpha/2 percentiles will be plotted if x is provided

offset

The shift of bp in degradation model.

scale

The scaling of shifted bp in degradation model

restrictDeg

Whether to restrict degradation param to be less than 1

Details

This function is used for fitting a gamma regression model

Value

Estimated parameters (mean,coefVar,slopePara)

Author(s)

Oyvind Bleka

Examples

## Not run: 
th = c(1000,0.8,0.6)
n = 100 #number of samples
x = seq(10,300,l=n)
y = rgamma(n,shape=2/th[2]^2*th[3]^((x-125)/100),scale=th[1]*th[2]^2)
fitgammamodel(y,x,plott=TRUE,alpha=0.05)

## End(Not run)

oyvble/euroformix documentation built on Aug. 25, 2023, 11:14 a.m.