全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1200 7
2019-06-27
library(sensitivity)



#####------------------------- Plot Morris test results -------------------------#####

output_names  <- c("opt-out","imitation","optimization","repetition") # Corresponding to c(1,2,3,4)


####---------- VII. Analysis of test results (postprocessing)  ----------####

paraNames <- c("ref_income", "tol_income", "tol_activity", "lambda",
               "alpha_plus", "alpha_minus","phi_plus", "phi_minus")

### plots for mu* against mu/sigma
for (i in (1:length(sim_results_morris_org[,1])))
{
  # add simulation results (as vector) to morris object
  tell(mo, sim_results_morris_org[i,])
  mu <- apply(mo$ee, 2, mean)
  mu_star <- apply(mo$ee, 2, function(x) mean(abs(x)))
  sigma <- apply(mo$ee, 2, sd)

  ## mu_star against mu
  # ask user for pressing <Enter> for entering the plot
  plot(mu_star, mu)
  title(main=output_names)
  text(mu_star, mu, labels=paraNames, cex= 0.8, pos=3)

  # mu_star against sigma
  plot(mu_star, sigma)
  title(main=output_names)
  text(mu_star, sigma, labels=paraNames, cex= 0.8, pos=3)
  # mu against sigma
  plot(mu, sigma)
  title(main=output_names)
  text(mu, sigma, labels=paraNames, cex= 0.8, pos=3)
}


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2019-6-27 09:50:48
plot前面加一个op=par(mfrow=c(2,2))
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-6-27 10:29:35
zhou1_20 发表于 2019-6-27 09:50
plot前面加一个op=par(mfrow=c(2,2))
library(sensitivity)



#####------------------------- Plot Morris test results -------------------------#####

output_names  <- c("opt-out","imitation","optimization","repetition") # Corresponding to c(1,2,3,4)


####---------- VII. Analysis of test results (postprocessing)  ----------####

paraNames <- c("ref_income", "tol_income", "tol_activity", "lambda",
               "alpha_plus", "alpha_minus","phi_plus", "phi_minus")

### plots for mu* against mu/sigma
for (i in (1:length(sim_results_morris_org[,1])))
{
  # add simulation results (as vector) to morris object
  tell(mo, sim_results_morris_org[i,])
  mu <- apply(mo$ee, 2, mean)
  mu_star <- apply(mo$ee, 2, function(x) mean(abs(x)))
  sigma <- apply(mo$ee, 2, sd)
  
  ## mu_star against mu
  # ask user for pressing <Enter> for entering the plot
  op=par(mfrow=c(2,2))
  plot(mu_star, mu)
  title(main=output_names)
  text(mu_star, mu, labels=paraNames, cex= 0.8, pos=3)
  
  # mu_star against sigma
  op=par(mfrow=c(2,2))
  plot(mu_star, sigma)
  title(main=output_names)
  text(mu_star, sigma, labels=paraNames, cex= 0.8, pos=3)
  # mu against sigma
  op=par(mfrow=c(2,2))
  plot(mu, sigma)
  title(main=output_names)
  text(mu, sigma, labels=paraNames, cex= 0.8, pos=3)

是这样吗,怎么显示不出来图形结果呀
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-6-27 10:29:44
zhou1_20 发表于 2019-6-27 09:50
plot前面加一个op=par(mfrow=c(2,2))
library(sensitivity)



#####------------------------- Plot Morris test results -------------------------#####

output_names  <- c("opt-out","imitation","optimization","repetition") # Corresponding to c(1,2,3,4)


####---------- VII. Analysis of test results (postprocessing)  ----------####

paraNames <- c("ref_income", "tol_income", "tol_activity", "lambda",
               "alpha_plus", "alpha_minus","phi_plus", "phi_minus")

### plots for mu* against mu/sigma
for (i in (1:length(sim_results_morris_org[,1])))
{
  # add simulation results (as vector) to morris object
  tell(mo, sim_results_morris_org[i,])
  mu <- apply(mo$ee, 2, mean)
  mu_star <- apply(mo$ee, 2, function(x) mean(abs(x)))
  sigma <- apply(mo$ee, 2, sd)
  
  ## mu_star against mu
  # ask user for pressing <Enter> for entering the plot
  op=par(mfrow=c(2,2))
  plot(mu_star, mu)
  title(main=output_names)
  text(mu_star, mu, labels=paraNames, cex= 0.8, pos=3)
  
  # mu_star against sigma
  op=par(mfrow=c(2,2))
  plot(mu_star, sigma)
  title(main=output_names)
  text(mu_star, sigma, labels=paraNames, cex= 0.8, pos=3)
  # mu against sigma
  op=par(mfrow=c(2,2))
  plot(mu, sigma)
  title(main=output_names)
  text(mu, sigma, labels=paraNames, cex= 0.8, pos=3)

是这样吗,怎么显示不出来图形结果呀
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-6-27 12:04:10
加到for前面看下op=par(mfrow=c(2,2))
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-6-27 12:28:53
HHLDPPH 发表于 2019-6-27 10:29
library(sensitivity)
显示出来的不是2*2的形式
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

分享

扫码加好友,拉您进群