# NOT RUN {
{
# }
# NOT RUN {
# Run may take a while...
# Create data frame:
t1=Sys.time()
p1=c(1,2);p2=c(3,5);p3=c(7,3)
dp=rbind(p1,p2,p3);dp
set.seed(916070)
pts=t(sapply(1:20, function(i,dp){
cc=runif(3)
cc=cc/sum(cc)
colSums(dp*cc)
},dp))
df=data.frame(pts)
colnames(df)=c("x","y")
# Run:
yy=find_optimal_kappas(df,maxkappas = 10)
# Results:
names(yy)
# Best fit SSE:
yy$bestfit_sse
# Optimal kappas from UIK method:
yy$optimal_kappas
#
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataLab