Displaying 20 results from an estimated 600 matches similar to: "Help on glm and optim"
2010 Feb 15
1
Extract values from a predict() result... how?
Hello,
silly question I suppose, but somehow I can't manage to extract the
probabilities from a glm.predict() result:
> str(res)
Named num [1:9] 0.00814 0.01877 0.025 0.02941 0.03563 ...
- attr(*, "names")= chr [1:9] "1" "2" "3" "4" ...
I got from:
# A Gamma example, from McCullagh & Nelder (1989, pp. 300-2)
clotting <-
2012 Aug 10
1
plotting profile likelihood curves
Hello,
I am trying to figure out how to plot the profile likelihood curve of a GLM
parameter with 95% pCI's on the same plot. The example I have been trying
with is below. The plots I am getting are not the likelihood curves that I
was expecting. The y-axis of the plots is tau and I would like that axis
to be the likelihood so that I have a curve that maxes at the parameter
estimate. I am
2007 Aug 19
1
can't find "as.family" function
Hi R users,
I want to use dglm Package.
I run the examples and it give me an error:
Error en dglm(lot1 ~ log(u), ~1, data = clotting, family = Gamma) :
no se pudo encontrar la funci?n "as.family"
dglm can't find "as.family" function
why ?
Thank you for your help
2011 Nov 24
1
what is wrong with this dataset?
> d = data.frame(gender=rep(c('f','m'), 5), pos=rep(c('worker', 'manager',
'speaker', 'sales', 'investor'), 2), lot1=rnorm(10), lot2=rnorm(10))
> d
gender pos lot1 lot2
1 f worker 1.1035316 0.8710510
2 m manager -0.4824027 -0.2595865
3 f speaker 0.8933589 -0.5966119
4 m sales
2009 Feb 24
2
Syntax in taking log to transfrom the data to fit Gaussian distribution
Hi,
I have a data set (weight) that does not follow the Gaussian (Normal)
distribution. However, I have to transform the data before applying the
Gaussian distribution. I used this syntax and used log(weight) as:
posJy.model<-glm(log(weight) ~ factor(pos),
family=gaussian(link='identity'), subset=Soil=="Jy"). This syntax COULD NOT
transform the data. But if I transform the
2010 Sep 09
5
Help on simple problem with optim
Dear all,
I ran into problems with the function "optim" when I tried to do an mle estimation of a simple lognormal regression. Some warning message poped up saying NANs have been produced in the optimization process. But I could not figure out which part of my code has caused this. I wonder if anybody would help. The code is in the following and the data is in the attachment.
da <-
2010 Sep 10
0
[LLVMdev] using GCC LTO files as a frontend to dragonegg?
On 10 September 2010 14:37, Marcus Daniels <mdaniels at lanl.gov> wrote:
> Hello,
>
> With GCC, it is possible to compile GIMPLE from an object file back to
> assembly. With Dragonegg, it seems to be a NOP. (See below for a
> comparison.)
>
> This appears it could be a nice way to mix the strengths of GCC and
> LLVM. If it worked.. Should it?
I can't
2011 May 16
4
Problem on glmer
Hi all,
I was trying to fit a Gamma hierarchical model using "glmer", but got weird error message that I could not understand. On the other hand, a similar call to the glmmPQL leads to results that are close to what I expect. I also tried to change tha "nAGQ" argument in "glmer", but it did not solve the problem. The model I was fitting has a simple structure - one
2010 Feb 26
1
S4 programming
Dear all,
I'm new to S4 classes and have a question on this. I want to use S4 because I want to define explicitly the slots that the new class can have. But other than that, the new class behaves exactly like a list. But this will not allow me to use the generic functions that are already defined for class "list", such as "$", "c", "[[",
2010 Mar 01
1
Method dispatch
Dear all,
In a package, I defined a method for "summary" using setMethod(summary, signature="abc") for my class "abc", but when the package is loaded, the function "summary(x)" where x is of class "abc" seems to have called the default summary function for "ANY" class. Shouldn't it call the method I have defined? How could I get
2009 Jun 15
1
Create R object
Dear R users,
I have two simple questions here, and hope someone can help me on this. Thanks in advance.
1.
I have a list object lst=list(a1=matrix(rnorm(4),2,2), a2=matrix(rnorm(4),2,2),a3=matrix(rnorm(4),2,2)). Here I only use three elements for illustration, and in fact the length of lst, n, is unknown in advance. I want to define an object for each element of this lst, and the objects have
2011 Sep 07
1
Fwd: FSelector and RWeka problem
Hi all,
Although I sent the mail to Piotr, the author of FSelector, it should be better to ask here to let others know.
Yanwei
Begin forwarded message:
From: Yanwei Song <yanwei.song@gmail.com>
Date: September 7, 2011 4:41:58 PM EDT
To: p.romanski@stud.elka.pw.edu.pl
Subject: FSelector and RWeka problem
Dear Piotr,
Thanks for developing the FSelector package for us. I'm a new
2010 Mar 01
0
S4 issues
Dear all,
I ran into some issues that I've been trying to figure out for weeks but with no success. So I'm looking for some advice here. I've the following questions:
1. I want to write some S4 classes and methods and add them into a current package that was written in S3. Is this possible? Can both S3 and S4 methods exist in one package?
2. When I sourced my functions using
2009 Jun 15
0
books on Time serie
A time series text with a title that seems designed to hide its
wide scope is:
Forecasting with Exponential Smoothing
The State Space Approach
Hyndman, R.J., Koehler, A.B., Ord, J.K., Snyder, R.D.
Springer 2009.
This book is actually an excellent overview of time series theory,
ARIMA as well as state space. It is of course, in part, a manual
for the forecast and other packages in what has been
2010 Sep 10
4
[LLVMdev] using GCC LTO files as a frontend to dragonegg?
Hello,
With GCC, it is possible to compile GIMPLE from an object file back to
assembly. With Dragonegg, it seems to be a NOP. (See below for a
comparison.)
This appears it could be a nice way to mix the strengths of GCC and
LLVM. If it worked.. Should it?
Thanks,
Marcus
[mdaniels at dn002 dragonegg]$ cat hello.c
#include <stdio.h>
int hello () { printf ("Hello
2008 Aug 04
2
Multivariate Regression with Weights
Hi all,
I'd like to fit a multivariate regression with the variance of the error term porportional to the predictors, like the WLS in the univariate case.
y_1~x_1+x_2
y_2~x_1+x_2
var(y_1)=x_1*sigma_1^2
var(y_2)=x_2*sigma_2^2
cov(y_1,y_2)=sqrt(x_1*x_2)*sigma_12^2
How can I specify this in R? Is there a corresponding function to the univariate specification lm(y~x,weights=x)??
2008 Jul 30
2
Sampling two exponentials
Hi all,
I am going to sample two variables from two exponential distributions, but I want to specify a covariance structure between these two variables. Is there any way to do it in R? Or is there a "Multivariate Exponential" thing corresponding to the multivariate normal? Thanks in advance.
Sincerely,
Yanwei Zhang
Department of Actuarial Research and Modeling
Munich Re America
Tel:
2008 Aug 07
1
Covariance matrix
Hi all,
Assume I have a random vector with four variables, i.e. A=(a,b,c,d). I am able to get the covariance matrix of vector A, but how can I get the covariance matrix of vector B=(a,c,b,d) by manipulating the corresponding covariance matrix of A? Thanks.
Sincerely,
Yanwei Zhang
Department of Actuarial Research and Modeling
Munich Re America
Tel: 609-275-2176
Email:
2008 Jul 25
3
Numerical question
Hi all,
I have n independent variables A_1, A_2, A_3,......,A_n, and each with known variances var(A_1), var(A_2),..., but unknown mean. How can I get the approximation of the variance of the product of the variables using numerical computation, i.e. var(A_1*A_2*A_3*.....*A_n)? Thanks.
Sincerely,
Yanwei Zhang
Department of Actuarial Research and Modeling
Munich Re America
Tel: 609-275-2176
2008 Jul 23
1
Questions on weighted least squares
Hi all,
I met with a problem about the weighted least square regression.
1. I simulated a Normal vector (sim1) with mean 425906 and standard deviation 40000.
2. I simulated a second Normal vector with conditional mean b1*sim1, where b1 is just a number I specified, and variance proportional to sim1. Precisely, the standard deviation is sqrt(sim1)*50.
3. Then I run a WLS regression without the