-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
README Google Sheets Example Not Working as Expected #7
Comments
Hi ! Thanks for using the lib and for the feedback ! I reproduced the issue, I'll have a look asap. |
Thanks Roman. That did the trick! Now I'm running into a different issue and would greatly appreciate any help: I'm using the function below I created in Google Sheets, but am getting a #ERROR! that says "Error: unsupported problem detected (line 5838)". My goal is to calculate mean variance weights given an expected return stream, a covariance matrix, a target volatility, min weights, and max weights: function computeWts(rets, cv, targetVol, minWts, maxWts) { The arguments I'm passing are below (and are all in cells in Google Sheets): rets: cv: targetVol: minWts: maxWts: |
Re, Good to hear the fix issue is solved. I'll keep this issue to track the deployment of the code fix for Apps Script arrays management for the next release in Git. I've created another issue to track the problem with the MVO optimization -> #8 But in a nutshell, this behaviour is normal: currently, having identical returns in input is not supported. Cheers, Roman |
Solved in v0.0.10 |
Hi Roman -
Thanks for this library! I'm just getting started with it on Google Sheets but can't seem to get the example in the README to work. In Google Sheets, I added your library with the Script ID, using static version 15 (v0.0.9). Then, I pasted this function into the Script Editor:
function computeERCPortfolioWeights(covarianceMatrix) {
// Note: The input range coming from the spreadsheet is directly usable.
// Compute the ERC portfolio weights
var ercWeights = PortfolioAllocation.equalRiskContributionWeights(covarianceMatrix);
// Return them to the spreadsheet
return (ercWeights);
}
In cells A1:B2 of my Google Sheet, I entered a sample covariance matrix: [[1,0.3],[0.3,1]]. In cell A4, I typed the following formula: =computeERCPortfolioWeights(A1:B2) but I get a #ERROR! with Error:unsupported input type (line 238).
I would've expected to get weights in cells A4:B4 or A4:A5.
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: