Communitygithub.com

r_portfolio_analysis_optimization_workflow

dplyr과 PortfolioAnalytics를 사용하여 R에서 4단계 종합 금융 분석을 실행합니다: 요약 통계, 제약 조건에 따른 자산 선택(보상/위험 및 P/E 기반), 데이터 탐색, 포트폴리오 최적화(GMVP 및 Tangency)를 ROI 솔버와 특정 제약 조건으로 수행합니다.

r_portfolio_analysis_optimization_workflow란 무엇인가요?

이 스킬은 R을 사용하여 체계적인 포트폴리오 분석 워크플로우를 수행하는 AI 에이전트를 위한 것입니다. 에이전트는 4단계로 구성된 분석을 실행합니다: (1) 로그 수익률 계산 및 요약 통계 생성, (2) 보상/위험 비율과 P/E 비율이라는 두 가지 전략을 사용하여 정확히 5개의 자산(최소 1개의 상품 및 1개의 외환 필수 포함)을 선택하고 결과를 CSV/XLSX로 내보내기, (3) 상관 플롯, 히스토그램, Q-Q 플롯, 박스 플롯을 포함한 데이터 탐색 시각화, (4) GMVP(공매도 금지, box 제약 조건 포함)와 Tangency 포트폴리오(공매도 허용, box 제약 조건 없음)를 각각 ROI 솔버로 최적화하고 최적 가중치를 추출합니다. dplyr과 PortfolioAnalytics 라이브러리를 활용하며, 코드는 완전히 실행 가능하고 데이터 정리(na.omit)를 포함합니다. 이 스킬은 Claude Code, Cursor, Codex와 같은 AI 코딩 에이전트에 적합하며, 금융 분석가와 R 개발자에게 유용합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/David-Li0406/meta-skill-evloving/tree/HEAD/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/r_portfolio_analysis_optimization_workflow

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

r_portfolio_analysis_optimization_workflow은(는) 무엇을 하나요?

dplyr과 PortfolioAnalytics를 사용하여 R에서 4단계 종합 금융 분석을 실행합니다: 요약 통계, 제약 조건에 따른 자산 선택(보상/위험 및 P/E 기반), 데이터 탐색, 포트폴리오 최적화(GMVP 및 Tangency)를 ROI 솔버와 특정 제약 조건으로 수행합니다.

프롬프트

역할 및 목표

금융 분석가 및 R 프로그래머로서 행동하십시오. 다음 네 가지 뚜렷한 단계로 구성된 종합적인 포트폴리오 분석 워크플로우를 실행하십시오: 요약 통계, 포트폴리오 유니버스 선택, 데이터 탐색, 포트폴리오 최적화.

도구 및 라이브러리

데이터 조작에는 dplyr, 최적화에는 PortfolioAnalytics, 최적화 솔버로는 ROI를 R에서 사용하십시오.

운영 규칙 및 제약 조건

  1. 요약 통계 (Q1):

    • 자산에 대한 로그 수익률을 계산하십시오.
    • 자산으로부터 동일 가중 지수를 생성하십시오.
    • 개별 자산과 지수 모두에 대한 요약 통계를 추정하십시오.
    • 사용된 수익률 측정값(예: 로그 수익률)과 그 근거를 명시적으로 밝히십시오.
  2. 포트폴리오 유니버스 선택 (Q2):

    • 두 가지 뚜렷한 전략에 따라 정확히 5개의 자산을 선택하십시오.
    • 제약 조건: 최소 1개의 상품(Commodity)과 1개의 외환(Forex)을 포함해야 합니다.
    • 전략 1 (보상 대 위험):
      • 보상 대 위험을 (중간 수익률 / 표준 편차)로 계산하십시오.
      • 이 지표를 기준으로 자산의 순위를 매기십시오.
      • 상위 5개 자산을 선택하십시오.
      • 동점 처리: 더 높은 평균 수익률을 가진 자산을 선택하십시오.
    • 전략 2 (P/E 비율):
      • 주가수익비율(P/E Ratio)을 기준으로 자산을 선택하십시오 (오름차순 선호).
    • 두 전략에 대해 선택된 자산을 CSV 또는 XLSX 파일로 내보내십시오.
  3. 데이터 탐색 (Q3):

    • 두 전략 모두에 대해 선택된 자산에 대해 다음 시각화를 수행하십시오:
      • 상관 플롯
      • 히스토그램
      • Q-Q 플롯
      • 박스 플롯
    • 시각화로부터 추론을 도출하십시오.
  4. 포트폴리오 최적화 (Q4):

    • 두 전략 하에서 선택된 자산의 가중치 할당을 비교하십시오.
    • PortfolioAnalytics와 ROI 솔버를 사용하여 각 전략에 대해 두 가지 목적 함수의 가중치를 계산하십시오.
    • 글로벌 최소 분산 포트폴리오 (GMVP):
      • 목표: 위험 최소화 (objective_type = "minrisk").
      • 제약 조건: 공매도 금지.
      • 구현: weight_sum 제약 조건 (min_sum=1, max_sum=1)과 box 제약 조건 (min=0, max=1)을 추가하십시오.
    • 접선 포트폴리오 (Tangency):
      • 목표: 샤프 비율 최대화 (objective_type = "tangency").
      • 제약 조건: 공매도 허용.
      • 구현: weight_sum 제약 조건 (min_sum=1, max_sum=1)을 추가하십시오. box 제약 조건은 추가하지 마십시오.
    • 실행: 두 전략 모두 optimize_method = "ROI"를 사용하십시오. extractWeights를 사용하여 최적 가중치를 추출하고 출력하십시오.
    • 각 조합에 대해 포트폴리오 수익률 및 포트폴리오 위험 측정값을 계산하고 설명하십시오.

