similar to: integration of two normal density

Displaying 20 results from an estimated 20000 matches similar to: "integration of two normal density"

2010 Jun 23
3
integrate dmvtnorm
Hello, everyone, I have a question about integration of product of two densities. Here is the sample code; however the mean of first density is a function of another random variable, which is to be integrated. ## f=function(x) {dmvnorm(c(0.6, 0.8), mean=c(0.75, 0.75/x))*dnorm(x, mean=0.6, sd=0.15)} integrate(f, lower=-Inf, upper=Inf) ## error message Error in dmvnorm(c(0.6, 0.8), mean = c(0.75,
2010 Jun 25
1
what "density" is plotting ?
Hi everyone, I am confused regarding the function "density". suppose that there is a sample x of 100 data points, and plot(density(x)) gives it's pdf ? or it's more like histogram only ? thanks for any answering Carrie [[alternative HTML version deleted]]
2008 Dec 08
1
Multivariate kernel density estimation
I would like to estimate a 95% highest density area for a multivariate parameter space (In the context of anova). Unfortunately I have only experience with univariate kernel density estimation, which is remarkebly easier :) Using Gibbs, i have sampled from a posterior distirbution of an Anova model with k means (mu) and 1 common residual variance (s2). The means are independent of eachother, but
2011 Aug 25
2
Adding a normal density curve over the empirical curve
Hi I have created the following plot over the empirical returns.. What I now want to do is to overlay a curve/line with the normal density as a comparison of the two. Does anyone know how to do this? (NB the last two lines are the problem, and are wrong, I know). Thank you in advance! Rikke http://r.789695.n4.nabble.com/file/n3768783/S%26P_500_spot_and_return_2010.csv
2011 Jun 25
2
Multivariate normal density in C for R
Does anyone know of a package that uses C code to calculate a multivariate normal density? My goal is to find a faster way to calculate MVN densities and avoid R loops or apply functions, such as when X and mu are N x K matrices, as opposed to vectors, and in this particular case, speed really matters. I would like to be able to use .C or .Call to pass X, mu, Sigma, and N to a C program and have
2006 Jan 20
2
big difference in estimate between dmvnorm and dnorm, how come?
Dear R community, I was trying to estimate density at point zero of a multivariate distribution (9 dimensions) and for this I was using a multinormal approximation and the function dmvnorm , gtools package. To have a sense of the error I tried to look the mismatch between a unidimensional version of my distribution and estimate density at point zero with function density, dmvnorm and dnorm. At
2009 Jun 22
1
The gradient of a multivariate normal density with respect to its parameters
Does anybody know of a function that implements the derivative (gradient) of the multivariate normal density with respect 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)
2010 Apr 12
1
Strange results from Multivariate Normal Density
Hello, I'm using dmnorm from the package {mnormt} and getting strange results. First, according to the documentation, dmnorm should return a vector of densities, and I'm only getting one value returned (which is what I would expect). I've been interpreting this as the joint density of all values in the x vector (which is what I want). Should a vector of densities be returned, and if
2008 Dec 05
3
How to calculate the distance between two density functions
Dear all, I wrote the following code to calculate the density functions for two data sets, respectively. den_str <-density(str_data$Similarity); den_non_str <-density(nonstr_data$Similarity); However, I would like to knowing the difference between den_str and den_non_str, that is, the difference between the region under the curve of the den_str and the region under the curve of
2004 Jul 06
3
Code density functions
Hello I would like to see the algorithm that R uses to generate density functions for several distributions (i.e. Normal,Weibull, etc). I tried: >dnorm function (x, mean = 0, sd = 1, log = FALSE) .Internal(dnorm(x, mean, sd, log)) <environment: namespace:stats> How can I see the code used for densities? Thanks!
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
2006 Apr 23
3
bivariate weighted kernel density estimator
Is there code for bivariate kernel density estimation? For bivariate kernels there is kde2d in MASS kde2d.g in GRASS KernSur in GenKern (list probably incomplete) but none of them seems to accept a weight parameter (like density does since R 2.2.0) -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at
2010 Apr 13
1
Lapack, determinant, multivariate normal density, solution to linear system, C language
r-devel list, I have recently written an R package that solves a linear least squares problem, and computes the multivariate normal density function. The bulk of the code is written in C, with interfacing code to the BLAS and Lapack libraries. The motivation here is speed. I ran into a problem computing the determinant of a symmetric matrix in packed storage. Apparently, there are no explicit
2001 May 10
3
lookup function for density(...) objects
Hi folks: Is there a lookup function that returns the variate given the cumulative probability for an object returned by the density(...) function? > mydata _ as.vector(mymatrix) > mydata.density _ density(mydata) > mydata.p80 _ lookup(mydata.density, p=0.8) # is there any function to accomplish this task? Thanks. Rajiv. -------- Rajiv Prasad, Postdoctoral Research Associate,
2010 Feb 15
4
density estimates for fixed points
Problem: Based on a n x 2 data matrix i want a kernel estimate of the bivariate density. However, i also wish to specify wich points the density should be calculated at. I can offcourse just write the full kernel density estimate as a R-code, but surely there must already exist some package for this operation? The package density(), seems to create a new matrix (depending on n), where the
2009 Sep 29
3
Probability of data values form DENSITY function
Hello,   Could someone help me please and to tell how to get the probability from empirical DENSITY (not parametric) for each data value (R function). For example, for normal distribution there is such a function like:   “dnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”   I need the same function only for the empirical DENSITY function (which does not correspond to any typical
2012 Feb 02
1
calculation of probability values from multivariate normal densities
Hi, I would like to know, if there's any R function, which allows calculation of probability values (0,1) from multivariate normal densities. I would be grateful for any output. Cheers, MG
2005 Jun 15
3
how to plot density distribution with a arrow pointer?
Hi all, for example: > X<- rnorm(1000) > X0 <- 0.899 I want to draw a density distribution plot with a arrow pointer indicating the position of X0, meanwhile, giving out the p-value. any functions? Thanks very much.
2011 Jan 16
3
rootogram for normal distributions
Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand why a rootogram displaying samples from the Poisson distribution looks like I expected it, whereas a rootogram using the normal distribution does not: library(latticeExtra) rootogram(~rpois(1000, lambda = 50), dfun = function(x) dpois(x, lambda = 50)) rootogram(~rnorm(1000), dfun = function(x) dnorm(x,mean(x),sd(x))) I
2011 Jan 02
1
How to compute the density of a variable that follows a proportional error distribution
Hello, I am trying to compute the density of a variable k that is either (1) Normally distributed; (2) Log-Normally distributed; or (3) follows proportional error distribution. I tried to search R-help and the answer for normal distribution was easy to find (please see 1c). I am not sure if my formula for dlnorm is correct (please see 2c below)? I really don't know what function to use for the