>
>> On Oct 25, 2016, at 9:29 AM, dave fournier
wrote:
>>
>>
>>
>> Unfortunately this problem does not appear to be well posed.
>>
>>Retention = (b0*Area^(th+1))^b
>>
>> If b0, th, and b are the parameter only the product (th+1)*b
Unfortunately this problem does not appear to be well posed.
Retention = (b0*Area^(th+1))^b
If b0, th, and b are the parameter only the product (th+1)*b is determined.
This comes from noting that powers satisfy
(a^b)^c = a^(b*c)
So your model can be written as
I've spent quite a bit of time trying to convince people on various
lists that the solution to these kinds of
problems lies in the stable parameterization of the model. I write the
solutions in AD Model Builder because it
is easy. But R people are generally stuck in R (or mired) so the
Actually this converges very nicely if you use these starting values
that I obtained with
AD Model Builder
th 9.1180e-01
b05.2104e+00
b1 -4.6725e-04
The R result looks like
nls.m2
Nonlinear regression model
model: Retention ~ expFct(Area, b0, b1, th)
data:
I believe that if your try these starting values the sum of squares is
considerably smaller
a=1.0851e-06
b=1.4596e-01
delta=9.1375e-01
something like SS= 0.005236471 vs SS= 0.01597071
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and
I wonder if your code is correct?
I ran your script until an error was reported. the data set
of 30 obs was
[1] 0 0 1 3 3 3 4 4 4 4 5 5 5 5 5 7 7 7 7 7 7 8 9
10 11
[26] 12 12 12 15 16
I created a tiny AD Model Builder program to do MLE on it.
DATA_SECTION
init_int
I don't Think that viewing lack of convergence by some R routine
as a uuseful tool for diagnosing model or data inadequacy is a very
useful approach. It is far better to fit the model. Then standard
techniques can be employed to investigate these matters. For the
model considered here there are
It is not very difficult to integrate this DE numerically.
For parameter estimation it is a good idea for
stability to use a semi-implicit formulation. The idea is
described here.
http://otter-rsch.com/admodel/cc4.html
__
R-help@r-project.org
.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins University
Ph. (410) 502-2619
email: rvarad...@jhmi.edu
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of dave fournier
Sent: Friday
I always enjoy these direct comparisons between different software packages.
I coded this up in AD Model Builder which is freely available at
http://admb-project.org ADMB calculates exact derivatives via automatic
differentiation so it tends to be more stable for these difficult problems.
The
You can fit this model with AD Model Builder's random effects module.
there is an example fitting a Poisson and negative binomial to the
venerable
polio data set with ar(1) random effects at
http://admb-project.org/examples/count-data/negative-binomial-serially-correlated-counts
A
According to the documentation for glmmADMB if you fit
your model with a statment like
fit =glmm.admb(y~Base*trt+Age+Visit, ... data=epil2,family=nbinom)
and that the parameter estimates are in
fit$b while their estimated standard deviations are
in
fit$stdbeta
so presumably p
Actually it is not that difficult to parameterize the covariance matrix
so that the
optimization is unconstrained. first parameterize the correlation matrix
and the
standard deviations separately. the std devs can be parameterized as
sigma_i=exp(x_i) 1=i=n
For the correlation matrix
Actually it just the parameterization that is causing trouble near k=0
let u = (x-z)/a
then the problematic part of your function is
(1- k*u)^(1/k)
take the log to get
log(1-k*u)/k
= -(k*u +k^2*u^2/2 + ...)/k
= -(u +k u^2/2 + ..)
so your function is exp(-u - ku^2/2 - ...)
and
If you are going to make this program available for general
use you want to take every precaution to make it bulletproof.
This is a fairly informative data set. The model will undoubtedly
be used on far less informative data. While the model looks
pretty simple it is very challenging
If you mean using random effects which have a fat-tailed distribution
this has been available in AD Model Builder's random effects package for
some time now. The general idea is to start with a random effect assumed
to be standard normal and then to transform it by the cumulative dist
function
I thought maybe my suggestion for reparameterizing this simple problem
was ignored because I didn't supply R code for the problem.
Here it is using optim for the optimization. It converges trivially with
an initial value for E of 1000.
As I stated before, there is nothing at all difficult about
Thanks to Dennis Murphy who pointed out that ExponCycles
is undefined. It is an R gotcha. I had shortened the name but R still
remembered it so the script worked but only on my computer.
This should fix that.
ExponValues=c(2018.34,2012.54,2018.85,2023.52,2054.58,2132.61,2247.17,2468.32,27
78.47)
Figuring out the best parameterization for this kind of model
is a bit tricky until you get the hang of it.
Let the function be
y_t = y_0 + alpha * E^t
where uppercase Y_t denotes an observed value
and lower case y_t is a predicted value.
Index the times by t_1 t_n
WLOG assume that
Hi,
Your results are do to using an unstable parameterization
of the Von Bertalanffy growth curve, combined with the unreliable
optimization methods supplied with R. I coded up your model in
AD Model Builder which supplies exact derivatives through
AD.
I used your starting values and ran the
It is true that R does not offer support for custom likelihood functions
in nonlinear mixed models. However you can switch to R and use
AD Model Builder's random effects module http://admb-project.org
This is freely available software and it is more flexible than
proc nlmixed. I'm sure there are
I think you can do this very efficiently with AD Model Builder's
random effects module. The software is now freely available at
http://admb-project.org
If you want, you can contact me directly to discuss the model.
Dave
--
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Canada
You can fit this kind of model (and negative binomial) and more
difficult mixed models with AD Model Builder's random effects module
which is now freely available at
http://admb-project.org/
--
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Canada
Phone/FAX 250-655-3364
Hi All,
Following Mike Praeger's posting on this list,
I'm happy to pass on that AD Model Builder is now freely available from
the ADMB Foundation.
http://admb-foundation.org/
Two areas where AD Model builder would be especially useful to R users
are multi-parmater smooth optimization as
The freely available R package glmmADMB can do Adaptive
Gaussian Quadrature for this type of model,
since it is built using AD Model Builder's random effects
module which incorporates this feature.
There is now a beta version of the software for
people using R on the Mac intel platform.
The freely available R package glmmADMB can do Adaptive
Gaussian Quadrature for this type of model,
since it is built using AD Model Builder's random effects
module which incorporates this feature.
There is now a beta version of the software for
people using R on the Mac intel platform.
While it may be true that for coxme models the standard errors
are not very good approximations, it is always useful to have them
to compare with other diagnostics such as likelihood ratios and
profile likelihoods. It is interesting to hear that with the currently
used methodology
Computation
27 matches
Mail list logo