Displaying 20 results from an estimated 1000 matches similar to: "a generic Adaptive Gauss Quadrature function in R?"
2007 Mar 21
2
Gaussian Adaptive Quadrature
Hi all,
Does anybody know any function that performs gaussian adapative quadrature integration of univariate functions?
Thanks in advance,
Regards,
Caio
__________________________________________________
[[alternative HTML version deleted]]
2008 Sep 27
3
Double integration - Gauss Quadrature
Hi,
I would like to solve a double integral of the form
\int_0^1 \int_0^1 x*y dx dy
using Gauss Quadrature.
I know that I can use R's integrate function to calculate it:
integrate(function(y) {
sapply(y, function(y) {
integrate(function(x) x*y, 0, 1)$value
})
}, 0, 1)
but I would like to use Gauss Quadrature to do it.
I have written the following code (using R's statmod package)
2007 May 08
3
ordered logistic regression with random effects. Howto?
I'd like to estimate an ordinal logistic regression with a random
effect for a grouping variable. I do not find a pre-packaged
algorithm for this. I've found methods glmmML (package: glmmML) and
lmer (package: lme4) both work fine with dichotomous dependent
variables. I'd like a model similar to polr (package: MASS) or lrm
(package: Design) that allows random effects.
I was
2009 May 08
1
ADAPTIVE QUADRATURE WEIGHTS AND NODES
Can anyone help me on how to get the nodes and weights of the adaptive quadrature
using R.
Best wishes
Boikanyo.
-----
The University of Glasgow, charity number SC004401
2005 Aug 17
1
two-level poisson, again
Hi,
I compare results of a simple two-level poisson estimated using lmer
and those estimated using MLwiN and Stata (v.9).
In R, I trype:
-------------------------------------------------------------------------------------------
m2 <- lmer(.D ~ offset(log(.Y)) + (1|pcid2) + educy + agri, male, poisson)
-------------------------------------------------------------------------------------------
2006 Jun 09
1
binomial lmer and fixed effects
Hi Folks,
I think I have searched exhaustively, including, of course R-help (D.
Bates, S. Graves, and others) and but I remain uncertain about
testing fixed effects with lmer(..., family=binomial).
I gather that mcmcsamp does not work with Do we rely exclusively on z
values of model parameters, or could we use anova() with likelihood
ratios, AIC and BIC, with (or without)
2005 Dec 15
1
generalized linear mixed model by ML
Dear All,
I wonder if there is a way to fit a generalized linear mixed models (for repeated binomial data) via a direct Maximum Likelihood Approach. The "glmm" in the "repeated" package (Lindsey), the "glmmPQL" in the "MASS" package (Ripley) and "glmmGIBBS" (Myle and Calyton) are not using the full maximum likelihood as I understand. The
2006 Apr 28
1
gauss.quad.prob
I've written a series of functions that evaluates an integral from -inf to a or b to +inf using equally spaced quadrature points along a normal distribution from -10 to +10 moving in increments of .01. These functions are working and give very good approximations, but I think they are computationally wasteful as I am evaluating the function at *many* points.
Instead, I would prefer to use
2004 Apr 27
3
se.fit in predict.glm
Hi Folks,
I'm seeking confirmation of something which is probably true
but which I have not managed to find in the documentation.
I have a binary response y={0.1} and a variable x and have
fitted a probit response to the data with
f <- glm( y~x, family=binomial(link=probit) )
and then, with a specified set of x-value X I have used the
predict.glm function as
p <- predict( f, X,
2006 May 05
0
Spline integration & Gaussian quadrature (was: gauss.quad.prob)
Spencer
Thanks for your thoughts on this. I did a bit of work and did end up
with a method (more a trick), but it did work. I am certain there are
better ways to do this, but here is how I resolved the issue.
The integral I need to evaluate is
\begin{equation}
\frac{\int_c^{\infty} p(x|\theta)f(\theta)d\theta}
{\int_{-\infty}^{\infty} p(x|\theta)f(\theta)d\theta}
\end{equation}
Where
2010 Apr 14
2
Gaussian Quadrature Numerical Integration In R
Hi All,
I am trying to use A Gaussian quadrature over the interval (-infty,infty) with weighting function W(x)=exp(-(x-mu)^2/sigma) to estimate an integral.
Is there a way to do it in R? Is there a function already implemented which uses such weighting function.
I have been searching in the statmode package and I found the function "gauss.quad(100, kind="hermite")" which uses
2003 Sep 04
7
Comparison of SAS & R/Splus
I am one of only 5 or 6 people in my organization making the
effort to include R/Splus as an analysis tool in everyday work -
the rest of my colleagues use SAS exclusively.
Today, one of them made the assertion that he believes the
numerical algorithms in SAS are superior to those in Splus
and R -- ie, optimization routines are faster in SAS, the SAS
Institute has teams of excellent numerical
2008 Mar 12
3
Types of quadrature
Dear R-users
I would like to integrate something like \int_k^\infty (1 - F(x)) dx, where F(.) is a cumulative distribution function. As mentioned in the "integrate" help-page: integrate(dnorm,0,20000) ## fails on many systems. This does not happen for an adaptive Simpson or Lobatto quadrature (cf. Matlab). Even though I am hardly familiar with numerical integration the implementation
2006 Jun 29
1
lmer - Is this reasonable output?
I'm estimating two models for data with n = 179 with four clusters (21,
70, 36, and 52) named siteid. I'm estimating a logistic regression model
with random intercept and another version with random intercept and
random slope for one of the independent variables.
fit.1 <- lmer(glaucoma~(1|siteid)+x1
+x2,family=binomial,data=set1,method="ML",
2006 Feb 27
1
gauss.hermite function
Hi,
I am trying to find a function that returns simply the weights and
points of an n point gauss hermite integeration, so that I can use them
to fit a non-standard likelihood.
I have found some documentation for the function 'gauss.hermite' written
by jim lindley, but can't find the actual binary on CRAN
I'm aware there are lots of functions like glmm, glmmML etc to fit mixed
2009 Aug 07
1
Gauss-Laguerre using statmod
I believe this may be more related to analysis than it is to R, per se.
Suppose I have the following function that I wish to integrate:
ff <- function(x) pnorm((x - m)/sigma) * dnorm(x, observed, sigma)
Then, given the parameters:
mu <- 300
sigma <- 50
m <- 250
target <- 200
sigma_i <- 50
I can use the function integrate as:
> integrate(ff, lower= -Inf, upper=target)
2013 Oct 11
3
Gaussian Quadrature for arbitrary PDF
Hi all,
We know that Hermite polynomial is for
Gaussian, Laguerre polynomial for Exponential
distribution, Legendre polynomial for uniform
distribution, Jacobi polynomial for Beta distribution. Does anyone know
which kind of polynomial deals with the log-normal, Studentæ¯ t, Inverse
gamma and Fisheræ¯ F distribution?
Thank you in advance!
David
[[alternative HTML version deleted]]
2006 Feb 16
2
how to retrieve robust se in coxph
Hi,
I am using coxph in simulations and I want to store the "robust se" (or
"se2" in frailty models) for each replicate. Is there a function to retrieve
it, like vcov() for the variance estimate? Thanks!
Lei Liu
Assistant Professor
Division of Biostatistics and Epidemiology
Dept. of Public Health Sciences
School of Medicine
University of Virginia
3181 Hospital West
2006 Jun 29
2
help with coxme
Hi there,
I have a question on fitting data by coxme. In particular I want to fit a
random intercept and random slope cox model. Using the rats dataset as an
example, I generated another covariate x2 and want to specify a random slope
for x2. Here is my code:
x2=matrix(rep(runif(50), 3), 50, 3)
x2=as.vector(t(x2))
rats2=cbind(rats, x2)
But when I used the coxme function as follows, it gave
2004 Nov 19
2
function 'vcov' for coxph in R 2.0.0
Hi there,
After I fitted a cox model, I used vcov to obtain the
variance of the parameter estimate. It worked correctly in
R 1.9.1. But it failed in R 2.0.0 and the error message is
Error in vcov(cox.1) : no applicable method for "vcov"
I don't know if it is a bug or there is some update on
this function. Thanks!
Lei Liu
Assistant Professor
Division of Biostatistics and