similar to: Error in maximum likelihood estimation.

Displaying 20 results from an estimated 500 matches similar to: "Error in maximum likelihood estimation."

2012 Jul 23
3
3D scatterplot, using size of symbols for the fourth variable
Dear R fans, I would like to create a scatterplot showing the relationship between 4 continuous variables. I thought of using the package "scatterplot 3d" to have a 3-dimensional plot and then using the size of the symbols to represent the 4th variable. Does anybody know how to do this? I already tried to create this graph using the colour of the symbols, but I was unable to generate
2006 Nov 30
3
Expression
Hi all, I have a question about expression. In a figure I want to include the term D*obs with the star as as superscript and obs as subscript. I have even just tried to get the star to be superscript. The code I tried was text(Dstar+7,120,expression(paste({}D,^*))), but that doesn't work and I get a syntax error. I can't seem to find anything in the help files that explains it.
2010 Aug 05
2
try-error within for loop
Dear all, I run a loop wrapped in try(), and for each of the rows where "try-error" is true I want to fill that row with NA (at the moment it is omitted). So I would expect to get a dataframe with 1000 rows some of which would be empty, but instead I get a dataframe with 995 rows. In this case missing 5 rows were omitted. Any suggestions? Thanks, Olga ----------------
2004 Mar 02
2
Problem with Integrate
The background: I'm trying to fit a Poisson-lognormal distrbutuion to some data. This is a way of modelling species abundances: N ~ Pois(lam) log(lam) ~ N(mu, sigma2) The number of individuals are Poisson distributed with an abundance drawn from a log-normal distrbution. To fit this to data, I need to integrate out lam. In principle, I can do it this way: PLN1 <- function(lam, Count,
2017 Sep 02
6
Strange lazy evaluation of default arguments
Dear R developers, sessionInfo() below Please have a look at the following two versions of the same function: 1. Intended behavior: > Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2) + { + print(c(u, l, mu)) # here, l is set to u?s value + u = u/sqrt(sigma2) + l = l/sqrt(sigma2) + mu = mu/sqrt(sigma2) + print(c(u, l, mu)) + } > > Su1() [1] 100.00 100.00 0.53 [1]
2017 Sep 02
2
Strange lazy evaluation of default arguments
Another way to avoid the problem is to not redefine variables that are arguments. E.g., > Su3 <- function(u=100, l=u, mu=0.53, sigma2=4.3^2, verbose) { if (verbose) { print(c(u, l, mu)) } uNormalized <- u/sqrt(sigma2) lNormalized <- l/sqrt(sigma2) muNormalized <- mu/sqrt(sigma2) c(uNormalized, lNormalized, muNormalized) } > Su3(verbose=TRUE)
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users, I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this? BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively. Any suggestion to solve this question? Thanks, Kate
2017 Sep 02
0
Strange lazy evaluation of default arguments
Hello, One way of preventing that is to use ?force. Just put force(l) right after the commented out print and before you change 'u'. Hope this helps, Rui Barradas Citando Matthias Gondan <matthias-gondan at gmx.de>: > Dear R developers, > > sessionInfo() below > > Please have a look at the following two versions of the same function: > > 1. Intended
2011 Jul 20
1
Fwd: Help please
Hi All, This is not really an R question but a statistical one. If someone could either give me the brief explanation or point me to a reference that might help, I'd appreciate it. I want to estimate the mean of a log-normal distribution, given the (log scale normal) parameters mu and sigma squared (sigma2). I understood this should simply be: exp(mu + sigma2) ... but I the following code
2017 Sep 02
0
Strange lazy evaluation of default arguments
Dear Bill, All makes perfect sense (including the late evaluation). I actually discovered the problem by looking at old code which used your proposed solution. Still I find it strange (and, hnestly, I don?t like R?s behavior in this respect), and I am wondering why u is not being copied to L just before u is assigned a new value. Of course, this would require the R interpreter to track all these
2005 Nov 17
3
loess: choose span to minimize AIC?
Is there an R implementation of a scheme for automatic smoothing parameter selection with loess, e.g., by minimizing one of the AIC/GCV statistics discussed by Hurvich, Simonoff & Tsai (1998)? Below is a function that calculates the relevant values of AICC, AICC1 and GCV--- I think, because I to guess from the names of the components returned in a loess object. I guess I could use
2006 Mar 01
1
a strange problem with integrate()
Dear all, I am stuck on the following problem with integrate(). I have been out of luck using RSiteSearch().. My function is g2<-function(b,theta,xi,yi,sigma2){ xi<-cbind(1,xi) eta<-drop(xi%*%theta) num<-exp((eta + rep(b,length(eta)))*yi) den<- 1 + exp(eta + rep(b,length(eta))) result=(num/den)*exp((-b^2)/sigma2)/sqrt(2*pi*sigma2)
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
Hi everyone, I am looking to do some manual maximum likelihood estimation in R. I have done a lot of work in Stata and so I have been using output comparisons to get a handle on what is happening. I estimated a simple linear model in R with lm() and also my own maximum likelihood program. I then compared the output with Stata. Two things jumped out at me. Firstly, in Stata my coefficient
2017 Sep 05
0
Strange lazy evaluation of default arguments
Mathias, If it's any comfort, I appreciated the example; 'expected' behaviour maybe, but a very nice example for staff/student training! S Ellison > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Matthias > Gondan > Sent: 02 September 2017 18:22 > To: r-help at r-project.org > Subject: [R] Strange lazy evaluation of
2013 Feb 22
4
HELP!!!
I am sorry to bug you, I am having this error whenever I want to run random effects regression in software R: Error in if (sigma2$id < 0) stop(paste("the estimated variance of the", : missing value where TRUE/FALSE needed. Please help me look into it. [[alternative HTML version deleted]]
2003 Apr 02
2
lme parameterization question
Hi, I am trying to parameterize the following mixed model (following Piepho and Ogutu 2002), to test for a trend over time, using multiple sites: y[ij]=mu+b[j]+a[i]+w[j]*(beta +t[i])+c[ij] where: y[ij]= a response variable at site i and year j mu = fixed intercept Beta=fixed slope w[j]=constant representing the jth year (covariate) b[j]=random effect of jth year, iid N(0,sigma2[b]) a[i]=random
2003 Apr 18
1
MCMCpack gelman.plot and gelman.diag
Hi, A question. When I run gelman.diag and gelman.plot with mcmc lists obtained from MCMCregress, the results are following. > post.R <- MCMCregress(Size~Age+Status, data = data, burnin = 5000, mcmc = 100000, + thin = 10, verbose = FALSE, beta.start = NA, sigma2.start = NA, + b0 = 0, B0 = 0, nu = 0.001, delta = 0.001) > post1.R <- MCMCregress(Size~Age+Status, data
2000 Aug 04
3
How to use complicated FUN in apply ?
Hi everyone I'm trying to use sigma2.mat<-apply(ri.mat,2,'-n/2*log(sum(ri.mat^2)/n)') but it's not working. Is it wrong to use that kind of FUN in apply ? or am I doing something wrong ?! Thank's ernesto -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2008 Aug 12
2
Maximum likelihood estimation
Hello, I am struggling for some time now to estimate AR(1) process for commodity price time series. I did it in STATA but cannot get a result in R. The equation I want to estimate is: p(t)=a+b*p(t-1)+error Using STATA I get 0.92 for a, and 0.73 for b. Code that I use in R is: p<-matrix(data$p) # price at time t lp<-cbind(1,data$lp) # price at time t-1
2002 May 09
2
truncated normal
Does anyone know of an R-function that will generate an observation from a truncated normal (left or right) with a mu and sigma2? Any correspondence would be greatly appreciated. Best regards, Scott Summerill FAA ACB-330 SIGNAL Corp. 609-485-6377 scott.ctr.summerill at tc.faa.gov -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read