systemfit,以做出样本预测

时间:2018-10-15 20:36:30

标签: r systemfit

这取自systemfit的{​​{1}} documentation。经过一些修改后,一个方程式取决于另一个方程式的输出。

predict

返回

data( "Kmenta" )
eqDemand <- consump ~ price + income
eqSupply <- price ~ consump + farmPrice + trend

## want to OOS prediction for 20th observation...
Kmenta$consump[[20]] = NA
Kmenta$price[[20]] = NA


system <- list( demand = eqDemand, supply = eqSupply )


## OLS estimation
fitols <- systemfit( system, data=Kmenta[1:19, ])

predict(fitols,newdata=Kmenta[20, ])

我有两个问题:为什么它不返回[1] demand.pred supply.pred <0 rows> (or 0-length row.names) demand的谓词?如何修改,以便supply对两个未知值进行预测?

0 个答案:

没有答案