useDynLib(mgwrsar, .registration = TRUE)
import(sp)
import(leaflet)
#import(Rcpp)
import(doParallel)
import(foreach)
import(htmltools)
import(mapview)
import(knitr)
import(microbenchmark)
importFrom("stats","filter","lm","AIC", "family", "gaussian", "glm", "rnorm")
importFrom("caret", "createFolds")
importFrom("stringr", "str_split")
importFrom("SMUT", "eigenMapMatMult")
importFrom("utils", "tail")
importFrom("Matrix","Matrix","Diagonal","sparseMatrix","drop0","nnzero")
importFrom("nabor","knn")
importFrom("methods", "as","is","new")
importFrom("sf", "st_as_sf","st_set_crs","st_coordinates",'st_transform')
importFrom("rlang", "call_modify")
importFrom("mboost", "boost_control","glmboost","Gaussian","Binomial")
importFrom("mgcv", "gam")
importFrom("gridExtra","grid.arrange")
importFrom("dplyr","arrange","desc")
importFrom("grid","textGrob","gpar")
importFrom("ggplot2","ggplot_build","xlim")
importFrom(Rcpp, evalCpp)
importFrom("stats", "D", "as.formula", "coefficients", "contrasts","cooks.distance", "dist", "lm", "lm.fit", "median","model.extract", "model.frame", "model.matrix", "optimize","pf", "predict", "printCoefmat", "quantile", "sd","setNames", "terms", "update", "fitted", "runif", "vcov","na.omit", "reorder")
importFrom("stats", "rchisq")
importFrom("utils", "head")
##wrapper
exportClasses("mgwrsar")
exportMethods("summary")
exportMethods("residuals")
exportMethods("coef")
exportMethods("predict")
export("MGWRSAR")
export("multiscale_gwr")
#export("multiscale_gwr2")
export("tds_mgwr")
#export("atds_gwr")
#export("cv.tds_mgwr")
export("simu_multiscale")
#export("tds_mgwr")
#export("assign_control")
#export("reassign_control")
#export("prep_var")
#export("prep_w")
#export("prep_d")
######export("residuals_beta")
## method
#export("summary_mgwrsar")
#export("predict_mgwrsar")
#export("predict_outsample_sargwr")
#export("plot_mgwrsar")
export("plot_effect")
#export("show_pattern")
## estimation functions
#export("gwr_beta")
#export("GWR")
#export("MGWR")
#export("mod")
#export("PhWY_R")
######export("set0_conditionXD")
export("Sl_C")
export("PhWY_C")
export("int_prems")
export("INST_C")
export("Proj_C")
export("QRcpp2_C")
## prediction
#export("BP_pred_MGWRSAR")
#export("BP_pred_SAR")
#export("Beta_extropolation")
## evaluation
#export("me_gwrsar")
#export("bias_gwrsar")
#export("aic_model")
#export("indice_aggreg")
### bootstrap_test
#export("Sidak_cor_MGWR")
#export("Tf")
export("mgwrsar_bootstrap_test")
export("mgwrsar_bootstrap_test_all")
## kernels
#export("bisq")
#export("gauss")
#export("epane")
#export("rectangle")
#export("triangle")
#export("bisq_adapt_sorted")
#export("gauss_adapt_sorted")
#export("epane_adapt_sorted")
#export("rectangle_adapt_sorted")
#export("triangle_adapt_sorted")
## matrix
#export("ApproxiW")
#export("ApproxiWv")
export("normW")
export("summary_Matrix")
export("kernel_matW")
#export("row_prod")

## bandwidth search
export("golden_search_bandwidth")
#export("fb")
#####export("SSR")
#export("fill_DGPTAB")
#export("model_conf")
#export("init_DGPTAB")

## target points
export("find_TP")
#export("tp")
#export("quadtree")
#export("quadTP")
#export("cell")
#export("insidecell")
#export("equidistantGrid")
importFrom("stats", "residuals")
importFrom("methods", "slot")
importFrom("stats", "lm.influence")
importFrom("utils", "data")


