Displaying 20 results from an estimated 30000 matches similar to: "nlysystemfit and loglikelihood values"
2011 Mar 10
2
R beginner - Error in as.vector(x, mode)
Hi everyone,
I am new to R and keep getting the message
Error in as.vector(x, mode)
while trying to run nlsystemfit.
Below is my exact code. The data is in Stata format because I only
recently swapped to R and am trying to compare results from Stata to
make sure I know what is going on.
I have searched google and read sever R-help articles with this error.
They all say the problem is to do
2006 Mar 31
1
loglikelihood and lmer
Dear R users,
I am estimating Poisson mixed models using glmmPQL
(MASS) and lmer (lme4). We know that glmmPQL do not
provide the correct loglikelihood for such models (it
gives the loglike of a 'pseudo' or working linear
mixed model). I would like to know how the loglike is
calculated by lmer.
A minor question is: why do glmmPQL and lmer give
different degrees-of-freedom for the same
2012 Nov 20
1
Coefficient of determination for non-linear equations system (nlsystemfit)
Hello everyone,
I have estimated system of three linear equations with one non-linear
restrictions with nlsystemfit. I was wondering how I can calculate the
R-squared (or some alternative coefficient of determination) for the
whole system. This is automatically given by linear systemfit but not by
nlsystemfit. I can get the values for each of the equations separately,
but apparently not for
2007 Mar 28
0
nlsystemfit: Errors with reproducing the manual example
Hi everybody, I'm a newbye with lots of problems :). I'm trying to use
nlsystemfit, but I recieve two error messages whose origin that I don't
understand.
1) When I try to reproduce the example reported in the systemfit package
manual, that is
library( systemfit )
data( ppine )
hg.formula <- hg ~ exp( h0 + h1*log(tht) + h2*tht^2 + h3*elev + h4*cr)
dg.formula <- dg ~ exp( d0
2011 Apr 15
3
GLM output for deviance and loglikelihood
It has always been my understanding that deviance for GLMs is defined
by;
D = -2(loglikelihood(model) - loglikelihood(saturated model))
and this can be calculated by (or at least usually is);
D = -2(loglikelihood(model))
As is done so in the code for 'polr' by Brian Ripley (in the package
'MASS') where the -loglikehood is minimised using optim;
res <-
2012 May 10
0
disagreement in loglikelihood and deviace in GLM with weights leads to different models selected using step()
In species distribution modeling where one uses a large sample of
background points to capture background variation in
presence\pseudo-absence or use\available models (0\1 response) it is
frequently recommended that one weight the data so the sum of the absence
weights is equal to the sum of presence weights so that the model isn?t
swamped by an overwhelming and arbitrary number of background
2009 May 04
0
questions about function arima0
Hi,
I work on order estimation for autoregressive processes and after some
inconsistencies cropped up I implemented the AIC criterion myself. Its
results do not match the implementation in R and there are a few
things I can not understand even after reading the source code of R.
I used the function called arima0 (with empty "ma" coeficient vector),
and I do not understand how some of
2010 Jan 09
2
Functions for QUAIDS and nonlinear SUR?
Hi,
I would like to estimate a quadratic almost ideal demand system in R which is estimated usually by nonlinear seemingly unrelated regression. But there is no such function in R yet but it is readily available in STATA (nlsur), see B. Poi (2008): Demand-system estimation: Update, Stata Journal 8(4).
Now I am thinking, what is quicker learning to "program" STATA which seems not really
2006 Mar 06
1
P-values from survreg (survival package) using a clusterterm
Hi all.
Belove is the example from the cluster-help page wtih the output.
I simply cannot figure out how to relate the estimate and robust Std. Err to
the p-value. I am aware this a marginal model applying the sandwich
estimator using (here I guess) an emperical (unstructered/exchangeable?)
ICC. Shouldent it be, at least to some extend, comparable to the robust
z-test, for rx :
2009 Jun 06
0
loglikelihood and AIC
Hi,
I tried fitting loglinear model using the glm(catspec). The data used is FHtab. . An independence model was fitted. Here summary() and fitmacro( ) give different values for AIC.
I understand that fitmacro( ) takes the likelilhood ratio L2(deviance) to calculate AIC and uses the formula AIC= L2- d.f(deviance)*2 and this AIC is used for comparison of nested models. (Am I right?)
The value
2007 Mar 15
1
expm() within the Matrix package
Hi
Could anybody give me a bit of advice on some code I'm having trouble with?
I've been trying to calculate the loglikelihood of a function iterated over
a data of time values and I seem to be experiencing difficulty when I use
the function expm(). Here's an example of what I am trying to do
y<-c(5,10) #vector of 2 survival times
p<-Matrix(c(1,0),1,2) #1x2 matrix
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
2012 Jul 11
0
declaring negative log likelihood of a distribution
Hi everyone!
I already posted
http://r.789695.n4.nabble.com/Declaring-a-density-function-with-for-loop-td4635699.html
a question on finding density values of a new Binomial like distribution
which has the following pmf:
http://r.789695.n4.nabble.com/file/n4636134/kb.png
Thank fully
http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=124474
Berend Hasselman and
2006 Jan 12
1
Problem with NLSYSTEMFIT()
Hello,
I want to solve a nonlinear 3SLS problem with "nlsystemfit()". The
equations
are of the form
y_it = f_i(x,t,theta)
The functions f_i(.) have to be formulated as R-functions. When invoking
"nlsystemfit()" I get the error
Error in deriv.formula(eqns[[i]], names(parmnames)) :
Function 'f1' is not in the derivatives table
2005 Jun 16
1
identical results with PQL and Laplace options in lmer function (package lme4)
Dear R users
I encounter a problem when i perform a generalized linear mixed model (binary data) with the lmer function (package lme4)
with R 2.1.0 on windows XP and the latest version of package "lme4" (0.96-1) and "matrix" (0.96-2)
both options "PQL" and "Laplace" for the method argument in lmer function gave me the same results (random and fixed effects
2008 Nov 20
1
Nonlinear restrictions in systemfit
Hey,
I want to implement a structural model with the package systemfit with some
linear and nonlinear constraints.
How to implement linear restrictions is clear.
Does anybody know how to set up nonlinear restrictions in the systemfit
packages.
For example:
beta1 = beta2-(beta4/beta6)
I look forward to your reply
--
View this message in context:
2010 Jul 20
1
Servreg $loglik
Dear R-experts:
I am using survreg() to estimate the parameters of a Weibull density having
right-censored observations. Some observations are weighted. To do that I
regress the weighed observations against a column of ones.
When I enter the data as 37 weighted observations, the parameter estimates
are exactly the same as when I enter the data as the corresponding 70
unweighted observations.
2011 May 12
1
Maximization of a loglikelihood function with double sums
Dear R experts,
Attached you can find the expression of a loglikelihood function which I
would like to maximize in R.
So far, I have done maximization with the combined use of the
mathematical programming language AMPL (www.ampl.com) and the solver
SNOPT (http://www.sbsi-sol-optimize.com/manuals/SNOPT%20Manual.pdf).
With these tools, maximization is carried out in a few seconds. I wonder
if that
2010 Sep 02
1
Help on glm and optim
Dear all,
I'm trying to use the "optim" function to replicate the results from the "glm" using an example from the help page of "glm", but I could not get the "optim" function to work. Would you please point out where I did wrong? Thanks a lot.
The following is the code:
# Step 1: fit the glm
clotting <- data.frame(
u =
2008 Jun 16
1
Error in maximum likelihood estimation.
Dear UseRs,
I wrote the following function to use MLE.
---------------------------------------------
mlog <- function(theta, nx = 1, nz = 1, dt){
beta <- matrix(theta[1:(nx+1)], ncol = 1)
delta <- matrix(theta[(nx+2):(nx+nz+1)], ncol = 1)
sigma2 <- theta[nx+nz+2]
gamma <- theta[nx+nz+3]
y <- as.matrix(dt[, 1], ncol = 1)
x <- as.matrix(data.frame(1,