[R] bayesian mixed logit

2012-01-17 Thread Carlo Fezzi (ENV)
Dear all, I am writing an R code to fit a Bayesian mixed logit (BML) via MCMC / MH algorithms following Train (2009, ch. 12). Unfortunately, after many draws the covariance matrix of the correlated random parameters tend to become a matrix with almost perfect correlation, so I think there is a

Re: [R] {Spam?} RE: {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
vs f3, hence my question on the >> list... but I may well be mistaken and I will double check as soon as I >> am >> back. Hopefully this does not sound too unreasonable. >> >> Best wishes, >> >> Carlo >> >> > >> > >> > Be

Re: [R] {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Joris Meys >> Sent: Monday, June 21, 2010 12:09 PM >> To: Carlo Fezzi >> Cc: r-help@r-project.org >> Subject: Re: [R] {Spam?} Re: mgcv, testing gamm vs lme,which degree

Re: [R] {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
nds on the focus as well. If the focus is prediction, you > might even want to consider testing whether the variance of the > residuals differs significantly with a simple F-test. This indicates > whether the predictive power differs significantly between the models. > But these tests tend t

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Carlo Fezzi
e of the > randomization that allows for a general hypothesis about the added > value of the spline, without focusing on its actual shape. Hence the > "freedom" connected to that actual shape should not be used in the df > used to test the general hypothesis. > > Hope t

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Carlo Fezzi
ld not a test of one model vs the other take this into account? Sorry if this may sound dull, many thanks for your help, Carlo > On Wednesday 16 June 2010 20:33, Carlo Fezzi wrote: >> Dear all, >> >> I am using the "mgcv" package by Simon Wood to estimate an additiv

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Carlo Fezzi
> tests. To be completely correct, this -apparently- only counts for > gamms using the identity link. > > Cheers > Joris > > On Wed, Jun 16, 2010 at 9:33 PM, Carlo Fezzi wrote: >> Dear all, >> >> I am using the "mgcv" package by Simon Wood to estim

[R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-16 Thread Carlo Fezzi
Dear all, I am using the "mgcv" package by Simon Wood to estimate an additive mixed model in which I assume normal distribution for the residuals. I would like to test this model vs a standard parametric mixed model, such as the ones which are possible to estimate with "lme". Since the smoothing

Re: [R] faster GLS code

2010-01-07 Thread Carlo Fezzi
; + # GLS mean parameter estimates >> + betam <- betav%*%t(X)%*%inv.sigma%*%Y >> + }) >> user system elapsed >> 1.140.511.76 >>> >>> system.time({ >> + csig <- chol2inv(covar) >> + betam2 <- ginv(csig %*% X) %*% csig %*% Y >> + }) >> user system

[R] faster GLS code

2010-01-07 Thread Carlo Fezzi
of a bigger code and needs to run several times). Any suggestion would be greatly appreciated. Carlo *** Carlo Fezzi Senior Research Associate Centre for Social and Economic Research on the Global Environment (CSERGE), School of Environmental Sciences

[R] constrOptim converging not to the optimal values

2008-05-19 Thread Carlo Fezzi
ind(u1,u2) c.s <-c(rep(0,N-1),rep(c(low,-high),N)) OPTIMIZATION a<-constrOptim(outer.iteration = 500, control = list(maxit=1), theta=(high-low)/(N+1)* N:1, f=negdet, ui = u.s, ci=c.s, method="Nelder-Mead") #### **

[R] hessian in constrained optimization (constrOptim)

2008-05-12 Thread Carlo Fezzi
= TRUE) I guess the function "constrOptim" does not allow this argument which, on the other hand, is allowed in "optim". I would be extremely grateful if anybody could suggest a way I could use to I obtain the values of the hessian matrix... Many thanks, Carlo ****

Re: [R] R computing speed

2007-12-11 Thread Carlo Fezzi
To: Carlo Fezzi Cc: r-help@r-project.org Subject: Re: [R] R computing speed I would suggest that you use Rprof to get a profile of the code to see where time is being spent. You did not provide commented, minimal, self-contained, reproducible code, so it is hard to tell from just looking at the

[R] R computing speed

2007-12-11 Thread Carlo Fezzi
really grateful if anybody could help me with this issue, I attach my code below. Many thanks, Carlo *** Carlo Fezzi Centre for Social and Economic Research on the Global Environment (CSERGE), School of Environmental Sciences, University of East Anglia