의사소통 및 스타일 선호 사항

  • 코드가 데이터 정리(예: na.omit)를 처리하는지 확인하십시오.
  • 제약 조건 및 계산에 대한 논리를 설명하는 명확한 주석을 제공하십시오.
  • 변수 이름이 사용자의 맥락과 일치하는지 확인하십시오 (예: assets, log_returns, strategy1_selection).
  • 라이브러리 로딩 및 포트폴리오 사양을 포함한 완전하고 실행 가능한 R 코드 청크를 제공하십시오.

안티 패턴

  • 상품 및 외환 자산에 대한 특정 제약 조건을 건너뛰지 마십시오.
  • 전략 1과 전략 2의 제약 조건을 혼동하지 마십시오.
  • 선택 파일 내보내기를 실패하지 마십시오.
  • GMVP 또는 Tangency 포트폴리오에 대해 잘못된 제약 조건 정의를 사용하지 마십시오 (예: GMVP에서 공매도를 허용하거나 Tangency에서 금지).
  • 자산 데이터를 임의로 생성하지 마십시오. 사용자가 제공한 구조를 사용하거나 데이터가 없는 경우 일반적인 자리 표시자를 사용하십시오.
  • 표준 PortfolioAnalytics 워크플로우와 호환되지 않는 사용되지 않는 함수나 구문을 사용하지 마십시오.

트리거

  • 포트폴리오 분석 워크플로우
  • 금융 포트폴리오 최적화
  • 자산 선택 전략
  • 글로벌 최소 분산 포트폴리오
  • 접선 포트폴리오 계산
  • R에서 포트폴리오 최적화
  • PortfolioAnalytics 최적화

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

David-Li0406/meta-skill-evloving

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.

David-Li0406/meta-skill-evloving

Create technical diagrams using Mermaid syntax for architecture, sequences, ERDs, flowcharts, and state machines. Use for visualizing system design, data flows, and processes. Triggers: diagram, mermaid, architecture diagram, sequence diagram, flowchart, ERD, entity relationship, state diagram, C4 model, component diagram, visualize, draw.

David-Li0406/meta-skill-evloving

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

David-Li0406/meta-skill-evloving

Complete color manipulation and green screen effects system. PROACTIVELY activate for: (1) Green screen/chromakey removal, (2) Color grading with LUTs, (3) Color correction (levels, curves, white balance), (4) Colorkey/color removal effects, (5) Hue/saturation manipulation, (6) Color space conversions (BT.709, BT.2020, HDR), (7) Color isolation effects, (8) Teal and orange look, (9) Vintage/film looks, (10) Color keying for transparency. Provides: chromakey and colorkey filters, LUT application (lut3d), curves and levels adjustment, color balance, selective color manipulation, color space handling, HDR tone mapping, professional color grading chains.

David-Li0406/meta-skill-evloving

Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.

David-Li0406/meta-skill-evloving

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

David-Li0406/meta-skill-evloving

Build with OpenAI's stateless APIs - Chat Completions (GPT-5, GPT-4o), Embeddings, Images (DALL-E 3), Audio (Whisper + TTS), and Moderation. Includes Node.js SDK and fetch-based approaches for Cloudflare Workers. Use when: implementing chat completions with GPT-5/GPT-4o, streaming responses with SSE, using function calling/tools, creating structured outputs with JSON schemas, generating embeddings for RAG (text-embedding-3-small/large), generating images with DALL-E 3, editing images with GPT-Image-1, transcribing audio with Whisper, synthesizing speech with TTS (11 voices), moderating content (11 safety categories), or troubleshooting rate limits (429), invalid API keys (401), function calling failures, streaming parse errors, embeddings dimension mismatches, or token limit exceeded.

David-Li0406/meta-skill-evloving

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

David-Li0406/meta-skill-evloving

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

David-Li0406/meta-skill-evloving

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

David-Li0406/meta-skill-evloving

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

David-Li0406/meta-skill-evloving

Best practices for Remotion - Video creation in React

David-Li0406/meta-skill-evloving

Provides bidirectional translation (Chinese/English), grammar checking, and sentence polishing. Supports specific tense constraints, context-aware tone adjustment, and natural expression optimization. Outputs direct text without formatting.

David-Li0406/meta-skill-evloving

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

David-Li0406/meta-skill-evloving

生成Python脚本,利用FFmpeg将图片序列按3x3布局合并,或将合并图拆分。要求使用subprocess模块执行命令,并支持用户交互式输入路径。

David-Li0406/meta-skill-evloving

SOP for extracting and analyzing promotional activity details, handling time formatting, location mapping, payment logic, and step-by-step process validation.

David-Li0406/meta-skill-evloving

Specializes in creating TikTok short video scripts using an anthropomorphic 'Chef' perspective to explain wildlife food chains and survival environments, utilizing real field footage.

David-Li0406/meta-skill-evloving

针对TikTok平台,以拟人化视角(如动物作为厨师)创作系列短视频脚本。重点介绍野生动物、食物链及生态环境,要求使用野外实拍素材,风格幽默且具有教育意义。

David-Li0406/meta-skill-evloving

Generates KWL (Know, Want to know, Learned) charts for educational videos, specifically BrainPOP, using simple 7th-grade language and short, concise bullet points.

David-Li0406/meta-skill-evloving

Tracks complex, multi-session work using the Beads issue tracker and dependency graphs, and provides persistent memory that survives conversation compaction. Use when work spans multiple sessions, has complex dependencies, or needs persistent context across compaction cycles. Trigger with phrases like "create task for", "what's ready to work on", "show task", "track this work", "what's blocking", or "update status".

관련 스킬