similar to: Integral of PDF

Displaying 20 results from an estimated 3000 matches similar to: "Integral of PDF"

2010 Oct 04
1
Help with apply
Suppose I have the following data: tmp <- data.frame(var1 = sample(c(0:10), 3, replace = TRUE), var2 = sample(c(0:10), 3, replace = TRUE), var3 = sample(c(0:10), 3, replace = TRUE)) I can run the following double loop and yield what I want in the end (rr1) as: library(statmod) Q <- 2 b <- runif(3) qq <- gauss.quad.prob(Q, dist = 'normal', mu = 0, sigma=1) rr1 <- matrix(0,
2010 Sep 29
1
nlminb and optim
I am using both nlminb and optim to get MLEs from a likelihood function I have developed. AFAIK, the model I has not been previously used in this way and so I am struggling a bit to unit test my code since I don't have another data set to compare this kind of estimation to. The likelihood I have is (in tex below) \begin{equation} \label{eqn:marginal} L(\beta) = \prod_{s=1}^N \int
2010 Mar 19
3
strange behavior, adds new field by non-existent field
data: > tmp1 Date HrMn Temp Q.4 1 19450101 0900 -37.0 1 2 19450101 1000 -35.9 2 3 19450101 1100 -35.9 3 4 19450101 1200 -36.4 4 5 19450101 1300 -36.4 5 6 19450101 1400 -36.4 6 7 19450101 1500 -36.4 7 8 19450101 1600 -37.5 9 Accidentally, I did this (I meant to write Q.4 instead of Q here) > tmp1$Q[tmp1$Q!="1" & tmp1$Q!= "5"]<-NA I would
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)
2010 Jan 11
2
Documentation: format of read.table help text (PR#14180)
Dear R developers, I find the format of descriptions of the arguments in the read.table help text slightly inconsistent. For example, the logical arguments comes in seven different formats, more or less explicit about the consequences of a TRUE (or FALSE): 1. check.names logical. If TRUE then the names... 2. blank.lines.skip logical: if TRUE blank lines... 3. flush logical: if TRUE,
2010 Apr 22
2
Compare two data frames
I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1 <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2 <- d1[, c('y', 'x')] The first dataframe d1 has more variables than d2 and the variable columns are in a different order. So, what I want to do is compare the two frames on the variables that are common between
2010 Jun 29
1
Use of processor by R 32bit on a 64bit machine
Dear all, I've recently purchased a new 64bit system with an intel i7 quadcore processor. As I understood (maybe wrongly) that to date the 32bit version of R is more stable than the 64bit, I installed the 32bit version and am happily using it ever since. Now I'm running a whole lot of models, which goes smoothly, and I thought out of curiosity to check how much processor I'm using. I
2010 Mar 18
1
probable timezone confusion with as.yearmon
It looks like a timezone issue, and it's causing confusion to me at least. My original data: gmt <- c("19880101 0000", "19880101 0100", "19880101 0300", "19880101 0400", "19880101 0500", "19880101 0600") These were converted to local dates/times with akst<-strptime(gmt,format="%Y%m%d %H%M")-(3600*9) # because I want
2010 Mar 14
3
the error in DoSimulateRF function
Hello, I am a graduate student of University of Florida. I am trying to run a process variation model and I am facing the following error. ------------------------------------------------------------- Analysis of geostatistical data For an Introduction to geoR go to http://www.leg.ufpr.br/geoR geoR version 1.6-27 (built on 2009-10-15) is now loaded
2002 Aug 23
2
Surprising result from integrate
Hi all, sorry for this extensive question, but I think that I'm missing something fundamental. I stepped into a surprising result with the integrate function and I would be glad if someone could put some light onto this. I try to integrate over an s-shaped growth-function. The results from this calculation seem to be correct for small values of t. Just for fun I tried some large values and
2010 Mar 01
2
Thougt I understood factors but??
Hi, consider the following > a<-gl(3,3,9) > a [1] 1 1 1 2 2 2 3 3 3 Levels: 1 2 3 > levels(a)<-3:1 > a [1] 3 3 3 2 2 2 1 1 1 Levels: 3 2 1 > a<-gl(3,3,9) > factor(a,levels=3:1) [1] 1 1 1 2 2 2 3 3 3 Levels: 3 2 1 It is probably something obvious I missed, but reading the documentation of factor, and levels I would have thought that both should produce the same output as
2011 Feb 25
1
Error: address 0x6951c20, cause 'memory not mapped'
Dear R list, I get a strange error in R: *** caught segfault *** address 0x6951c20, cause 'memory not mapped' Traceback: 1: .C("spline_eval", z$method, nu = as.integer(n), x = as.double(xout), y = double(n), z$n, z$x, z$y, z$b, z$c, z$d, PACKAGE = "stats") 2: spline(gam.data$x[, col.data], gam.smooths.all$fit[, m], xout = gam.results.global[m, ,
2011 Aug 30
1
R crash
Dear users, By running the script below, R crashes systematically at the last command, namely dev.off(), on Windows 7, but not on Windows XP. I therefore don't provide a reproducible example and do not really extract the relevant parts of the script because it has most likely nothing to do with the script itself. I can do it though if you think it might be relevant. R crashes on Windows
2010 Jul 13
2
Zoo - bug ???
Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a <- zoo(c(NA,1:9),1:10) Now If I do rollapply(a,FUN=mean,width=3,align="right") I get > rollapply(a,FUN=mean,width=3,align="right") 3 4 5 6 7 8 9 10 NA NA NA NA NA NA NA NA But I shouldn't be getting NA right ? i.e for index 10 I should get (1/3)*(9+8+7)
2010 Dec 06
3
0.5 != integrate(dnorm,0,20000) = 0
Hello: The example "integrate(dnorm,0,20000)" says it "fails on many systems". I just got 0 from it, when I should have gotten either an error or something close to 0.5. I got this with R 2.12.0 under both Windows Vista_x64 and Linux (Fedora 13); see the results from Windows below. I thought you might want to know. Thanks for all your work in creating
2009 Jun 01
2
Sweave:Figures from plot (LME output) not getting generated (pdf or eps)
Hi, I seem to be facing a strange problem when I use Sweave for creating a LaTeX document of the R lme() output --- The EPS and PDF figure files get created, but are empty. I have attached a reproducible example below (taken from the R lme() help example). ------------------------------------------------------------------------------------ \documentclass[a4paper,10pt]{article}
2010 Jan 01
4
How to use read.table with Hebrew column names ?
Hello dear R help group, I am trying to read a .txt file, with Hebrew column names, while keeping the column names looking well in R - but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And am trying the command: read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t") This returns me with: X.....ª X...ª......
2008 Jul 17
2
nested calls, variable scope
Below is an example of a problem I encounter repeatedly when I write functions. A call works at the command line, but it does not work inside a function, even when I have made sure that all required variables are available within the function. The only way I know to solve it is to make the required variable global, which of course is dangerous. What is the elegant or appropriate way to solve
2010 Nov 17
2
Numerical integration
Hi! I was wondering if there are any other functions for numerical integration, besides 'integrate' from the stats package, but which wouldn't require the integrand to be vectorized. Oh, and must be capable of integrating over (-inf,+inf). Thanks in advance, Eduardo Horta [[alternative HTML version deleted]]
2010 Jun 05
1
Write.fwf works from Mac, throws different number of row error in Windows
Hello, I am having a problem with write.fwf in Windows. I wrote a code to ingest a number of text files with weather data in them, process them, and then output a text file with two parts: 1) a set of column names, 2) the processed data table. I wrote and tested the program on my Mac, and it worked fine. However, on the windows machine, where I intend the work to be done, when I run the