search for: mu

Displaying 20 results from an estimated 1969 matches for "mu".

Did you mean: mmu
2005 Jun 16
1
mu^2(1-mu)^2 variance function for GLM
Dear list, I'm trying to mimic the analysis of Wedderburn (1974) as cited by McCullagh and Nelder (1989) on p.328-332. This is the leaf-blotch on barley example, and the data is available in the `faraway' package. Wedderburn suggested using the variance function mu^2(1-mu)^2. This variance function isn't readily available in R's `quasi' family object, but it seems to me that the following definition could be used: }, "mu^2(1-mu)^2" = { variance <- function(mu) mu^2 * (1 - mu)^2 validmu <- function(mu) all(mu > 0) &am...
2012 Nov 28
3
write out list of lists with names
Hello List I have a list question. I'm doing some data wrangling for a colleague and I have nested list in the following format: structure(list(MU10 = structure(c(0.80527905920989, 0.4350488707836, 0.455195366623, 0.565174432205497, 0.208180556861924), .Names = c("MU.16", "MU.19", "MU.21", "mean", "sd")), MU11 = structure(c(0.56061565798878, 0.65200918021661, 0.606312419102695, 0.0646249793...
2002 Dec 03
1
Any difference in cbind() b/w SPLus and R??
...; "1" "3" "HU" "r" "M" "686" "7" "12" "C" "n" "12" "1" "1" "1" [2,] "CHL-0259" "1" "2" "MU" "OT" "F" "1356.58" "4" "10" "L" "n" "1" "4" "0" "0" [3,] "CHL-0259" "1" "2" "MU" "OT" "F&quot...
2010 Apr 09
0
rjags syntax error
...t;, data = dat.test) : Parse error on line 1 Below is my JAGS model. Please cc me as I'm a digest subscriber if you reply. Thanks! Chris JAGS model ... model { for(i in 1:N){ ########################## # measurement equation model ########################## for(j in 1:P){ y[i,j]~dnorm(mu[i,j],psi[j]) } ########################## # alp[i] corresponds to the intercepts ########################## mu[i,1]<-xi[i,1]+alp[1] ## Ext1 mu[i,2]<-lam[1]*xi[i,1]+alp[2] mu[i,3]<-lam[2]*xi[i,1]+alp[3] mu[i,4]<-xi[i,2]+alp[4] ## Soc1 mu[i,5]<-lam[3]*xi[i,2]+alp[5] mu[i,6]<-lam[4]*...
2010 Jul 06
1
plotmath vector problem; full program enclosed
...#39;ve isolated the problem down to a relatively small piece of working example code (below). If you would please run this, I think you will see the problem. When plotmath meets one vector of expressions, it converts all but one to math, so in the figure output i get, in LaTeX speak b1 $\mu-1.0 \sigma$ $\mu$ All values except the first come out correctly. This happens only when I try to use bquote or substitute to get variables to fill in where the 1.96, 1.0, and so forth should be. In the figure output, you should see a second axis where all of the symbols are resolved correctl...
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
...be helpful to new users. In particular, combining several values from a program into a single expression is a difficult task that is not currently exemplified. I believe this is an instructive example because it combines the use of lines, arrows, text, and polygons. Here's the code: ###Set mu and sigma at your pleasure: mu <- 10.03 sigma <- 12.5786786 myx <- seq( mu - 3.5*sigma, mu+ 3.5*sigma, length.out=500) myDensity <- dnorm(myx,mean=mu,sd=sigma) # It is challenging to combine plotmath with values of mu and sigma in one expression. # Either bquote or substitute can b...
2012 Aug 31
3
fitting lognormal censored data
...39;)$Censored) # uncensored Status data set # tcen<-c((dat2$'FALSE')$Ti) # Life times data set for censored # Stat.cen<-c((dat2$'FALSE')$Censored) # censoring Status data set # ##################### Estimation using optim function ################ ml= function(par){mu=par[1] s=par[2] -sum(dlnorm(tun,mu,s,log=TRUE))-sum(1-plnorm(tcen,mu,s))} Max=optim(c(0.5,0.5),ml) param=c(Max$par) ## My Problem is when I try to estimate parameters using newton raphson ### ########### intial values ############## mu=1 s=1 ############# Derivative for mu ########## F1= functi...
2011 Jan 27
2
pdf greek letter typos
Hi there, yet on the topic of greek letters and pdf plotting: when I run the following code pdf(file="temp.pdf") mu=seq(from=-pi, to=pi, length=100) plot(mu, sin(mu^2), type="l", xlab=expression(mu%in%(list(-pi,pi))), ylab=expression(sin(mu^2)), main=expression((list(mu,sin(mu^2))))) dev.off() I get a "proportional to" symbol in place of a "mu" and a "not e...
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, mu, sigma2) { dpois(Count, exp(lam), log=F)*dnorm(LL, mu, s...
2012 Sep 11
1
Strange result from GAMLSS
Hi Folks! Just started using the gamlss package and I tried a simple code example (see below). Why the negative sigma? John > y <- rt(100, df=1)> m1<-fitDist(y, type="realline")Warning messages:1: In MLE(ll3, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, : possible convergence problem: optim gave code=1 false convergence (8)2: In MLE(ll4, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, : possible convergence problem: optim gave code=1 false convergence (8)3: In MLE(ll4, start = list(eta.mu = eta.mu, eta.s...
2012 Apr 16
1
eval a SYMSXP from C
Can someone offer some advice on how to properly evaluate a SYMSXP from a .Call ? I have the following in R: variable xn, with an attribute "mu" which references the variable mu in the global environment. I know "references" is a loose term; mu was defined in this fashion as a way to implement deferred binding: foo <- function(x,mu) { attr(x,"mu") <- substitute(mu) x } mu <- 2.0 xn <- foo(rno...
2012 Aug 29
2
Estimation parameters of lognormal censored data
Hi, I am trying to get the maximum likelihood estimator for lognormal distribution with censored data;when we have left, interval and right censord. I built my code in R, by writing the deriving of log likelihood function and using newton raphson method but my estimators were too high " overestimation", where the values...
2005 Mar 18
3
plotmath question
R listers: I have been foiled by plotmath! (in R 2.01,Windows 2000) The task: Plot a normal density and label the ticks as mu - 3 sigma, mu - 2 sigma, ...., mu + 3 sigma, where the mu's and sigmas appear as Greek symbols, of course. The following code does this: x<-seq(-3,to=3,by=.01) y<-dnorm(x) plot(x,y,type='h',col='lightblue',axes=FALSE) lines(x,y,col='darkblue') axis(2) for(i in se...
2013 Mar 28
3
problem with plots with short example.
...t( N = nrow(therms), J=length(unstate), y = therms$difftherm, numstate = therms$numstate )) ################################################### ### code chunk number 3: exchange ################################################### exchange.mod <- "model{ for(i in 1:N){ y[i] ~ dnorm(mu, tau) } mu ~ dnorm(0,.001) tau ~ dgamma(.1,.1) }" exchange.out <- run.jags(exchange.mod, data=dat, burnin=10000, sample=50000, thin=5, monitor=c("mu", "tau"), monitor.deviance=T, monitor.pd=T, silent.jags=T) #################################################...
2005 Jun 14
1
New Family object for GLM models...
...provide a solution to this problem. I have appended the function i wrote. Add.haz<-function () { env <- new.env(parent = .GlobalEnv) assign(".nziek", nziek, envir = env) famname<-"Addhaza" link="addlink" linkfun<-function(mu) -log(1-mu) linkinv<-function(eta) 1-exp(-eta) variance<-function(mu) mu*(1-mu) validmu<-function(mu) all(mu > 0) && all(mu < 1) mu.eta<-function(mu) 1/(1-mu) dev.resids <- function(y, mu, wt) 2 * wt * (y * log(ifelse(y ==...
2010 Mar 09
3
Shade area under curve
I want to shade the area under the curve of the standard normal density. Specifically color to the left of -2 and on. How might i go about doing this? Thanks -- View this message in context: http://n4.nabble.com/Shade-area-under-curve-tp1586439p1586439.html Sent from the R help mailing list archive at Nabble.com.
2006 Jul 22
1
ifelse command
Dear: I try to revise the maximum likelihood function below using something constrains. But it seems something wrong with it. Becasue R would not allow me to edit the function like this. It is very appreciate if you can help. function (parameters,y,x1,x2) { p<-parameters[1] alpha1<-parameters[2] beta1<-parameters[...
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] 23.2558140 23.2558140 0.1232558 In the first version, both u and l are corre...
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
This is not so much a bug as an infelicity in the code that can easily be fixed. The initialize expression in the quasi family function is, (uniformly for all links and all variance functions): initialize <- expression({ n <- rep.int(1, nobs) mustart <- y + 0.1 * (y == 0) }) This...
2012 Jul 24
2
Wilcoxon V = 0
...s: wilcox.test(x=a$x,y=b$x,paired=TRUE) The output looks like this: Wilcoxon signed rank test data: a$x and b$x V = 0, p-value = 0.0009766 alternative hypothesis: true location shift is not equal to 0 The raw data is here: a participant condition x 34 1 fused.mu.control 315.5677 35 2 fused.mu.control 516.8781 36 3 fused.mu.control 362.8108 37 4 fused.mu.control 482.6022 38 5 fused.mu.control 423.6593 39 6 fused.mu.control 404.9358 40 8 fu...