useDynLib(mgwrsar, .registration = TRUE)
import(sp)
import(leaflet)
#import(Rcpp)
import(doParallel)
import(foreach)
import(htmltools)
import(mapview)
import(knitr)
import(microbenchmark)
importFrom("stats", "coef", "filter","lm","AIC", "family", "gaussian", "glm", "rnorm")
importFrom("caret", "createFolds")
importFrom("utils", "tail")
importFrom("Matrix","Matrix","Diagonal","sparseMatrix","drop0","nnzero")
importFrom("nabor","knn")
importFrom("spgwr","gwr")
importFrom("methods", "as","is")
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")
##wrapper
export("MGWRSAR")
export("multiscale_gwr")
export("simu_multiscale")
#export("tds_mgwr")
#export("assign_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("bandwidths_mgwrsar")
#export("fb")
#####export("SSR")
#export("cv_h")
#####export("bandwidth_search")
#####export("bandwidth_searchW")
#export("fill_DGPTAB")
#export("model_conf")
#export("init_DGPTAB")
#####export("bandwidths_gwr_GPK")
#####export("golden_search_variable_bandwidth")
#export("golden_search_bandwidth")

## target points
export("find_TP")
#export("tp")
#export("quadtree")
#export("quadTP")
#export("cell")
#export("insidecell")
#export("equidistantGrid")
importFrom("stats", "residuals")



