<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Alogorithm on The Personal Website of Myosotics</title>
    <link>/tags/alogorithm/</link>
    <description>Recent content in Alogorithm on The Personal Website of Myosotics</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Fri, 10 Nov 2023 00:00:00 +0000</lastBuildDate><atom:link href="/tags/alogorithm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Portfolio Selection with Feature Screening</title>
      <link>/blog/2023-11-10-portfolio-selection-with-feature-screening/</link>
      <pubDate>Fri, 10 Nov 2023 00:00:00 +0000</pubDate>
      
      <guid>/blog/2023-11-10-portfolio-selection-with-feature-screening/</guid>
      <description>算法和代码均来自文章：Jin-Hong Du, Yifeng Guo &amp;amp; Xueqin Wang (2023) High-Dimensional Portfolio Selection with Cardinality Constraints, Journal of the American Statistical Association, 118:542, 779-791, DOI: 10.1080/01621459.2022.2133718.
首先加載reticulate包，方便在Rmarkdown中使用Python。
library(reticulate) ## Warning: 程辑包&#39;reticulate&#39;是用R版本4.1.3 来建造的 use_python(&#39;E:/software/Program Files/python3.11.0&#39;) 一个小测试 构建一个数据集用来测试
import numpy as np n = 20 d = 100 np.random.seed(0) X = np.random.rand(n,d) + 0.5 X.shape ## (20, 100) from spo import spo_l1_path ws, lambdas, gaps, n_iters, n_active_features = spo_l1_path(X, func=0, n_lambdas=50, screen=True, max_iter=int(1e4), f=200, tol=1e-3) ## 0%| | 0/50 [00:00&amp;lt;?</description>
    </item>
    
  </channel>
</rss>
