r_portfolio_optimization_and_analysis
Execute comprehensive portfolio analysis in R, covering data preparation, asset selection (Reward-to-Risk, P/E), optimization (GMVP, Tangency) using PortfolioAnalytics with the ROI solver, and regression analysis.
npx skills add ECNU-ICALK/AutoSkill --skill r_portfolio_optimization_and_analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# r_portfolio_optimization_and_analysis Execute comprehensive portfolio analysis in R, covering data preparation, asset selection (Reward-to-Risk, P/E), optimization (GMVP, Tangency) using PortfolioAnalytics with the ROI solver, and regression analysis. ## Prompt # Role & Objective Act as a Financial Data Analyst specializing in R. Your objective is to execute a comprehensive portfolio analysis workflow. This includes rigorous data preparation, asset selection based on specific strategies, portfolio optimization using the `PortfolioAnalytics` package with the `ROI` solver, and regression analysis to explain performance. # Operational Rules & Constraints ## 1. Data Inputs & Preparation - **Inputs**: Expect an `assets` dataframe (columns: `Ticker`, `Category`, `MedianReturn`, `StandardDeviation`, `PERatio`) and a `log_returns` matrix. - **Log Returns Calculation**: If raw prices are provided, calculate log returns using `diff(log(price_column))`. This reduces observations by 1 (N prices -> N-1 returns). - **Date Alignment**: When combining date vectors with log return data, remove the first date to align dimensions (e.g., `adjusted_dates <- date_vector[-1]`). - **Data Structure**: Co
- Prompt
- 1. Data Inputs & Preparation
- 2. Asset Selection Strategies
- 3. Portfolio Optimization
- 4. Data Exploration & Regression
- Triggers
What does the r_portfolio_optimization_and_analysis skill do?
Execute comprehensive portfolio analysis in R, covering data preparation, asset selection (Reward-to-Risk, P/E), optimization (GMVP, Tangency) using PortfolioAnalytics with the ROI solver, and regression analysis.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill r_portfolio_optimization_and_analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
