Anthropogenic edge effects in habitat selection by sun bears in a protected area

Wildlife populations in southeast Asia are increasingly experiencing a broad array of anthropogenic threats, and mammalian carnivores are particularly vulnerable. Populations of the Malayan sun bear Helarctos malayanus are estimated to have declined by 30% over the last 30 years from forest conversion to industrial plantations and mortality associated with human–bear conflicts and illegal wildlife trade. However, the effects of industrial plantations on habitat selection and activity patterns of mammals that live at the protected area-plantation interface, including sun bears, are not well known. We investigated habitat selection and activity patterns of sun bears in Tabin Wildlife Reserve in Sabah, Malaysia. We deployed 83 remote camera sites to record sun bear detections during two sampling periods (2012–2013 and 2017). We used generalized linear models to examine relationships between sun bear presence and site covariates representing physical, environmental and anthropogenic elements of the landscape. Relative probability of sun bear presence was positively associated with distance to roads and elevation. Because most roads were on the reserve boundary and often associated with oil palm plantations, proximity to roads likely served as a surrogate measure of human accessibility and activity in peripheral areas of the reserve. Supporting that interpretation, sun bears close to the reserve boundary were primarily active at night, whereas daytime activity was more common for bears in the interior. Our findings indicate that sun bears alter behaviour and habitat selection likely in response to anthropogenic activities at the edges of Tabin Wildlife Reserve (112 200 ha). Because the ratio of edge to interior increases steeply with declining habitat area, smaller protected areas bordered by plantations are predicted to have greater impacts on sun bear behaviour and, potentially, population persistence. Effective conservation actions may benefit from management to improve the security of edge habitats for sun bears and other vulnerable species.

