Displaying 20 results from an estimated 400 matches similar to: "Gamma MLE"
2011 Jun 18
2
different results from nls in 2.10.1 and 2.11.1
Hi,
I've noticed I get different results fitting a function to some data on
my laptop to when I do it on my computer at work.
Here's a code snippet of what I do:
##------------------------------------------------------------------
require(circular) ## for Bessel function I.0
## Data:
dd <- c(0.9975948929787, 0.9093316197395, 0.7838819026947,
0.9096108675003, 0.8901804089546,
2006 Nov 11
2
Bayesian question (problem using adapt)
In the following code I have created the posterior density for a Bayesian
survival model with four parameters. However, when I try to use the adapt
function to perform integration in four dimensions (on my old version of R
I get an error message saying that I have applied a non-function, although
the function does work when I type kernel2(param0, theta0), or on the
newer version of R the computer
2008 Mar 19
1
problem with optim and integrate
Dear all,
I want to min "integrate( (p1*dnorm+p2*dnorm+p3*dnorm)^(1.3))" for p, mu,
and sigma.
So, I have to estimate 8 parameters(p3=1-p1-p2).
I got this warning-"Error in integrate(numint, lower = -Inf, upper = Inf) :
non-finite function value."
My questions are
How could I fix it? I tried to divide into several intervals and sum up, but
I got same message.
My code is
2011 Feb 22
2
mle
Hi,
I am looking for some help regarding the use of the mle function.
I am trying to get mle for 3 parameters (theta0, theta1 and theta2) that
have been defined in the the log-likelihood equation as theta0=theta[1],
theta1=theta[2] and theta2=theta[3].
My R code for mle is:
mle(Poisson.lik, start=list(theta=c(20,1,1), method="Nelder-Mead",
fixed=list(w=w, t1=t1, t2=t2))
But I keep
2011 Aug 13
3
optimization problems
Dear R users
I am trying to use OPTIMX(OPTIM) for nonlinear optimization.
There is no error in my code but the results are so weird (see below).
When I ran via OPTIM, the results are that
Initial values are that theta0 = 0.6 1.6 0.6 1.6 0.7. (In fact true vales
are 0.5,1.0,0.8,1.2, 0.6.)
--------------------------------------------------------------------------------------------
>
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Oh, sorry; I changed signs in the model, fitting
theta0 + theta1*exp(theta2*x)
So for theta0 - theta1*exp(-theta2*x) use theta1= -.exp(-1.8) and theta2 =
+.055 as starting values.
-- Bert
On Sun, Aug 20, 2023 at 11:50?AM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you so much for your kind and valuable feedback. I tried finding the
> starting
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users,
I used to "OPTIM" to minimize the obj. function below. Even though I used
the true parameter values as initial values, the results are not very good.
How could I improve my results? Any suggestion will be greatly appreciated.
Regards,
Kathryn Lord
#------------------------------------------------------------------------------------------
x = c(0.35938587,
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users,
I used to "OPTIM" to minimize the obj. function below. Even though I used
the true parameter values as initial values, the results are not very good.
How could I improve my results? Any suggestion will be greatly appreciated.
Regards,
Kathryn Lord
#------------------------------------------------------------------------------------------
x = c(0.35938587,
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you for your extremely valuable feedback. Now, I just want to
understand why the signs for those starting values, given the following:
> #Fiting intermediate model to get starting values
> intermediatemod <- lm(log(y - .37) ~ x, data=mod14data2_random)
> summary(intermediatemod)
Call:
lm(formula = log(y - 0.37) ~ x, data = mod14data2_random)
Residuals:
Min
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Basic algebra and exponentials/logs. I leave those details to you or
another HelpeR.
-- Bert
On Sun, Aug 20, 2023 at 12:17?PM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you for your extremely valuable feedback. Now, I just want to
> understand why the signs for those starting values, given the following:
> > #Fiting intermediate model to get
2009 Jul 03
2
Error using the Rdonlp2 Package
Dear experts,
I'm attempting to solve a constrained optimization problem using the Rdonlp2
package.
I created a Lagrange function (L=f(x)-lambda(g(x)-c)), where x is a vector
of 16 parameters. This is what I'm using as objective function in the code
below. In addition, I set bounds on these parameters (par.u and par.l). When
I run the code, I get the error message shown below. Any idea
2011 Aug 29
3
gradient function in OPTIMX
Dear R users
When I use OPTIM with BFGS, I've got a significant result without an error
message. However, when I use OPTIMX with BFGS( or spg), I've got the
following an error message.
----------------------------------------------------------------------------------------------------
> optimx(par=theta0, fn=obj.fy, gr=gr.fy, method="BFGS",
>
2023 Aug 20
2
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you so much for your kind and valuable feedback. I tried finding the
starting values using the approach you mentioned, then did the following to
fit the nonlinear regression model:
nlregmod2 <- nls(y ~ theta1 - theta2*exp(-theta3*x),
start =
list(theta1 = 0.37,
theta2 = exp(-1.8),
theta3 =
2010 Oct 20
1
lme with log-normal distribution of parameters
Dear R-users,
Do you know if we can use the function lme in R for log-normal
distribution of parameters as used in Nonmem ?
theta=theta0*exp(eta)
In our model, the parameters follow the log-normal distribution so it's
not reasonable to deal with normal distribution which gives us negative
values in simulation
Thanks for your help,
Thu
[[alternative HTML version deleted]]
2011 Feb 21
0
Function within functions and MLE
Hi,
I am trying to determine the MLE of the following function:
http://r.789695.n4.nabble.com/file/n3317341/untitled.bmp
I have defined both parts of the equation as separate functions and looped
over the t and G values to get summations of each part.
The lamda function has 3 unknowns which I am trying to determine using MLE
bub tin order to try and get the overall function working these
2013 Apr 08
0
Maximum likelihood estimation of ARMA(1,1)-GARCH(1,1)
Hello
Following some standard textbooks on ARMA(1,1)-GARCH(1,1) (e.g. Ruey
Tsay's Analysis of Financial Time Series), I try to write an R program
to estimate the key parameters of an ARMA(1,1)-GARCH(1,1) model for
Intel's stock returns. For some random reason, I cannot decipher what
is wrong with my R program. The R package fGarch already gives me the
answer, but my customized function
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
I got starting values as follows:
Noting that the minimum data value is .38, I fit the linear model log(y -
.37) ~ x to get intercept = -1.8 and slope = -.055. So I used .37,
exp(-1.8) and -.055 as the starting values for theta0, theta1, and theta2
in the nonlinear model. This converged without problems.
Cheers,
Bert
On Sun, Aug 20, 2023 at 10:15?AM Paul Bernal <paulbernal07 at
2010 Apr 08
1
a small question about R with Winbugs
I try to do a test for dirichlet process for Multivariate normal, but Winbugs
always says "expected multivariate node", does that mean I miss something at
initialization? I will really appreciate the help to solve this problem
Here is the R code, and Winbugs code.
model
{
for(i in 1:N){
y[i,1:2] ~ dmnorm(mu[i,],tau[i,,])
S[i] ~ dcat(pi[])
mu[i,1:2] <- mu.star[S[i],]
2004 Feb 16
0
error in nls, step factor reduced below minFactor
Hello,
I am trying to estimate 4 parameters of a non-linear
model using nls.
My model function is a Fourier integral and is very
expensive to
calculate. I get the following error:
> theta0 <- c(0.045, 1.02*10^(-4), 0.00169,
5.67*10^(-4))
> res <- nls(log(y) ~ log(model(theta,r,t)),
data=dataModel,
+ start=list(theta=theta0), trace=TRUE,
+ control=nls.control(tol=1e-2))
2011 Aug 29
0
Error: Gradient function might be wrong ----- in OPTIMX
Dear R users
When I use OPTIMX with BFGS, I've got the following error message.
-----------------------------------------------------------------
> optimx(par=theta0, fn=obj.fy, gr=gr.fy, method="BFGS")
Error: Gradient function might be wrong - check it!
-----------------------------------------------------------------
So, I checked and checked my gradient function line by