integrate

Can we use Base R to find the 95% of the area under a curve?

拟墨画扇 提交于 2019-12-04 11:00:45
问题 Using Base R, I was wondering if I could determine the 95% area under the curve denoted as posterior below? More specifically, I want to move from the mode (the green dashed line) toward the tails and then stop when I have covered 95% of the curve area. Desired are the x-axis values that are the limits of this 95% area as shown in the picture below? prior = function(x) dbeta(x, 15.566, 7.051) likelihood = function(x) dbinom(55, 100, x) posterior = function(x) prior(x)*likelihood(x) mode =

Why does integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 100000) give 0?

我的梦境 提交于 2019-12-04 06:25:20
问题 This function is positive from 0 to inf, why give larger than 1000 will yield to 0, not reasonable. import scipy.integrate as integrate from math import * integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 1000) Out[52]: (0.3989422804014328, 1.6471510195390376e-11) integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 100000) Out[54]: (0.0, 0.0) 回答1: For x larger than approx. 39, exp(-x**2/2) gives 0.0. When the upper limit of integration is 100000, the fraction of the interval of

Using scipy.integrate.quad to perform 3D integral

两盒软妹~` 提交于 2019-12-04 05:03:35
问题 Motivation for the question I'm trying to integrate a function f(x,y,z) over all space. I have tried using scipy.integrate.tplquad & scipy.integrate.nquad for the integration, but both methods return the integral as 0 (when the integral should be finite). This is because, as the volume of integration increases, the region where the integrand is non-zero gets sampled less and less. The integral 'misses' this region of space. However, scipy.integrate.quad does seem to be able to cope with

Integrate: the integral is probably divergent

南楼画角 提交于 2019-12-04 04:02:29
问题 I was doing some integration into a loop using integrate and I come up with an error I can't understand neither get rid of. Here is a MWE I could extract: u_min = 0.06911363 u_max = 1.011011 m = 0.06990648 s = 0.001092265 integrate(f = function(v){pnorm(v, mean = m, sd = s, lower.tail = FALSE)}, u_min, u_max) this returns an error "the integrale is probably divergent" which is obviously false. I tried to modify the parameters a little bit and got this working for example: u_min <- 0.07 u_max

Integrating bank accounts [closed]

为君一笑 提交于 2019-12-03 21:34:07
Is there any API to integrate bank accounts into a .NET application? I am looking to provide the user an ability to pull bank statements into my software. Please suggest. You'll need to ask the bank that , which bank are you with? Most major providers allow some kind of programmatic access to their systems. Failing that (and security aside) you could generate a HTTP Request/Response to the banks website and replying on being provided the correct credentials should be able to retreive any information available online (such as past statements) - bonus if they provide them in PDF format. Not sure

Are there tools to integrate Java and C++?

拈花ヽ惹草 提交于 2019-12-03 14:40:13
thanks for reading this question. I am doing this homework which need a GUI as frond end to integrate with back end code which written in C++. I wanna to write this front end GUI in java as its cross-platform feature and strong graphic components. Is there any good way I can integrate java and C++ well? Thank you Swig works very well. It's a means to bind C/C++ to a huge variety of languages. I have experience of using this to talk to C++ with very little grief. Here's the manual page on using Swig and Java together. The tutorial gets you going very quickly, with many examples including Java.

Solr/Lucene分布式搜索,Solr Integrate katta step1

情到浓时终转凉″ 提交于 2019-12-03 13:03:16
katta项目主页: http://katta.sourceforge.net/ Katta的介绍: http://blog.sina.com.cn/s/blog_43b8e6dd0100ne4b.html 关于Solr整合Katta的讨论 https://issues.apache.org/jira/browse/SOLR-1395 1.下载 katta: http://sourceforge.net/projects/katta/files/katta/ solr: http://lucene.apache.org/solr/ 在上面的讨论中似乎是使用的Lucene4.0,Katta0.6.2 我直接使用 katta:0.6.3 solr:3.6.1 2.分布式搜索是一个好的解决方案,自己动手开发是有很大难度的.我相信使用Lucene的人很多,并且也很多是直接使用Solr的.能把Lucene的索引文件放到Hadoop HDFS文件系统上我想是一个终极解决方案,但是最终要的是能做索引分片,并且能提供分布式搜索.Lucene的创始人 Doug Cutting 也是建议katta这个解决方案的.见: http://wiki.apache.org/hadoop/DistributedLucene 因为涉及的技术比较多,而且技术门槛也较高,鲜有人整合成功.其中涉及的技术包括:Lucene

Can we use Base R to find the 95% of the area under a curve?

我只是一个虾纸丫 提交于 2019-12-03 06:50:13
Using Base R, I was wondering if I could determine the 95% area under the curve denoted as posterior below? More specifically, I want to move from the mode (the green dashed line) toward the tails and then stop when I have covered 95% of the curve area. Desired are the x-axis values that are the limits of this 95% area as shown in the picture below? prior = function(x) dbeta(x, 15.566, 7.051) likelihood = function(x) dbinom(55, 100, x) posterior = function(x) prior(x)*likelihood(x) mode = optimize(posterior, interval = c(0, 1), maximum = TRUE, tol = 1e-12)[[1]] curve(posterior, n = 1e4) P.S In

Divergent Integral in R is solvable in Wolfram

江枫思渺然 提交于 2019-12-02 08:44:22
I know that I asked the same question before, but as I am pretty new here the question was asked poorly and not reproducible. Therefore I try to do it better here. (If I only edit the old one probably nobody will read it) I have this double integral that I would like to integrate: Here is a picture ff<-function(g,t) exp((16)*g)*exp(-8*t-(-t-0.01458757)^2/(0.0001126501)) integrate(Vectorize(function(t) integrate(function(g) ff(g,t), -2.5,0)$value), -2, 2) Running this in R gives me the error: the integral is probably divergent When I try to run the sam function in Wolfram it gives me a proper

Why does integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 100000) give 0?

£可爱£侵袭症+ 提交于 2019-12-02 07:47:10
This function is positive from 0 to inf, why give larger than 1000 will yield to 0, not reasonable. import scipy.integrate as integrate from math import * integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 1000) Out[52]: (0.3989422804014328, 1.6471510195390376e-11) integrate.quad(lambda x: x*exp(-x**2/2)/sqrt(2*pi), 0.0, 100000) Out[54]: (0.0, 0.0) For x larger than approx. 39, exp(-x**2/2) gives 0.0. When the upper limit of integration is 100000, the fraction of the interval of integration where the function is nonzero is so small that the quad algorithm never sees it. As far as quad is