Learn R Programming

weibull4 (version 1.0.0)

prior: Calculates the Prior Distribution for Metropolis-MCMC

Description

This is an internal function of the Weibull4 package

Usage

prior(param)

Arguments

param

A vector with shape, scale, location, area and SD parameters

Value

A vector with prior distribution for Metropolis-MCMC

References

https://theoreticalecology.wordpress.com/2010/09/17/metropolis-hastings-mcmc-in-r/

Examples

Run this code
# NOT RUN {
function (param)
{
    shape <- param[1]
    scale <- param[2]
    loc <- param[3]
    area <- param[4]
    sd <- param[5]
    shapeprior <- dunif(shape, min = 1, max = 5, log = T)
    scaleprior <- dnorm(scale, sd = scale/2, log = T)
    locprior <- dunif(loc, min = 1, max = loc * 2, log = T)
    areaprior <- dunif(area, min = area/2, max = area * 2, log = T)
    sdprior <- dunif(sd, min = 1, max = sd * 2, log = T)
    return(shapeprior + scaleprior + locprior + areaprior + sdprior)
  }
# }

Run the code above in your browser using DataLab