Comments (8)
Hey @shayandavoodii, to run CORN (or any other algorithm) you just call e.g.
S = ... dataframe with RAW prices
algo = CORN(window=10, rho=0.1)
result = algo.run(S)
print(result.summary())
result.plot(weights=False, assets=False, ucrp=True, logy=True);
the other methods like init_step
or step_slow
are internal (should have been prefixed with underscore) and you don't need need to know about them. What is interesting for analysis are methods and attributes of result
from the code above.
from universal-portfolios.
Hey @shayandavoodii, to run CORN (or any other algorithm) you just call e.g.
S = ... dataframe with RAW prices algo = CORN(window=10, rho=0.1) result = algo.run(S) print(result.summary()) result.plot(weights=False, assets=False, ucrp=True, logy=True);the other methods like
init_step
orstep_slow
are internal (should have been prefixed with underscore) and you don't need need to know about them. What is interesting for analysis are methods and attributes ofresult
from the code above.
Hi! Thanks for your response! I have two other questions:
- Does this approach work for the other algorithms?
example:
algo=[ANOTHER_ALGORITHM]()
result=algo.run()
- Does the
result
variable in your code sample also contains optimal weights?
from universal-portfolios.
- Yes, all algorithms have consistent interface and it's enough to call
run()
on them - I guess you mean algorithm weights by "optimal weights"? If yes, then it can be accessed as
result.B
. Check outresult.__dict__
for a dictionary of available attributes
from universal-portfolios.
- Yes, all algorithms have consistent interface and it's enough to call
run()
on them- I guess you mean algorithm weights by "optimal weights"? If yes, then it can be accessed as
result.B
. Check outresult.__dict__
for a dictionary of available attributes
I meant the weight of each stock which should be the output of the algorithm. But, what are the result.weights
then?
from universal-portfolios.
result.weights
is a method that is run internally and returns B
. What you're looking for is result.B
.
algo.weights
is a method that is run internally and returns B
. It is then saved as result.B
attribute which is identical to result.weights
.
from universal-portfolios.
result.weights
is a method that is run internally and returnsB
. What you're looking for isresult.B
.
Thanks!
Just in case of curiosity, Do you mean, result.weights
returns the same thing as result.B
?
from universal-portfolios.
Yes, it's exactly the same. Sorry, I thought you were talking about algo.weights(...)
method. Updated my previous answer.
from universal-portfolios.
Yes, it's exactly the same. Sorry, I thought you were talking about
algo.weights(...)
method. Updated my previous answer.
Thanks a lot!
from universal-portfolios.
Related Issues (20)
- It seem like the two functions "run" and "run_combination" do not calculate the same the total_wealth? HOT 6
- some question about the transaction cost code HOT 1
- Question about data format HOT 3
- Data reference HOT 2
- Convergence Issue: "Converged, but not successfully." and Weight Sum Not Equal to 1 HOT 3
- LINK : fatal error LNK1181: cannot open input file βm.libβ # issue HOT 1
- undefined self.window in update_tco() in algo.py HOT 1
- Invalid equity result using result weight
- MaybeEncodingError while using the run_combination() method
- Issue with Mac M1 HOT 2
- Data information HOT 3
- 2 questions HOT 1
- Installation Issues HOT 10
- a self.eta error in TCO
- Try to include transaction cost into OLMAR, but does not work HOT 1
- Assertion error # update logarithms, fees, etc. AssertionError:` HOT 2
- tools.simplex_project() returns the largest positive vector only? HOT 1
- There are several FeatureWarnings with the code
- Equity calculation, shift issue? HOT 5
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 universal-portfolios.