search for: sigma

Displaying 20 results from an estimated 1335 matches for "sigma".

2007 Sep 10
2
Are the error messages of ConstrOptim() consisten with each other?
...ot missing in the first 2 cases suddently become missing? For your convenience, I put the complete code below: Best Wishes Yuchen Luo ######################################## rm(list = ls()) mat=5 rint=c(4.33,4.22,4.27,4.43,4.43,4.44,4.45,4.65,4.77,4.77) tot=rep(13319.17,10) sh=rep(1553656,10) sigmae=c(0.172239074,0.188209271,0.193703774,0.172659891,0.164427247,0.24602361,0.173555309,0.186701165,0.193150456, 0.1857315601) ss=c(56.49,56.39,56.55,57.49,57.37,55.02,56.02,54.35,54.09, 54.67) orange=rep(21.25,10) apple2=expression(rint*(1.0-rec)*(1.0-(pnorm(-lambda/2.0+log(((ss+(tot/sh*1000.0)*lba...
2015 Apr 10
1
RFC: sigma() in package:stats ?
I'm proposing to add something like this to the stats package : ---------------------------------------------------------- ### "The" sigma in lm/nls - "like" models: sigma <- function(object, ...) UseMethod("sigma") ## works whenever deviance(), nobs() and coef() do fine: sigma.default <- function (object, use.fallback=TRUE, ...) sqrt(deviance(object, ...) / (nobs(object, use.fallback=use.f...
2007 Sep 09
2
What does it mean by "initial value not available"?
....0-(pnorm(-lambda/2.0+log(((ss+(tot/sh* 1000.0)*lbar)/(tot/sh*1000.0 )/lbar*exp(lambda*lambda)))/lambda)-((ss+(tot/sh*1000.0)*lbar)/(tot/sh* 1000.0)/lbar*exp(lambda*lambda))*pnorm(-lambda/2.0-log(((ss+(tot/sh*1000.0 )*lbar)/(tot/sh*1000.0 )/lbar*exp(lambda*lambda)))/lambda))+(exp(rr*(lambda*lambda/(sigmae*ss/(ss+lbar*(tot/sh* 1000.0)))/(sigmae*ss/(ss+lbar*(tot/sh*1000.0)))))*((((ss+(tot/sh*1000.0 )*lbar)/(tot/sh*1000.0)/lbar*exp(lambda*lambda))^(sqrt(0.25+2.0*rr/ (sigmae*ss/(ss+lbar*(tot/sh*1000.0)))/(sigmae*ss/(ss+lbar*(tot/sh*1000.0 ))))+0.5)*pnorm(-log(((ss+(tot/sh*1000.0)*lbar)/(tot/sh*1000.0 )...
2010 Mar 27
1
R runs in a usual way, but simulations are not performed
...sible, because it all is too complicated. I am convinced that of foremost importance is the last repeat command. Thank you very much. Faithfully yours, Martin Bo?a (Matej Bel University / Faculty of Natural Sciences / Bansk? Bystrica / Slovakia). # zav?dza s?riu podporn?ch funkci? # zav?dza trace, sigma, fi, xs, xs, fixs, sxfixs tr <- function(M) sum(diag(M)) sigma_ADD <- function(alpha) diag(as.vector(alpha %*% t(z)), nrow=nrow(z), ncol=nrow(z)) sigma_MIX <- function(alpha) diag((as.vector(alpha %*% t(z)))^2, nrow=nrow(z), ncol=nrow(z)) sigma_EXP <- function(alpha) diag(exp(as.vector...
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
...pful 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 be used. F...
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 =...
2005 Dec 20
4
help with sapply, plot, lines
Hi, I am trying to plot multiple lines on a graph. The function is particularly simple: sigma<-function(lambda) atm-2*rr*(lambda-0.5)+16*str*(lambda-0.5)^2 which uses the variables atm, rr and str... I define these as such: atm<-0.4 rr<-0.2 str<-0.1 and this plots fine: plot(seq(0.01,0.99,0.01),sigma(seq(0.01,0.99,0.01)),ylim=c(0,1)) Now, I want to plot the same function...
2010 Jul 06
1
plotmath vector problem; full program enclosed
...solated 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 correctly. As usua...
2018 Feb 13
3
Help with regular expressions
...Colleagues I would appreciate some help with regular expressions. I have string that looks like: " ITERATION ,THETA1 ,THETA2 ,THETA3 ,THETA4 ,THETA5 ,THETA6 ,THETA7 ,SIGMA(1,1) ,SIGMA(2,1) ,SIGMA(2,2)? In the entries that contain: (X,Y) # for example, SIGMA(1,1) I would like to replace the comma with a period, e.g., SIGMA(1.1) but NOT the other commas The end-result would be: " ITERATION ,THETA1 ,THETA2...
2002 Aug 10
0
?subexpressions, D, deriv
...us and have up to now done my differentiation "by hand" , calling on skills I learned many years ago and some standard cheat sheets. My interest at present is in getting the second derivative of a gaussian, which I did by hand and results in a somewhat messy result involving terms in sigma^5 .. I have done some spot checks against R on the first derivative and my algebra seems OK, for the second derivative I get inflection points where expected via my algebra and R but I have not yet done a detailed numerical comparison (so I cannot be 100% sure of my algebra). What I would li...
2009 Nov 20
3
symbol in the plot
a graph question. Thanks a lot in advance. I made two scatterplots on one graph (sigma vs. delta1, sigma vs. delta2) (20 observations of delta1, delta2 and corresponding sigma) the x-axis is sigma, the y-axis is either delta1 or delta2. I connected both scatterplots. To seperate them, one curves is a line with circles, the other curve is a line with squares on it. I want to make a...
2004 Jul 03
2
DSTEIN error (PR#7047)
...eter 5 to routine DSTEIN was incorrect Mac OS BLAS parameter error in DSTEIN, parameter #0, (unavailable), is 0 In case it helps, here's the function and function call that causes the crash. n <- 4 p <- 1 f <- 2; k <- 2 lms.bcn.univar <- function(y, B, p, f, k, lambda.0, mu.0, sigma.0){ n <- length(y) D11 <- matrix(1, nrow = p, ncol = n) D1 <- rbind(cbind(D11, matrix(0, nrow = p, ncol = f)), cbind(matrix(0, nrow = f, ncol = n), diag(f))) D22 <- rbind(rep(1:0,n), rep(0:1,n)) x1 <- t(D22)[,1] x2 <- t(D22)[,2]...
2008 Jul 23
1
R2WinBUGS problem
...with hope and some anxiety. Best wishes Troels cat(" model { for (i in 1:126) { dep[i] ~ dnorm(mu.dep[i],tau.dep) mu.dep[i] <- alpha[ID[i]]*NAK.cor[i]+beta[ID[i]]*TBW.cor[i] fit[i] <- mu.dep[i]+CONST[i] } tau.dep <- pow(sigma_dep,-2) sigma_dep ~ dunif(0,100) for (j in 1:16) { alpha[lev[j]] <- AB[lev[j],1] beta[lev[j]] <- AB[lev[j],2] AB[lev[j],1:2] ~ dmnorm(AB.hat[lev[j],],tau.AB[,])I(lower[], upper[]) AB.hat[lev[j],1] <- mu.alpha AB.hat[lev[j],2] <...
2012 Apr 26
2
ErrError in f(x, ...) : object 'g.' not found
Hi , R is a new language for me so sorry in advance if this error is to basic for posting. I have tried the R manual and search online for quite a few, if anyone could help i would be very thankful. Here is my code. kappa = 1.1 theta = 0.1 sigma = 0.4 rho = -0.6 v0 = 0.2 r = 0.05 T = 0.5 s0 = 1 K = 0.5 type = 1 Hestoncall = function(kappa,theta,sigma,rho,v0,r,T,s0,K,type) { u = 0.5 b = kappa-rho*sigma a = kappa*theta x = log(s0) Hestf = function(phi) { d = sqrt((b-rho*sigma*phi*complex(1,0,1)-b )^2-s...
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 seq(-3,to=3)...
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.
2013 Oct 20
5
nlminb() - how do I constrain the parameter vector properly?
...in my parameter vector are used to construct a positive semi-definite matrix, but I can't see how to achieve this using the constraint mechanism provided. Additional details are provided in the code below. Suggestions? Best Regards, Steven Generate the data set I'm using: mu<-c(1,5) sigma<-c(1,2,2,6) dim(sigma)<-c(2,2) set.seed(83165026) sample.full<-sample.deleted<-mvrnorm(50,mu,sigma) delete.one<-c(1,5,13,20) delete.two<-c(3,11,17,31,40,41) sample.deleted[delete.one,1]<-NA sample.deleted[delete.two,2]<-NA missing<-c(delete.one,delete.two) complete<-sa...
2013 Apr 22
0
Copula fitMdvc:
...Thanks, Elisa. ################################# #### OLS ESTIMATION fit1 <- lm(Y1 ~ Xi) fit2 <- lm(Y2 ~ Xi) fit3 <- lm(Y3~ Xi) resid1 <- Y1-as.matrix(cbind( 1,Xi))%*%fit1$coef resid2 <- Y2-as.matrix(cbind( 1,Xi))%*%fit2$coef resid3 <- Y3-as.matrix(cbind( 1,Xi))%*%fit3$coef sigma1<-sum(resid1*resid1)/nrow(Xi) sigma2<-sum(resid2*resid2)/nrow(Xi) sigma3<-sum(resid3*resid3)/nrow(Xi) rho12<- cor(resid1, resid2) rho13<- cor(resid1, resid3) rho23<- cor(resid2, resid3) library("copula") library(mvtnorm) x<-as.matrix(cbind( 1,Xi)) km<- as.numeric(...
2005 Apr 18
2
Construction of a large sparse matrix
...able to create this matrix? I'm at the limit of my experience and could use a pointer if anyone is able to provide one. Many thanks, Harold P.S. The matrix above is added to another matrix to create the covariance matrix below. The code above is designed to create the portion of the matrix \sigma^2_{vle}\bm{J} . \begin{equation} \label{vert:cov} \bm{\Phi} = var \left [ \begin{array}{c} Y^*_{1}\\ Y^*_{2}\\ Y^*_{3}\\ Y^*_{4}\\ \end{array} \right ] = \left [ \begin{array}{cccc} \sigma^2_{\epsilon}\bm{I}& \sigma^2_{\epsilon}\rho\bm{I} & \bm{0} & \bm{0}\\ \sigma^2_{\epsilon}\rho...
2007 Aug 13
1
simulate data from multivariate normal with pre-specified correlation matrix
For example, the correlation matrix is 3x3 and looks like 1 0.75 0 0 0 0.75 1 0 0 0 0 0 0 0 0 Can I write the code like this? p<- 3 # number of variables per observation N<- 10 # number of samples # define population correlation matrix sigma sigma<-matrix(0,p,p) #creates a px p matrix of 0 rank<-2 for (i in 1:rank){ for (j in 1:rank){ rho<-0.75 sigma[i,j]<-rho^abs(i-j) sigma[i,i]<-1 } } # create a data set of 10 observations from multivariate normalcovariance matrix sigma library(MASS) Xprime<-mvrnorm(N,rep(1,p),...