Description Usage Arguments Details Author(s)
powLaw
calculates the mean (h). powLawSigma
calculates the noise (sigma, or sig for short). powLawDensity
calculates the density. powLawNegLogLikVect
calculates a vector of negative log-likelihood. powLawNegLogLik
calculates the negative log-likelihood (sum of powLawNegLogLikVect
). fitPowLaw
returns the maximum likelihood fit. simPowLaw
creates simulated data.
1 | powLaw(x, th_w, transformVar = F)
|
x |
Vector of independent variable observations |
th_w |
Vector of parameters with ordering [a,r,b,s,kappa] |
transformVar |
Whether a transformation of the parameterization is needed [Default FALSE] |
w |
Vector of dependent variable observations |
a |
Multiplicative coefficient |
r |
Scaling exponent |
b |
Offset |
s |
Baseline noise |
kappa |
Slope of noise [Optional] |
hetSpec |
Specification for the heteroskedasticity [Default 'none'] |
We assume that the response variable w is distributed as
w ~ N(h(x),sig(x)^2)
where x is the independent variable, h(x) the mean, sig(x) the noise, and N denotes a normal distribution. If sig is independent of x, the model is homoskedastic. Otherwise, it is heteroskedastic. For an observation (w,x), the likelihood is
l_w = 1/sqrt(2*pi)/sig*exp(-0.5*(w-h)^2/sig^2)
The negative log-likelihood is
eta_w = 0.5*log(2*pi) + log(sig) + 0.5*(w-h)^2/sig^2
For the mean and noise, we adopt the parametric forms
h = a*x^r + b
and
sig = s
[hetSepc = 'none']
sig = s*(1 + kappa*x)
[hetSpec = 'sd_x']
sig = s*(1 + kappa*a*x^r)
[hetSpec = 'sd_resp']
Michael Holton Price <MichaelHoltonPrice@gmail.com>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.