Originally conceived to preserve unique ecosystems and provide refuge for threatened species, protected areas across the globe are facing growing challenges in fulfilling their principal role (Watson et al. 2014). Increasing human population growth, settlement and agricultural development, especially near the periphery of protected areas (Wittemyer et al. 2008), has led to exponential increases in human-wildlife conflicts, including crop and livestock depredation (Hariohay et al. 2017, Wells et al. 2019, attacks on humans by wildlife (Packer et al. 2005, Ratnayeke et al. 2014) and intolerance of conflict-causing species (Treves 2009). Protected areas and threatened wildlife, in turn, experience an increasing array of direct and indirect threats, including illegal hunting and resource extraction (Vaidyanathan et al. 2010, Muposhi et al. 2016, Duporge et al. 2020, and the persecution of species that threaten human life or property (Nyhus 2016). These threats are most intense at the periphery of protected areas and are expected to increase in smaller reserves as the ratio of perimeter to protected area magnifies (Woodroffe andGinsberg 1998, DeFries et al. 2010).
Because species in smaller reserves tend to exist in smaller, isolated populations and experience more intense edge effects, large carnivores are especially vulnerable to both stochastic and deterministic effects of habitat alteration (Ratnayeke et al. 2018, Newbold et al. 2020. Human-inflicted mortality at habitat edges, rather than reserve size, is considered the single most important factor contributing to carnivore decline and extirpation (Woodroffe and Ginsberg 1998, Parks and Harcourt 2002, Balme et al. 2010, but more indirect forms of anthropogenic disturbance also contribute to edge effects. For example, hunting pressure that reduces prey densities near human settlements is considered a prime cause for low predator densities at the periphery of reserves (Johnson et al. 2006, Rosenblatt et al. 2016. A growing body of evidence points to alterations in wildlife behaviour in response to human disturbance at habitat edges, including shifts in activity patterns and reductions in movement and space use (Gaynor et al. 2018, Tucker et al. 2018. In southeast Asia, wildlife populations increasingly experience a broad array of anthropogenic threats, with largescale conversion of forest and direct exploitation as principal drivers (Sodhi et al. 2004, Hansen et al. 2013. Clearance of tropical rainforests for development and commercial agriculture has depleted forest cover by more than 50% of its original extent (Laurance 2007, Corlett 2014) and facilitated hunting pressure via increased road networks (Sodhi et al. 2004, Clements et al. 2014. Tropical systems are rich in biodiversity and endemism, but tropical species are sensitive to forest fragmentation and edge effects (Betts et al. 2019). The intensity of hunting to feed the demand for bushmeat and the illegal global trade in wildlife is tightly coupled with the loss of biodiversity (Lee et al. 2014) and particularly affects large-bodied, forest-dependent mammals like sun bears Helarctos malayanus whose paws and gall bladders have high market value in the global wildlife trade.
The Sunda region of southeast Asia is a unique hotspot of biodiversity, forming the southernmost range of the Malayan sun bear, including its only subspecies, H. m. euryspilus, which is endemic to Borneo. The range of sun bears is closely tied to tropical forest, including tropical evergreen rainforest in the Sundaland sub-region and the more seasonal forests of mainland Southeast Asia (Servheen 1999). In 2008, the conservation status of sun bears was reclassified from 'Data Deficient' to 'Vulnerable' (having a high risk of extinction in the wild) by the International Union for Conservation of Nature (IUCN: Scotson et al. 2017a). Sun bear populations are estimated to have declined by 30% over the last 30 years because of habitat loss and overexploitation associated with the illegal trade in bear parts (Shepherd and Shepherd 2010, Wong and Linkie 2013, Scotson et al. 2017a. Rates of forest loss in sun bear range suggest that by 2030, the decline in the global population size of sun bears in the wild would be enough to raise their threat status from 'Vulnerable' to 'Endangered' based on habitat loss alone (Scotson et al. 2017b). Although data on population size and trends are lacking, the range of the Bornean sun bear is now estimated to be reduced to almost half its historical extent (Crudge et al. 2019).
Conservation efforts for sun bears are impeded by the paucity of basic data regarding their ecology and requirements for survival. A sun bear conservation action plan released in 1999 cited a critical need for basic research on the distribution, population status and ecology of sun bears as one of the highest priorities in bear conservation (Servheen 1999). The first insights into sun bear ecology, such as homerange size, activity patterns and diet, have broadened our understanding of this species (Wong et al. 2004, Fredriksson and Wich 2006, Fredriksson 2012, but data remain limited, including information about responses to logging and agricultural operations, and to infrastructure such as roads and human settlements. Wilson and Wilson (1975) and Wilson and Johns (1982) suggested that sun bears were exclusively found in primary forest, but since then, evidence from several remote-camera and sign surveys confirm that secondary and logged forests also support the species (Scotson et al. 2017a, Crudge et al. 2019, including forest fragments along plantation borders (Guharajan et al. 2017). The most recent conservation action plan highlights the need for scientific information on various types of infrastructure that may affect forested habitats used by sun bears (Crudge et al. 2019).
The suitability of habitat and the level of protection afforded to threatened species within protected areas in southeast Asia has received little attention (Catullo et al. 2008). Changes in land use around protected areas may have multiple impacts on wildlife. Such impacts include habitat encroachment, barriers to dispersal, enhanced access for poachers, increased mortality from human-wildlife conflicts, and changes in wildlife behaviour and habitat use at reserve boundaries (Gaynor et al. 2018). In Malaysia, mammal diversity in oil palm plantations declines steeply with distance to adjacent natural forest (Yue et al. 2015), but sun bears are known to make nocturnal forays into oil palm plantations to forage (Normua et al. 2004, Cheah 2013. Moreover, shifts in sun bear activity to 'nocturnal crop-raiding' may allow access to nutritious foods and reduce the risk of encounters with humans (Fredriksson 2005, Sethy and Chauhan 2013, Guharajan et al. 2017. Although crop raiding by sun bears results in relatively small losses and damages, such incidents cause fear, hatred and retaliation against sun bears by villagers and plantation workers (Meijaard 1999, Servheen 1999, Fredriksson 2005, Guharajan et al. 2017. Bears that use the protected area-plantation interface may be prone to illegal snaring, particularly when a food source is present and where roads provide easy access for poachers. Boundary regions of reserves, therefore, may serve as 'attractive sinks' where high-energy food resources lure bears, but where the risk of mortality is high (Hansen 2011). An evaluation of sun bear habitat selection within and at the boundaries of protected areas can improve our understanding of how bears respond to these conflicting effects and can inform wildlife managers as to where in protected areas bears may be most vulnerable.
In this study, we used remote cameras, deployed along a gradient of distances from the reserve boundary to the more remote interior, to assess habitat selection and activity of sun bears at Tabin Wildlife Reserve, Sabah, which is situated in Malaysian Borneo. We measured sun bear presence or absence in relation to landscape covariates representing ecological resources or surrogates of human disturbance. We hypothesized that sun bears would be less likely to use areas closer to the plantation-reserve interface and associated with roads, and those that did, would exhibit more nocturnal activity patterns compared with bears in interior areas of the reserve.

Study area
Our study was conducted in lowland dipterocarp rainforest of Tabin Wildlife Reserve (5°12.51′N, 118°43.11′E). The reserve is located northeast of Lahad Datu town, Sabah, Malaysian Borneo and is surrounded by oil palm plantations. The reserve was gazetted in 1984 by the Sabah State Government for the conservation of the Sumatran rhinoceros Dicerorhinus sumatrensis and scientific research (Nor et al. 1989) and represents the largest contiguous forested area in Sabah (112 200 ha). Rainfall averaged 150-300 cm per year (Turner and Foster 2006). Temperatures ranged from a mean daily maximum of 32.0°C to a mean daily minimum of 22.0°C (Mitchell 1995, Turner andFoster 2006). Permits for research were obtained from the Sabah Biodiversity Council (JKM/MBS.1000-2/2 JLD.5 [114]).

Remote camera surveys
We used two independent data sets from remote camera surveys for our analysis. The first data set was derived from unpublished remote camera data collected during Sumatran rhino surveys at Tabin Wildlife Reserve from July 2012 through February 2013 (Kretzschmar et al. 2016). The second data set was derived from a remote camera survey conducted by the first author during April-October 2017. For both surveys, we only considered data from independent camera sites that were located at least 1 km apart based on published home-range sizes of female sun bears (1.2 km 2 ; Normua et al. 2004). Within the combined dataset of the two surveys, we applied the same criterion and removed two camera sites that were within < 1 km from a neighbouring site, resulting in a total of 83 independent camera sites.
The Sumatran rhino surveys were conducted in the central and northern part of Tabin Wildlife Reserve (Fig. 1). Camera sites were placed within 6-km 2 square grid cells based on a minimum home-range size of Sumatran rhinos at game trails, mud wallows or hill crest (10 km 2 ; Strien 1986, Kretzschmar et al. 2016. Two passive infrared remote cameras (Reconyx, PC 800 Hyperfire Professional IR, Reconyx Inc., Wisconsin, USA) were used at unbaited sites ( Fig. 1). Remote cameras were set to continuous (24-h) operation and were checked every two to three months. Data were obtained from 39 stations with a mean nearest distance between sites of 1.7 km and average deployment of 94 days/station. Cameras were set in motion-detect mode, five photos per trigger and no delay.
The second remote camera survey was conducted using passive infrared remote cameras (Moultrie M-999i and S-50i, EBSCO Industries, AL, USA). We established a total of 44 camera sites along forest trails, the reserve boundary, old logging roads and within the core area of the reserve. The mean nearest distance between camera sites was 1.4 km. We selected site locations to establish a gradient in relation to landscape features of interest, such as distance to roads and reserve boundary. At those sites, cameras were placed to optimize sun bear detection. We deployed cameras at each site for 28 consecutive days. We operated 13-18 camera sites at a time, visiting each at seven-day intervals to replace batteries, renew bait and check camera function. We placed one camera at each site by mounting it on a tree approximately 0.5 m above ground. We used a small amount of bait (shrimp paste and two pieces of salted fish placed in black shading net) to enhance detection. We used a metal casing to prevent camera damage from elephants Elephas maximus, bears and other species and secured each camera with a python lock to reduce vandalism or theft. Cameras were set in motiondetect mode, 10-megapixel resolution, three photos per trigger, 10 s of video with no delay and continuous operation.

Sun bear presence and landscape covariates
We used generalized linear models to identify landscape characteristics associated with sun bear occurrence. We verified sun bear presence from camera images and videos, bait removal and claw marks on tree trunks. We classified sites as sun bear absence if such evidence was lacking. We retained the full sampling period for all camera sites in the overall sample to maximize detection probabilities, thereby reducing the probability of incorrectly classifying a site where sun bears were present but not detected as an absence. We used this classification of sun bear presence or absence as the binary response variable and considered seven landscape covariates as potential predictors of sun bear occurrence: 1) elevation, 2) terrain ruggedness index, 3) distance to nearest road, 4) distance to nearest permanent river, 5) distance to nearest reserve boundary, 6) human density and 7) percentage natural forest cover. We used Quantum GIS (QGIS 2.18, Free Software Foundation, Inc, USA) to calculate covariate values for each remote camera station. We obtained elevation (m above sea level) of each camera station from the Shuttle Radar Topography Mission (SRTM; ~90-m horizontal resolution; <http://srtm.csi.cgiar.org>; Jarvis et al. 2008) and set all other spatial data to the same resolution. We used the elevation layer to derive a terrain ruggedness index (TRI), which measures the mean difference in elevation between a central pixel and its surrounding cells (Wilson et al. 2007). We calculated distance to nearest permanent river (m) and nearest reserve boundary (m) using information provided in Kitaura et al. (2003). To develop the spatial layer for distance to nearest road (m), we mapped the primary access road within Tabin Wildlife Reserve with a Global Positioning Unit (GPS) unit (Garmin GPSmap 62s) and used imagery available in Google Earth Pro (ver. 7.3.2.5491) to digitize roads associated with oil palm plantations near the boundary of the reserve (Fig. 1). We derived human density from the LandScan 2007 global population data set (ambient population measured over a 24-h period, approximate resolution of 1 km). We calculated percentage natural forest cover within a 1-km radius based on tree cover data from Hansen et al. (2013). The original tree cover raster layer derived from Hansen et al. (2013) included any vegetation ≥ 5 m and did not distinguish between natural forests and plantations. Because tree cover outside the reserve boundary consisted entirely of oil palm, we masked out tree cover outside the reserve and assigned those pixels a value of zero (i.e. no natural forest cover). We standardized all covariates using the scale function in the R computing environment (ver. 3.4.3, <www.r-project.org>) to allow comparison of their relative importance (Lane and Nelder 1982). We checked collinearity among all predictor variables using R package 'faraway' based on the variance inflation factor (VIF; Faraway 2016). We retained only one of two spatial predictors that were highly correlated in the predictive model, using a threshold value of VIF > 10 ( Dormann et al. 2013). We calculated Pearson correlation coefficients among the remaining variables to verify that all pairwise coefficients were below 0.7 (Dormann et al. 2013).
We used the glm function in R to build a set of predictive models using the generalized linear model with a logit link function and treating sun bear presence or absence as the dependent variable. Camera data were from surveys that were conducted during two separate periods (i.e. 2012-2013 versus 2017 survey). Because of slightly different methodologies and some variation in weather patterns between the survey periods, it was important to test and account for potential survey effects. Because there were only two survey periods, we did not use a mixed-effect model structure that treated survey as a random effect. Instead, we tested for evidence of a survey effect on the dependent variable and fitted interaction terms with the survey covariate to explicitly test whether relationships of habitat covariates with sun bear presence were different between the two surveys. To construct the model set, we first examined the means and standard error of each spatial covariate for sites with documented presence versus absence of sun bears (Anderson and Burnham 2002;Supporting information). In accordance with our sample size of camera sites and allowing for interactions to test for a survey effect, we added up to three habitat covariates in a model. Specifically, we created 13 models to investigate relative contributions of physical (elevation, terrain ruggedness), natural (forest cover, distance to nearest river) and anthropogenic (distance to nearest road, distance to nearest reserve boundary, human density) elements of the environment and models in which we combined two or three of these elements. To investigate whether there were effects due to survey period, we created a binary categorical variable for survey period (2017 survey = 1, 2012-2013 survey = 0) and added it as an interaction effect for the different combinations of habitat covariates. Including a null model (intercept only), this resulted in a total of 45 models, which we ranked using AIC corrected for small sample sizes (AIC c ; Burnham and Anderson 1998). We considered models with ∆AIC c ≤ 2.0 to be parsimonious and selected those for inference. Because spatial autocorrelation among observations could violate the assumption of independence, we calculated Moran's I statistic (Moran 1950) using the residuals of the fitted models. Moran's I is an index of spatial dependence with values ranging from −1 to 1 indicating maximum negative and positive autocorrelation, respectively, and values near 0 indicating random patterns. We calculated the global Moran's I statistic in ArcGIS (ESRI, Redlands, CA, USA; ver. 10.6) using inverse distance weighting and standardization based on all weight values and tested whether it was different from 0 based on z-scores. We used package 'ResourceSelection' (Lele et al. 2017) to calculate the Hosmer-Lemeshow goodness-of-fit statistic to determine fit of these top models. We evaluated predictive accuracy of the models with ∆AIC c ≤ 2.0, by conducting 10-fold cross validation using the package 'caret' (Verbyla andLitvaitis 1989, Kuhn 2018). We divided the dataset into 10 random subsamples, with nine serving as training data, to which we fitted the model, and one subsample for testing the model. We repeated this analysis 10 times and summarized model performance using a confusion matrix to assess overall model accuracy, sensitivity (proportion of sites correctly predicted as sun bear presence) and specificity (proportion of sites correctly predicted as sun bear absence).

Spatial prediction of relative sun bears presence
We mapped model predictions by applying the logistic regression equations to each 90-m pixel within Tabin Wildlife Reserve. Given that all camera sites were within the reserve, we limited our spatial inference to pixels contained within the reserve boundary. Because true absences can rarely be assumed, the predicted probabilities represent a relative ranking of sun bear habitat selection (Hegel et al. 2010). We used Spatial Analyst tools in ArcGIS to predict relative probabilities separately for each of the models with ∆AIC c ≤ 2.0. For models that included the survey covariate, we averaged predicted values for the two equations representing each of the two survey periods. We then multiplied each model layer with their respective AIC c weights and summed these layers to create a final predictive map depicting the modelaveraged relative probability of sun bear presence. We used the R software package 'effects' (Fox 2003) to plot relationships between physical, environmental and anthropogenic covariates and predicted relative probability of presence of sun bears based on logistic regression models.

Activity patterns
We assessed sun bear activity patterns using the time stamps from camera images and videos. We classified camera sites according to their proximity to active roads, most of which marked the boundary of the study area. We classified sites > 1.5 km of an active road as a core area site and those ≤ 1.5 km of active roads as boundary sites. The 1.5-km threshold was based on daily movement distances of sun bears documented elsewhere in Sabah (1.45 km; Wong et al. 2004). Additionally, 1.5 km was the permitted distance for jungle trekking and birdwatching for tourists and thus also reflects areas of greater human access inside the reserve. We considered detections of sun bears at the same remote camera site separated by > 60 min as independent observations. We used the R software package 'overlap' to plot activity patterns by fitting kernel density functions to times recorded on remote camera photos (Meredith and Ridout 2017).

Sun bear presence and landscape covariates
We obtained 164 independent detections of sun bears during 4892 nights. Sun bears were detected at more than half of the 83 combined sites (56.6%; Table 1, Fig. 1). Using a univariate logistic regression, we did not detect a survey effect on the probability of sun bear presence (β = −0.0784, SE = 0.454, p = 0.084). Distance to reserve boundary was strongly correlated with distance to nearest road (VIF > 10). Based on field observations, distance to roads better captured anthropogenic disturbance at Tabin Wildlife Reserve so we retained it as a covariate. Pearson correlation coefficients among the six remaining covariates were < 0.7 and were retained for analysis. Seven of the 45 logistic regression models had values of ∆AIC c ≤ 2 and we used those for inference (Supporting information). Covariates in the top models were elevation, distance to nearest road and percent natural forest cover (Table 2). We found no evidence of spatial autocorrelation among the residuals of these models (Moran's I: range = −0.13 to −0.05, z = −1.36 to −0.47, p = 0.171-0.636). These seven top models showed no evidence of lack of fit to the data (Hosmer-Lemeshow test: χ 2 = 12.35-3.85, df = 8, p = 0.136-0.871). Distance to nearest road and elevation were the most important habitat covariates, with the relative probability of sun bear presence increasing with greater distances to roads and higher elevations (Table 2, Supporting information). Natural forest cover showed a weak negative relationship with sun bear presence (Table 2, Supporting information). There was evidence of a survey interaction with distance to nearest road, present in three of the seven top models, indicating that the higher probability of sun bear presence away from roads was less evident among the 2017 survey sites (Table 2, Supporting information).
A threshold value of 0.50 for the predicted relative probability maximized sensitivity and specificity. Therefore, we summarized the performance of the 10-fold cross-validation for the confusion matrix by classifying predicted relative probabilities ≥ 0.50 as presences and values < 0.50 as absences. Overall accuracy of the models was moderate (Table 3). Sensitivity was acceptable for the top models, with the highest value (0.745) for the model with covariates elevation and distance to nearest road. Specificity was poor to moderate for all models. Spatial predictions of the relative probability of sun bear presence showed the overall influence of distance to road and elevation (Fig. 2). Regions with the highest predicted relative probability (0.87) of presence were primarily in core areas of the reserve, with lowest probabilities (0.29) near reserve boundaries.

Activity patterns
The 164 independent events of sun bear detections were primarily from the core area with fewer in the boundary area: there were 138 detections at 35 (69%) of the 51 core area sites and 26 detections at 14 (44%) of the 32 boundary sites. Detections of sun bears at core area sites (2.71/ site) were 3.3 times greater than at boundary sites (0.81/ site). Sun bears in the core area showed a peak in activity around 7:00 a.m., followed by another peak at 4:00 p.m. (Fig. 3a). In the boundary area, sun bear detections were different from the pattern in the core area, with peak activity during twilight hours (5:00 a.m. and 6:00 p.m.) and greater activity at night (n = 20) than during the daytime (n = 6; Fig. 3b).

Discussion
Our findings indicate that elevation and proximity to roads are important correlates of sun bear occurrence with relative probability of sun bear presence greater away from roads and at higher elevations, and in areas with lower percent natural forest cover. When oil palm plantations were established adjacent to the reserve, access roads were typically constructed directly along the reserve boundary. This explains the high correlation of the covariate distance to road with distance to reserve boundary. These boundary roads provide easy access into peripheral areas of the reserve, and our covariate likely served as a surrogate measure of that accessibility. Whereas overall the probability of sun bear presence increased with distance to roads, the interaction term with survey indicated there are additional considerations when interpreting this relationship: the negative coefficient for the interaction term indicated the effect of distance to roads was less evident based on the 2017 survey data. The Sumatran rhino survey sites were distributed across a larger geographic and more interior area of the reserve, whereas a portion of the 2017 sites were accessed from the primary road into the reserve, which was used only by authorized parties, and from the western and southern reserve boundaries (Fig. 1). The interaction effect likely reflects this difference in sample distribution, with some observed presences in areas near roads. Elevational relief in the study area was limited, with the highest peak in the centre of the reserve reaching 571 m (Hutton and Prudente 2008), decreasing to 20-100 m towards the reserve boundary. Although elevation was not Table 2. Coefficients and standard errors of the best-fitting (∆AIC c ≤ 2) logistic regression models to predict relative probability of sun bear presence in Tabin Wildlife Reserve, Sabah, Malaysia, 2012. Covariate data were standardized following Lane and Nelder (1982).  highly correlated with our coarse-scale measures of human accessibility, such as distance to roads and reserve boundary, it is generally correlated with terrain ruggedness. However, the covariate for ruggedness showed no association with the presence of sun bears at the sample sites. Therefore, we speculate that elevation may instead have acted as a fine-scale, surrogate measure of factors that were not captured by other covariates. For example, floristic communities are relatively uniform in Tabin Wildlife Reserve but even small elevation gradients can reflect distinct differences in vegetation composition or physiognomic structure that bears may respond to for security cover or food resources. We also observed a slightly greater probability of sun bear presence in areas with lower natural forest cover, as measured within a 1-km radius. This may have been a function of sun bears on the periphery of the reserve moving into oil palm plantations at night. Indeed, some sun bear presences were associated with remote camera sites near the boundary of the reserve and these sites had lower natural forest cover measurements because the 1 km buffer surrounding the camera site included oil palm plantations. Detection rates of sun bears in our study were relatively high (30 trap nights/detection) compared with other studies. For example, although sun bears were not the target species, Guharajan et al. (2018) reported 192.5 trap nights/detection for a study area (< 2000 ha) within the Lower Kinabatangan Wildlife Sanctuary in Sabah. We considered whether the higher detection may have been a function of our sampling design, with baited sites representing 53% of the remote camera sites. However, sun bear photos obtained from the Sumatran rhinoceros surveys involved unbaited sites and had a detection rate (29 trap nights/detection), which was similar to the baited sites (32 trap nights/detection; Table 1). Hence, we speculate that the higher detection rate may be a function of Tabin Wildlife Reserve having a higher density of sun bears than the more fragmented forests in landscapes dominated by oil palm plantations.
The timing of detections show that sun bears in peripheral areas of the reserve were more active during twilight hours and at night compared with bears in core areas of the reserve, which was likely a response to human activity. Supporting this interpretation, a telemetry study by Normua et al. (2004) of four sun bears captured in the western portion of Tabin Wildlife Reserve indicated they only ventured into adjacent oil palm plantations at night and returned to the forest during daylight hours. Combined with findings from spatial analyses, these results suggest that sun bear activity patterns near the reserve boundary were likely influenced by anthropogenic activities associated with nearby plantations. In contrast, sun bears in the interior of the reserve, where there was no road access, and thus limited human access, were more diurnal. Sites at the boundary, or within 1.5 km of an active road, were also less likely to be visited by sun bears, which suggests fewer bears in peripheral areas. These Predictions from seven logistic regression models were multiplied by their respective AIC c weights and summed to obtain model-averaged probabilities. Model covariates included distance to nearest road, elevation, human density, percent natural forest cover and survey. For models that included the survey covariate, we averaged predicted values for the two equations representing each of the two survey periods. findings are reflected in other studies where sun bears that use oil palm plantations, or forests where human activity was high, adjusted to more nocturnal patterns of activity (Griffiths and Schaik 1993, Fredriksson 2005, Cheah 2013, Yue et al. 2015, Guharajan et al. 2018. Collectively, our findings are broadly consistent with other sun bear studies indicating spatial and temporal responses to anthropogenic activities that reduce habitat suitability for sun bears (Wong et al. 2004, Nazeri et al. 2012, Wong and Linkie 2013, Guharajan et al. 2018. In fact, Guharajan et al. (2018) considered that sun bear avoidance of human activities took precedence over food availability at the Lower Kinabatangan Wildlife Sanctuary based on observations of fewer sun bear signs in corridor areas with greater human disturbance, although food was abundant.
Studies of other species of bear have shown that roads influence their distribution and habitat selection. For example, sloth bears Melursus ursinus in Sri Lanka do not occur in areas with high road densities (Ratnayeke et al. 2007), and brown bears Ursus arctos have been documented to avoid heavily trafficked roads and human settlements (Mace et al. 1996, Skuban et al. 2017. Although bears are known to modify behaviour to accommodate some level of human activity (Akhtar et al. 2007), increased road access can lead to a greater risk of poaching (Haines et al. 2012) and human-wildlife conflicts (Sharma et al. 2020), which can result in negative demographic consequences for bear populations. For protected areas like Tabin Wildlife Reserve, where access is largely uncontrolled and concerted anti-poaching operations are lacking, poaching of wildlife and illegal harvest of trees (e.g. agarwood [Aquilaria spp.]) can be highly profitable, with little risk of detection or arrest. Our remote cameras photographed four armed poachers on three occasions (Supporting information) inside the reserve, within 1 km from the nearest plantation road. Additionally, the presence of oil palm plantations and road access adjacent to the reserve increases the likelihood of human-bear conflicts. Sun bears near the periphery of the reserve may be attracted to oil palm fruit and other anthropogenic food sources, and during acute food shortages, this attraction may extend to bears occupying the reserve interior. When bears involved in crop raiding are killed, population persistence, particularly in fragmented habitats, may be affected. Such demographic impacts are difficult to estimate, but studies on other bear species have demonstrated clear associations between bear survival and level of road accessibility (e.g. brown bears; Schwartz et al. 2010). Thus, impacts of these roads on sun bears and other wildlife species may be two-fold: 1) contributing to wildlife avoidance of areas in closer proximity to roads due to associated human activities and 2) potential direct demographic consequences as poaching activities reduce survival and population density (Langner et al. 2007, Clements et al. 2014.
There are several caveats to our study findings. First, although data collection protocols for the two surveys were very similar, there were some differences in duration of camera deployment and use of a small bait in the second survey. However, major biases in documenting our primary measure, presence versus absence of sun bears at the sample sites, was unlikely. Indeed, there was little evidence of a survey effect with regard to the dependent variable. Additionally, we accounted for any survey effects on habitat covariates by including interaction terms in our model set. We observed an interaction effect with survey for the distance to road covariate, and its inclusion enhanced our inference. Second, we obtained only 164 independent detections to assess bear activity and 46 sites with bear presence. Thus, our inferences may be limited by sample size. For this reason, we limited the number of covariates in any one model. Finally, we recognize our ability to extrapolate predictions across space is limited. Other than roads, which we digitized, we were unable to accurately measure human accessibility or use of areas beyond the reserve boundaries. Also, because the eastern portion of the reserve could not be sampled, extrapolation to these areas should be interpreted with caution.

Conclusions and future research directions
Malaysia is the world's second biggest oil palm producer (Kushairi Din 2017) and Sabah, a Malaysian state in the northern portion of Borneo, is one of the global hotspots for tropical deforestation (Bryan et al. 2013). Across 7.4 million ha of Sabah's landmass, 1.5 million ha consist of oil palm plantations, constituting 27% of Malaysia's total oil palm production area (Kushairi Din 2017). Forest conversion in Sabah has been accompanied by the expansion of road networks to support transportation of products. For protected areas like Tabin Wildlife Reserve that are already bordered by many plantations, effective conservation action may need the participation of stakeholders, researchers and wildlife managers to devise and test approaches to improve the security of the plantation-reserve interface for bears. Studies are needed to assess any changes in hunting or poaching mortalities and behavioural responses of sun bears resulting from interventions to enhance habitat security (Crudge et al. 2019). Establishment of a systematic anti-poaching program and community outreach to reduce human-bear conflicts may be a first step. This will require coordination and establishment of a formal partnership among Tabin-based non-governmental organizations, local ecotourism resorts, plantation stakeholders and local communities.
Protected areas in southeast Asia may eventually be the only refuges for many species, yet they remain vulnerable to both lethal and nonlethal forms of human disturbance. Species that are capable of altering behaviour and resource use to avoid contact and conflict with humans may have greater potential for persistence, but the potential for these shifts in behaviour to affect individual energy budgets, fitness or even population demographics cannot be ignored (Gaynor et al. 2018). Also crucial for protected areas is the need for enhanced protection from indiscriminate poaching via snares, to which populations of larger-bodied mammals at low densities are particularly vulnerable (Tilker et al. 2019).