search for: sig1

Displaying 20 results from an estimated 20 matches for "sig1".

Did you mean: sig
2009 Jun 22
1
The gradient of a multivariate normal density with respect to its parameters
...ct to the *parameters*? It?s easy enough to implement myself, but I?d like to avoid reinventing the wheel (with some bugs) if possible. Here?s a simple example of the result I?d like, using numerical differentiation: library(mvtnorm) library(numDeriv) f=function(pars, xx, yy) { mu=pars[1:2] sig1=pars[3] sig2=pars[4] rho=pars[5] sig=matrix(c(sig1^2,rho*sig1*sig2,rho*sig1*sig2,sig2^2),2) dmvnorm(cbind(x,y),mu,sig) } mu1=1 mu2=2 sig1=3 sig2=4 rho=.5 x=2 # or a x vector y=3 # or a y vector jacobian(f,c(mu1,mu2,sig1,sig2,rho),xx=x,yy=y) # (Can replace ?jacobian? with ?grad? if x and y...
2008 Oct 19
2
definition of "dffits"
...ndering what the definition of "dffits" in R language is. Let me show you an simple example. function() { library(MASS) xx <- c(1,2,3,4,5) yy <- c(1,3,4,2,4) data1 <- data.frame(x=xx, y=yy) lm.out <- lm(y~., data=data1, x=T) lev1 <- lm.influence(lm.out)$hat sig1 <- lm.influence(lm.out)$sigma res1 <- residuals(lm.out) ey <- fitted(lm.out) py <- ey + res1/(1-lev1) df1 <- dffits(lm.out, infl = lm.influence(lm.out)) df1 <- dffits(lm.out) print("df1: dffits") print(df1) my_df1 <- (ey-py)/(sig1*sqrt(lev1)) prin...
2005 Nov 09
2
About: Error in FUN(X[[1]], ...) : symbol print-name too long
...ctory = NULL, clearWD = FALSE) The objective of the program is to compare means of two independent samples that results in Beherens-Fisher posterior and in the model.file of WinBUGS "d2.bug" there is the following codes: model { for( i in 1 : 30 ) { x[i] ~ dnorm(mu1,sig1) } for( i in 1 : 30 ) { y[i] ~ dnorm(mu2,sig2) } mu1 ~ dnorm(50,1.0E-6) sig1 ~ dgamma(0.001,0.001) mu2 ~ dnorm(50,1.0E-6) sig2 ~ dgamma(0.001,0.001) lbda <- mu1 - mu2 } I??m a new user of WinBUGS and if someone detect error in the model codes too, I??...
2013 May 17
1
Error with adehabitatHR and kernelbb
...ppened to only one person and there was no answer to his post.  Someone could help me? ## commands BBtraj <- list() for (i in 1:(nrow(loc@data)-1)) { BBtraj[[i]] <- kernelbb(as.ltraj(loc@coords[i:(i+1),], date=loc@data$time[i:(i+1)], id = as.character(loc@data$id[i:(i+1)]), typeII = TRUE), sig1=as.numeric(as.character(loc@data$sig1[i])), sig2= 5, grid = 1000) }   Rémi Lesmerises, biol. M.Sc., Candidat Ph.D. en Biologie Université du Québec à Rimouski remilesmerises@yahoo.ca [[alternative HTML version deleted]]
2008 Feb 24
0
problem with ML estimation
...0, rep(0, 2), Sigma) mlebinorm<- function(startval, y)# startval = Initial Values to be passed , y= data { startval<-as.numeric(startval) oneside=matrix(c(0,0,0,0,-1,0,0,0,0,1),5,2) otherside = c(-0.9999999,-0.999999) n<- ncol(y) nf<- function(x) { mu1<-x[1] mu2<-x[2] sig1<-x[3] sig2<-x[4] rho<-x[5] nf<-(-n/2)*(log(sig1*sig2*(1-rho^2)))-(0.5/(1-rho^2)* (((y[1,1]-mu1)^2/sig1)- (2*rho*(y[1,1]-mu1)*(y[1,2]-mu2))/sqrt(sig1*sig2)+ (y[1,2]-mu2)^2/sig2)) for(i in 2:n) { nf<- nf - (0.5*(1-rho^2)* (((y[i,1]-mu1)^2/sig1)- (2*rho*(y[i,...
2008 May 16
0
How to determine sensible values for 'fnscale' and 'parscale' in optim
...#39;parscale' to use when finding, for example, the MLEs of a bivariate normal distribution using optim. Here's code for this example: ----------------------------------------------- library(MASS) # needed mvrnorm library(mvtnorm) # needed for dmvnorm set.sed(20080516) n=1000 mu1=3 mu2=5 sig1=7 sig2=20 rho=.5 sigmat=matrix(c(sig1^2,sig1*sig2*rho,sig1*sig2*rho,sig2^2),2) xy=mvrnorm(n,c(mu1,mu2),sigmat) # n = 1000 observations from this # distribution. obj=function(par,xy) # The function to maximize. { mu=par[1:2] sigmat=matrix(c(par[3]^2,par[3]*par[4]*par...
2010 Dec 01
1
[R-lme] Extract estimated variances from output of lme?
...mmary() of an lme object called "lme.exp1", for example ############################################# > summary(lme.exp1) Linear mixed-effects model fit by REML Data: DATA Log-restricted-likelihood: -430.8981 Fixed: fixed.exp1 .... Random effects: Formula: ~-1 + mu1 + log.sig1 | animID Structure: Diagonal mu1 log.sig1 Residual StdDev: 2.605223 0.1013134 3.876431 Correlation Structure: General Formula: ~1 | animID/fieldN Parameter estimate(s): Correlation: 1 2 0.612 Variance function: Structure: Different standard deviations per stratum Formula: ~1...
2009 Jan 04
1
POSIXct and chron issues with tz
...000 0.00 13.6 218.1 36.8 -999 65.1 -999 -999 18.2 0.2 0506010005 0.00 12.9 214.3 36.8 -999 65.5 -999 -999 16.9 0.2 0506010010 0.00 14.4 215.7 36.9 -999 65.4 -999 -999 20.4 0.2 *dataM.txt* doy yr mon day hr hgt1 hgt2 hgt3 co21 co22 co23 sig1 sig2 sig3 dif flag 244.02083 2005 09 01 00 2.5 5.8 9.1 -999.99 -999.99 -999.99 -999.99 -999.99 -999.99 -999.99 PRE 244.0625 2005 09 01 01 2.5 5.8 9.1 -999.99 -999.99 -999.99 -999.99 -999.99 -999.99 -999.99 PRE 244.10417 2005 09 01 02 2.5 5.8 9.1 -999.99 -999.99 -999.99 -999.99 -999.99 -999.99 -...
2012 Dec 07
0
apply a function at: dateX, dateX+1, dateX+2, ....
...s what I did with the help of Dennis Murphy last week: myframe3$day <- as.Date(myframe3$myframestime) hrfun <- function(d) { dxy <- d[, c("Long", "Lat")] d_ltraj <- as.ltraj(dxy, d$myframestime, id = d$AnimalID) dLiker <- liker (d_ltraj, sig2 = 18, rangesig1= c(1, 100) ) dBB <- kernelbb(d_ltraj, sig1=dLiker$Ernie$sig1, sig2=18) data.frame(AnimalID = unique(d$AnimalID), day = unique(d$day), h = kernel.area(dBB, unout=c("km2"))) } ddply(myframe3, .(day), hrfun) # i.e. I calculated the size of the homerange for Animal "Ernie&quot...
2008 Aug 08
2
aggregate
Dear All- I have a dataset that is comprised of the following: doy yr mon day hr hgt1 hgt2 hgt3 co21 co22 co23 sig1 sig2 sig3 dif flag 244.02083 2005 09 01 00 2.6 9.5 17.8 375.665 373.737 373.227 3.698 1.107 0.963 -0.509 PRE 244.0625 2005 09 01 01 2.6 9.5 17.8 393.66 384.773 379.466 15.336 11.033 5.76 -5.307 PRE 244.10417 2005 09 01 02 2.6 9.5 17.8 411.162 397.866 387.755 6.835 5.61 6.728 -10.112 PRE 244.145...
2007 Jan 22
0
Branch 'interpreter' - 3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_swf_decoder.c test/Makefile.am test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_tag.c test/swfedit_tag.h test/swfedit_token.c test/swfedit_token.h
...urned %d", ret); + } + inflateEnd (&z); + swfdec_buffer_unref (encoded); + if (ret < Z_OK) { + swfdec_buffer_unref (decoded); + return NULL; + } + return decoded; +} + +static SwfdecBuffer * +swf_parse_header1 (SwfeditFile *file, SwfdecBits *bits, GError **error) +{ + guint sig1, sig2, sig3, bytes_total; + + sig1 = swfdec_bits_get_u8 (bits); + sig2 = swfdec_bits_get_u8 (bits); + sig3 = swfdec_bits_get_u8 (bits); + if ((sig1 != 'F' && sig1 != 'C') || sig2 != 'W' || sig3 != 'S') { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR...
2005 Aug 19
2
FFT, frequs, magnitudes, phases
Hi, I'm in dire need of a fast fourier transformation for me stupid biologist, i.e. I have a heartbeat signal and would like to decompose it into pure sin waves, getting three vectors, one containing the frequencies of the sin waves, one the magnitudes and one the phases (that's what I get from my data acquisition software's FFT function). I'd be very much obliged, if someone
2006 Sep 01
0
defining error structure in bivariate mixed models
...fter another indic1 :- Indicator for variable one indic2 :- indicator for variable two d.time :- A covariate m.unit :- the grouping units. However I want to do this with the error structure for the grouping unit as follows sigma = ( sigma_1 0 ) ( 0 sigma_2) where sigma_1 = sig1 * AR1(rho1) = error relating to variable 1 sigma_2 = sig2* AR1(rho2) = error relating to variable 2 How can I do this using lme()? Any help is greatly appreciated. Regards Souvik Banerjee Junior Research Fellow Dept of Statistics University of calcutta [[alternative HTML version deleted]]
2007 May 08
0
Question on bivariate GEE fit
...sing unstructured covariance matrix. However, I want to fit a model for a structured variance covariance matrix. The error structure for the grouping unit is as follows sigma = ( sigma1 sigma12 ) ( sigma12 sigma2) sigma1, sigma2 and sigma12 are matrices with where sigma1 = sig1 * AR1(rho1) sigma2 = sig2* AR1(rho2) sigma12 = sig12 * AR1(rho12) My question is whether there is any method to fit such data using packages like gee or geepack (or may be any other package ) in R. The function genZcor() of geepack can be used to construct correlation but I have been unable to u...
2007 Apr 22
0
libswfdec/swfdec_swf_decoder.c
...er_new_and_alloc (dec->bytes_total - 8); z->next_out = s->uncompressed_buffer->data; z->avail_out = s->uncompressed_buffer->length; z->opaque = NULL; + return TRUE; } static int @@ -168,7 +173,8 @@ swf_parse_header1 (SwfdecSwfDecoder * s) s->compressed = (sig1 == 'C'); if (s->compressed) { SWFDEC_DEBUG ("compressed"); - swf_inflate_init (s); + if (!swf_inflate_init (s)) + return SWFDEC_STATUS_ERROR; } else { SWFDEC_DEBUG ("not compressed"); }
2012 Nov 27
5
loop with date
Hello, I tried to construct my very first loop today and completly failed :-( Maybe someone can help me? I have a dataframe somewhat like this one: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00", "25.09.2012 09:00", "25.09.2012 10:00", "25.09.2012
2008 Jan 07
0
12 commits - configure.ac doc/swfdec.types Makefile.am test/crashfinder.c test/dump.c test/Makefile.am test/swfdec-extract.c test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_list.c test/swfedit_list.h
...urned %d", ret); - } - inflateEnd (&z); - swfdec_buffer_unref (encoded); - if (ret < Z_OK) { - swfdec_buffer_unref (decoded); - return NULL; - } - return decoded; -} - -static SwfdecBuffer * -swf_parse_header1 (SwfeditFile *file, SwfdecBits *bits, GError **error) -{ - guint sig1, sig2, sig3, bytes_total; - - sig1 = swfdec_bits_get_u8 (bits); - sig2 = swfdec_bits_get_u8 (bits); - sig3 = swfdec_bits_get_u8 (bits); - if ((sig1 != 'F' && sig1 != 'C') || sig2 != 'W' || sig3 != 'S') { - g_set_error (error, G_FILE_ERROR, G_FILE_ERROR...
2007 Nov 07
0
36 commits - doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h
...>bytes_loaded; } + memcpy (s->buffer->data + dec->bytes_loaded, buffer->data, max); + dec->bytes_loaded += max; swfdec_buffer_unref (buffer); } @@ -163,17 +187,16 @@ swf_parse_header1 (SwfdecSwfDecoder * s) { SwfdecDecoder *dec = SWFDEC_DECODER (s); int sig1, sig2, sig3; - SwfdecBuffer *buffer; + SwfdecBuffer *buffer, *rest; SwfdecBits bits; guint8 *data; - /* NB: we're still reading from the original queue, since deflating is not initialized yet */ - buffer = swfdec_buffer_queue_pull (dec->queue, 8); - if (buffer == NULL) { + g_as...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...,7 +104,7 @@ swf_parse_header1 (SwfeditFile *file, Sw swfedit_token_add (SWFEDIT_TOKEN (file), "version", SWFEDIT_TOKEN_UINT8, GUINT_TO_POINTER (swfdec_bits_get_u8 (bits))); - bytes_total = swfdec_bits_get_u32 (bits); + bytes_total = swfdec_bits_get_u32 (bits) - 8; if (sig1 == 'C') { /* compressed */ @@ -113,7 +114,7 @@ swf_parse_header1 (SwfeditFile *file, Sw "Unable to uncompress file"); return ret; } else { - SwfdecBuffer *ret = swfdec_bits_get_buffer (bits, -1); + SwfdecBuffer *ret = swfdec_bits_get_buffer (bits, bytes_tota...
2007 Jan 25
0
Branch 'interpreter' - 28 commits - configure.ac libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_player.c
...,7 +104,7 @@ swf_parse_header1 (SwfeditFile *file, Sw swfedit_token_add (SWFEDIT_TOKEN (file), "version", SWFEDIT_TOKEN_UINT8, GUINT_TO_POINTER (swfdec_bits_get_u8 (bits))); - bytes_total = swfdec_bits_get_u32 (bits); + bytes_total = swfdec_bits_get_u32 (bits) - 8; if (sig1 == 'C') { /* compressed */ @@ -113,7 +114,7 @@ swf_parse_header1 (SwfeditFile *file, Sw "Unable to uncompress file"); return ret; } else { - SwfdecBuffer *ret = swfdec_bits_get_buffer (bits, -1); + SwfdecBuffer *ret = swfdec_bits_get_buffer (bits, bytes_tota...