r - 迭代比例拟合 (IPF) / 使用 R 倾斜
问题描述
我无法弄清楚如何使用 R 进行 IPF。
这是初始数据,“gmb_f”
F_00_04 F_05_09 F_10_14 F_15_19 F_20_24
1675 1544 1353 1610 1760
20450 19317 14790 13700 11519
52912 50398 40256 41174 37095
10491 10595 7882 7827 5792
24672 23170 20285 23088 23464
18693 18211 13701 13187 10251
8701 8860 6230 5653 4446
6508 6637 5214 5030 3537
有行约束:
(16745, 142475, 420113, 75519, 228322, 133604, 59169, 48856)
和列约束:
(200234, 169556, 144002, 121571, 101597)
我的代码是这样的:
library(ipfr)
gmb_f <- as.matrix(readxl::read_xlsx("gmb_f.xlsx", 1))
gmb_f_rowcon <- c(16745, 142475, 420113, 75519, 228322, 133604, 59169, 48856)
gmb_f_colcon <- c(200234, 169556, 144002, 121571, 101597)
m <- list(gmb_f_rowcon, gmb_f_colcon)**
ipu(gmb_f_seed, m)
我得到这个错误:
Error in targets[[name]] :
attempt to select less than one element in get1index
我究竟做错了什么?我怎样才能解决这个问题?
解决方案
推荐阅读
- yii - 避免php 2d数组中的字符串元素
- c# - ASP.NET Core 中是否有 BuildManager.GetReferencedAssemblies() 的替代方法?
- gulp - Gulp: .on('change') 和没有有什么区别吗?
- dask - dask分布式,无法启动worker
- chef-infra - 厨师根据 bash 命令输出返回食谱
- algorithm - 给定一个以区间为边成本的图,检查 MST 有效性
- go - win.RegisterRawInputDevices 总是返回 false
- javascript - 未捕获的语法错误:未定义文档
- c - 从非阻塞套接字接收部分数据
- python - 使用 python/Selenium 单击 Javascript 按钮时出现问题