search for: meanval

Displaying 7 results from an estimated 7 matches for "meanval".

2009 Sep 28
2
probability density function for maximum values in repeated finite samples from a normal distribution??
this is probably not really a R specific question, if so apologies for off-topic posting: I'm interested in the probability density function of the maximum values from repeated samples of size N from a normal distribution: smp <- rnorm(N, meanval, stdev) with some mean 'meanval' and standard deviation 'stdev'. I would like to know what is the frequency distribution of max(smp) if I draw many such samples? if I investigate this simply via a simulation, I get of course approximate results (and see that the resulting distrib...
2017 Aug 24
1
Problem in optimization of Gaussian Mixture model
...of segments latter* and xnorm is simply calculating the dnorm *xnorm*=function(param, opt = rep(NA, 2)){ if (any(!sapply(opt, is.na))) { i = !sapply(opt, is.na) # Fix non-NA values param[i] <- opt[i] } xval= param[1] seg <- param[2] sum_prob=0 val=0 l=3 meanval=c(506.8644, 672.8448, 829.902) sigmaval=c(61.02859, 9.149168, 74.84682) coeffval(0.1241933, 0.6329082, 0.2428986) for(n in 1 :l) { mu=meanval[seg,n] sg=sigmaval[seg,n] cval=coeffval[seg,n] val=cval*(dnorm(xval,mu,sg)) #print(paste0("The dnorm value for x is.: &...
2011 Oct 10
1
variable scope for deltavar function from emdbook
Dear all, I want to use the deltavar() function from emdbook. I can use it directly from the command terminal but within a function it behaves weird. Working example: ---------------------- library("emdbook") fn <- function() { browser() y <- 2 print(deltavar(y*b2, meanval=c(b2=3), Sigma=1) ) } x <- 2 print(deltavar(x*b1, meanval=c(b1=3), Sigma=1) ) y<-3 fn() ------------------------ running this returns 4 for the first function call, which is fine. For the call of deltavar in fn(), I get 9, i.e. the function uses y<-3 instead of the local y<-2. If y...
2007 Apr 19
2
Using "mean" if two values are identical
Hello, I have got a question. I've got a matrix (mail end) with the colnames x, y, z. In this matrix are different measurements. x and y are risign coordinates. My question. Always, if the "x" AND "y" coordinates are the same, I want to get the mean of their z values. e.q. " x" AND "y" in line1 and line8 are identical: 29 4.5 --> mean of
2005 Jul 20
4
poisson fit for histogram
I haven't been an R lister for a bit, but I hope to enlist someone's help here. I think this is a simple question, so I hope the answer is not much trouble. Can you please respond directly to this email address in addition to the list (if responding to the list is warranted)? I have a histogram and I want to see if the data fit a Poisson distribution. How do I do this? It is
2010 Dec 16
2
moving average with gaps in time series
I have a time series with interval of 2.5 minutes, or 24 observations per hour. I am trying to find a 1 hr moving average, looking backward, so that moving average at n = mean(n-23 : n) The time series has about 1.5 million rows, with occasional gaps due to poor data quality. I only want to take a 1 hour moving average for those periods that are complete, i.e. have 24 observations in the
2008 Aug 01
1
Confidence intervals with nls()
I have data that looks like O.lengthO.age 176 1 179 1 182 1 ... 493 5 494 5 514 5 606 5 462 6 491 6 537 6 553 6 432 7 522 7 625 8 661 8 687 10 704 10 615 12 (truncated) with a simple VonB growth model from within nls(): plot(O.length~O.age, data=OS) Oto = nls(O.length~Linf*(1-exp(-k*(O.age-t0))), data=OS, start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE) mod <- seq(0, 12)