Comments (9)
That's not implemented yet, no. Would you be interested in that feature?
from quadpy.
100%!
from quadpy.
Give me some details. What's the dimensionality? What does the function look like? etc.
from quadpy.
I am rewriting the R-code in the Appendex of this paper
import scipy.stats as ss
def G(f, x, n, theta, a, b, c1, c2, k):
def l_3_1(p, theta):
if p > (1 / theta):
kelly = (p * theta - 1) / (theta - 1)
else:
kelly = 0
if p < (f * (theta - 1) + 1) / theta:
loss_func = (c1 + c2) * (abs(f - kelly) ** k)
else:
loss_func = 0
return loss_func * ss.beta.pdf(p, a + x, n - x + b)
def l_3_2(p, theta):
if p > (1 / theta):
kelly = (p * theta - 1) / (theta - 1)
else:
kelly = 0
if p >= (f * (theta - 1) + 1) / theta:
loss_func = c2 * (abs(f - kelly) ** k)
else:
loss_func = 0
return loss_func * ss.beta.pdf(p, a + x, n - x + b)
# integrate the loss functions
part_1 = quadpy.relevantFunction(l_3_1,
lowerLimit=0,
upperLimit=(f * (theta - 1) + 1) / theta,
tol=1e-10)
part_2 = quadpy.relevantFunction(l_3_2,
lowerLimit=(f * (theta - 1) + 1) / theta,
upperLimit=1,
tol=1e-10)
# return the sum of the two integrals
return part_1 + part_2
What do you think?
from quadpy.
Those integrals are just one-dimensional, right?
from quadpy.
You're right. Excuse my ignorance, but which quadpy
function would you use for this then?
from quadpy.
quadpy.quad
https://github.com/sigma-py/quadpy#using-quadpy
More things are a little weird about the implementation, but perhaps you'll be able figure it out by yourself.
from quadpy.
I understand your point and altered my script.
Can you show me how to use quadpy.quad
to integrate over multiple limits? I created a separate Stackoverflow-question as this topic can be closed.
from quadpy.
If you need any more help with this, note that Sigma licenses come with proritized bug fixing. Just let us know your license e-mail address and we'll tackle the issue.
from quadpy.
Related Issues (20)
- ValueError: Need x21 < 0.3 (also why is the code encrypted?) HOT 8
- Problem with vectorization HOT 6
- Quadpy usage HOT 1
- The source code is not available HOT 1
- Status of package and licensing HOT 4
- Quadpy is now asking for a sigma license HOT 18
- Can't import HOT 8
- Orthopy version no longer supported HOT 9
- version of orthopy no longer supported HOT 5
- Return points and values for integrate_adaptive HOT 1
- Importing quadpy causes python to quit without any error message HOT 4
- Issue upgrading quadpy HOT 7
- Unable to find valid license for Sigma. HOT 3
- Recurrent issue with sigma license HOT 5
- NameError: name 'c2' is not defined HOT 3
- Quadpy RuntimeError HOT 7
- Integrate over multiple limits at once using Quadpy HOT 8
- newest pip version not importable HOT 1
- the integrals with Heaviside function are very inaccurate HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quadpy.