{'fraction_non_alphanumeric': 0.041693861097247285, 'fraction_numerical': 0.029331592889776173, 'mean_word_length': 4.272773279352227, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
THEY MIGHT BE GIANTS: LUMINOSITY CLASS, PLANET OCCURRENCE, AND PLANET–METALLICITY RELATION OF THE COOLEST KEPLER TARGET STARS

We estimate the stellar parameters of late K- and early M-type Kepler target stars. We obtain medium-resolution visible spectra of 382 stars with KP − J > 2 (≃K5 and later spectral type). We determine luminosity class by comparing the strength of gravity-sensitive indices (CaH, K i, Ca ii, and Na i) to their strength in a sample of stars of known luminosity class. We find that giants constitute 96% ± 1% of the bright (KP < 14) Kepler target stars, and 7% ± 3% of dim (KP > 14) stars, significantly higher than fractions based on the stellar parameters quoted in the Kepler Input Catalog (KIC). The KIC effective temperatures are systematically (110+15 − 35 K) higher than temperatures we determine from fitting our spectra to PHOENIX stellar models. Through Monte Carlo simulations of the Kepler exoplanet candidate population, we find a planet occurrence of 0.36 ± 0.08 when giant stars are properly removed, somewhat higher than when a KIC log g > 4 criterion is used (0.27 ± 0.05). Last, we show that there is no significant difference in g − r color (a probe of metallicity) between late-type Kepler stars with transiting Earth-to-Neptune-size exoplanet candidates and dwarf stars with no detected transits. We show that a previous claimed offset between these two populations is most likely an artifact of including a large number of misidentified giants.


INTRODUCTION
The NASA Kepler mission (Borucki et al. 2010) has ushered exoplanet science into a new phase of analysis based on the statistics of large samples. Among the more elementary statistics are the frequency of planets around stars, the distribution of planet size (or mass), and any correlation between the presence of planets and the properties of the host stars. These are important, if sometimes ambiguous, constraints on models of planet formation and evolution. These properties are best established for solar-type stars (late F through early K spectral types) because many nearby representatives are bright enough for ground-based Doppler radial velocity observations, and because they constitute the vast majority of Kepler targets. More than 15% of dwarf stars have close-in (∼0.25 AU) planets with orbital periods less than 50 days (Howard et al. , 2011 and this fraction increases with orbital period (Mayor et al. 2011). The same authors find that planet frequency is inversely related to planet mass or radius, with "super-Earths" outnumbering Jupiter-size planets amann@ifa.hawaii.edu by more than an order of magnitude. Around solar-type stars, the presence of giant planets is strongly correlated with super-solar metallicity (Gonzalez 1997;Santos et al. 2004;Fischer & Valenti 2005;Johnson et al. 2010), but this correlation does not appear to hold for smaller planets (Sousa et al. 2008;Bouchy et al. 2009;Mayor et al. 2011) Very cool (late K and early M type) dwarf stars have become popular targets of planet searches (Charbonneau et al. 2009;Vogt et al. 2010;Bean et al. 2010;Apps et al. 2010;Fischer et al. 2012). Planets around cool stars are easier to detect because of the stars' smaller masses and radii. Furthermore, because these stars are less luminous, close-in and thus detectable planets can still orbit within the "habitable zone," where an Earth-like planet would avoid the "snowball" or runaway greenhouse climate states (Gaidos et al. 2007). However, the statistics of planets around these stars are more poorly established. These stars are underrepresented in magnitude-limited Doppler surveys as well as the Kepler target list. Only 2% of Kepler target stars are classified as possible M types (cooler than 4000 K), whereas >70% of all stars within 20 pc are M dwarfs (Chabrier 2003). Nevertheless, Howard et al. (2011) find that the frequency of candidate planets around Kepler stars rises with decreasing effective temperature through at least early K-type (≃5000 K). Schlaufman & Laughlin (2011) used colors from Kepler Input Catalog (KIC) photometry as proxies for metallicity and claimed that late-type (i.e., J − H ≈ 0.62) stars hosting candidate transiting planets have significantly redder g − r colors -and hence are more metal-rich -than stars for which transits have not been detected. Because very few of these candidates should host giant planets (Johnson et al. 2010), this result contradicts previous findings (see above).
Reliable stellar parameters are a prerequisite for robust statistical analysis of planets, especially transiting planets. These are needed not only for stars for which planet candidates have been detected (referred to as Kepler Objects of Interest or KOIs), but also for the target sample as a whole. For example, the radius of a planet producing a given transit depth is proportional to the radius of its host star. Likewise, the transit signal produced by a planet of a given radius -and hence its detectability around a star in the survey -also depends on stellar radius. If some target stars are actually larger (or even giant stars), then planets are less likely to be detected in that sample, which means that the most likely occurrence rate of those planets is higher. For M dwarf stars in general, and particularly for the coolest Kepler target stars, parameters such as radius are uncertain or even very unreliable (e.g. Johnson et al. 2011;Muirhead et al. 2011).
Kepler targets are selected from the Kepler input catalog (KIC) based on the ability of the mission to find transiting planets, especially in the habitable zone; ideally, the target catalog should consist exclusively of dwarf stars for which the signal of a transiting planet is largest, and exclude sub-giant and giant stars. Brown et al. (2011) used D51 (Mg Ib line) photometry and Sloan g-D51 colors to exclude giants, however this is also sensitive to temperature and metallicity and is not available for all targets. The KIC includes Sloan (griz) and 2MASS (JHK) magnitudes; stellar parameters are estimated by forward modeling of the photometric data with the synthetic spectra of Castelli & Kurucz (2004), and effective temperature T ef f , gravity log g, and metallicity [M/H] as free parameters. Stellar mass and distance are then estimated using luminosity, T ef f , and log g from the stellar evolutionary models of Girardi et al. (2000). The combination of stellar mass and log g then yields a stellar radius. Brown et al. (2011) state that KIC radius estimates have average errors of 35% and are not reliable for stars cooler than 4000 K. Howard et al. (2011) point out that, because of the difficulty in constraining log g, the radii of some stars, particularly sub-giants, may be underestimated by a factor of 2 or more in the KIC. Gaidos et al. (2012) found that consistency between the Kepler candidate planet catalog and the M2K Doppler survey could be achieved if the former was incomplete compared to estimates based on KIC radii. They further point out that Kepler planet candidates were conspicuously sparse among late K stars with colors that are shared by both dwarfs and giant stars. Finally, Muirhead et al. (2011) showed that KIC estimates for the radii of many Kepler M dwarfs hosting planets are smaller than KIC values by as much as a factor of two. This is not to be confused with the 5-10% radius discrepancy between the most refined models and measurements by interferometry and observations of eclipsing binaries (e.g. López-Santiago et al. 2010;Kraus et al. 2011). Brown et al. (2011) regard the uncertainty of their metallicity estimates to at least ±0.4 dex. Instead, Schlaufman & Laughlin (2011) use Sloan g−r colors for a given J −H range as an indicator of the amount of Fe line blanketing at blue wavelengths, and hence metallicity. They construct mean g − r vs. J − H loci for KOIs and Kepler stars without identified transits. They find a significant difference between the two populations for stars with J − H ≈ 0.62, corresponding approximately to late K-type. This is inconsistent with Muirhead et al. (2011), who estimate metallicity using the equivalent widths of atomic lines in the K (2.2 µm) band and find that KOIs might be slightly metal-poor compared to the average target. However, K giants are significantly bluer than dwarfs in g − r, for the same J − H (Yanny et al. 2009). Thus, contamination of the Kepler target sample by giants would shift the locus of the target stars to bluer g−r, but not the KOI locus, as planets are less detectable, or completely undetectable around giant stars. Realizing this, Schlaufman & Laughlin (2011) constructed and analyzed artificial mixed data sets to estimate that a 10-30% contamination by giants would also produce the observed offset.
Moderate resolution spectra are nearly always sufficient to distinguish K and M giants from their dwarf cousins. In addition Ciardi et al. (2011) showed that some giant stars could be identified based on JHK photometry alone. In Section 2 we present spectroscopy of a representative sample of late-type Kepler target stars. In Section 3 we use both spectroscopy and photometry to derive luminosity classes and effective temperatures. In Section 4 we use this information, plus radii based on stellar evolutionary models, to refine the frequency of planets around these stars. In Section 5 we calculate and compare the mean g − r colors (as metallicity proxies) of KOIs and a bona fide dwarf sample.

SAMPLE, OBSERVATIONS, AND REDUCTION
Because derived KIC parameters may not always be reliable, we instead select our sample using available photometry of the Kepler field. A sample of stars with V − J > 2.5 will include > 98% of all M dwarfs, as well as most of the K7 dwarfs in the sample (Lépine & Gaidos 2011). Although 2MASS J magnitudes are available for almost the entire sample, V magnitudes are not. K P , however, is available for all target stars. For M0 stars, K P − V ≃ −0.43 (see http://keplergo.arc.nasa.gov/CalibrationZeropoint.shtml) so we conservatively select stars with Kp − J > 2 observed in Quarters 0-6 by Kepler and retrieved from the Multimission Archive (STScI). We remove stars with a contaminating star within 1 arc second.
Bright Kepler target stars are selected in a fundamentally different way from dim stars (see Figure 1; Batalha et al. 2010). We separately analyze dim (K P > 14) and bright (K P < 14) stars. Bessell & Brett (1988) showed that giant stars tend to have more extreme J −H colors than their dwarf counterparts. However, we want to investigate how misidentified giant stars in the KIC Kepler target stars with K P − J > 2. Our observing bins (see Section 2) are marked by blue lines, and red targets denote that we observed this star. There is a clear difference between how bright (K P < 14) and dim (K P > 14) stars are selected, resulting in a very different distribution of colors. For this reason we treat bright and dim Kepler target stars as two independent samples. We observe a randomly selected sample of stars within each bin, although we have more observations in the bright bins because they are more observationally accessible. In total we observed 388 stars covering 6.5 < K P < 16, 0.40 < J − H < 1.00 and KIC effective temperatures 3200 < T ef f < 5050 K. We show the distribution of observed targets in J − H and KIC T ef f space in Figure 2.
Observations were obtained between June 16 and Aug 28 (2011) with the SuperNova Integral Field Spectrograph (SNIFS, Lantz et al. 2004) at the University of Hawaii 2.2m telescope on Mauna Kea and the Boller and Chivens CCD Spectrograph (CCDS) or the Mark III spectrograph (MkIII) at the 1.3m McGraw-Hill telescope on Kitt Peak. SNIFS is an optical integral field spectrograph with R ≃ 1300 that splits the signal with a dichroic mirror into blue (3000 − 5200Å) and red (5000 − 9500Å) channels. The images are resampled with microlens arrays, dispersed with grisms, and focused onto blue-and red-sensitive CCDs. Processing of SNIFS data was performed with the SNIFS pipeline, described in detail by Aldering et al. (2006) and Pereira et al. (2010). SNIFS processing includes dark, bias, and flat-field corrections, assembling the data into red and blue 3D data cubes, and cleaning them for cosmic rays and bad pixels. After sky subtraction, the spectra are extracted with a semianalytic PSF model, and wavelengths calibrated with arc lamp exposures taken at the same telescope pointing as the science data. The CCDS and MkIII spectrographs cover 5700−9300Å and 4400−8300Å with R ≃ 1150 and ≃ 2300, respectively. Standard reduction of data taken with the CCDS and MkIII was performed with IRAF, following the practice of overscan subtraction, division by flat field, and extraction of the spectra. Spectra were wavelength-calibrated against NeAr comparison arcs. All observations (including SNIFS) were flux-calibrated and telluric lines were removed based on observations of the NOAO primary spectrophotometric standards Feige 66, Feige 110, and BD+284211. All spectra had a median S/N of > 30 in the 6000-7000Å range, and the median S/N of all spectra in this range was 50.
Our spectroscopic set only covers K P − J > 2.0, but we also consider a separate 'photometric sample' that includes stars with 0.56 < J − H < 0.66 or K P − J > 2. This is done so we can ensure coverage of the sample of late K stars used by Schlaufman & Laughlin (2011) (see Section 5). The KIC includes infrared (J, H, and K) photometry from 2MASS (Skrutskie et al. 2006) and visible-wavelength photometry through SDSS griz and D51 filters. We add photometry from the Wide-field Infrared Survey Explorer (WISE, Wright et al. 2010). 3.4µm, 4.6µm, 12µm, and 22µm. WISE-based color relations can be applied only to part of the Kepler sample, as the current WISE data release covers just 50% of the Kepler field.

LUMINOSITY CLASS
We determine luminosity class by comparing the spectral indices or colors of Kepler target stars to those of stars drawn from 'training sets' of known giants or dwarfs. We first discuss how we construct our training sets. We then explain our choice of indices and colorcolor relations, based on previous work on giant/dwarf discrimination and derived empirically from examination of the differences between the dwarf and giant training set. We use the colors and spectroscopic indices of stars in the training sets to construct a likelihood estimator, such that we can calculate the likelihood that a given star is a giant (or dwarf). That calculation is explained in Section 3.4.

Training Sets
We construct an uncontaminated set of dwarf stars from a sample of high proper motion-selected late K and M stars (Lépine & Gaidos 2011). The brightest (J < 9) northern stars in this sample have visible-wavelength spectra (Lépine et al. in prep). Spectra from this sample are obtained with the same instruments and reduced in the same way as was done for Kepler targets observed for this paper, making it an ideal comparison set. Although this sample includes more than 1500 spectra, we choose to use the 620 targets with spectra from SNIFS/UH2.2m, which includes the Ca II triplet (8484 − 8662Å). Lépine & Gaidos (2011) use J − H, and H − K colors, combined with proper motion from SUPERBLINK (Lépine & Shara 2005) and (for some targets) parallax information from Hipparcos (van Leeuwen & Fantino 2005;van Leeuwen 2007) to remove giant stars. Based on those stars in Lépine & Gaidos (2011) with parallax, we estimate that fewer than 0.5% of the resulting sample will be giants. However, because of strict cuts in J − H and H − K, the Lépine & Gaidos (2011) sample is incomplete and biased against dwarfs with much redder or bluer colors. Lépine & Gaidos (2011) also use a color cut of V − J > 2.7 to select mostly M dwarfs. This excludes some mid-to late-K stars which will be included in our K P − J > 2 cut and/or the 0.58 < J − H < 0.66 color cut for the photometric sample (see Section 2). We therefore add 60 late K and early M dwarfs included in the Hipparcos catalog and that have UH2.2m spectra but lie outside the cuts imposed by Lépine & Gaidos (2011). These stars are confirmed to be dwarfs by their Hipparcos parallaxes. We also add 150 M dwarfs with spectra from SDSS, including 50 dwarf from West et al. (2011), with r − J and J − H colors consistent with our targets of interest. We verify that these targets are dwarfs using a cut with reduced proper motion, where the reduced proper motion in the SDSS g band is: and µ is the proper motion in arcsec yr −1 . This quantity is similar to the absolute magnitude, such that giant stars will have much lower reduced proper motions than dwarfs of the same color. We only select SDSS stars with H g > 2.2(g − r) + 7.0, and µ > 15 arcsec yr −1 , which we determine empirically from our UH2.2m targets with SDSS photometry. Our sample of > 300 giant spectra is constructed from multiple catalogs, specifically Fluks et al. (1994), Danks & Dennefeld (1994), Allen & Strom (1995), Serote Roos et al. (1996), Montes et al. (1999), and Lançon & Wood (2000), as well as 80 bright stars we observed with UH2.2/SNIFS that are confirmed to be giants by Hipparcos. Many spectra have significantly higher resolution than our own observations. We convolve these data with a gaussian to match the resolution of our own sample to remove any resolution-dependency in our results. To include sufficient SDSS photometry, we supplement our giant training set by including 200 giant stars with spectra from SDSS all with r < 16 and proper motions consistent with zero. We require these SDSS spectra to have spectroscopic indices consistent with the rest of the giant training set. Because we select only SDSS stars with indices consistent with indices in spectra from the rest of the training set, SDSS giant stars have no effect on our spectroscopic determination of luminosity class. Rather, SDSS stars are added only for their photometry.
SDSS, 2MASS and WISE colors are available for much of our giant and dwarf training set, however, most lack  . Approximate regions for each of the six indices we use for giant/dwarf discrimination are marked in light grey. B 1 refers to a mix of atomic lines (Ba II, Fe I, Mn I, and Ti I) which overlap at the SNIFS resolution (≃ 1200). The TiO 5 molecular band (marked in dark grey) is used as a probe of spectral type, although it is also sensitive to metallicity (Lépine et al. 2007). Other atomic and molecular lines are generally much weaker in late type giant stars (Reid & Hawley 2005). Indeed, the Na I (8172-8197Å) and K I (7669-7705Å) doublets are are barely present in the giant spectrum above while they are both quite strong in the dwarf. measurements in the D51 band, which covers the gravitysensitive Mg Ib line at 5200Å. Instead, we synthesize equivalent g −D51 colors from the spectra of our training set. We obtain the zero point for the synthesized colors of those stars in our sample which have both spectra and g and D51 magnitudes.

Spectroscopic Determination of Luminosity Class
Our determination of luminosity class uses six different gravity-sensitive molecular/atomic indices (Table 1 and Figure 3). Molecular and atomic indices are ratios of the average flux levels in a specified wavelength region to that of a pseudo-continuum region. Indices are useful for M dwarfs where the continuum is poorly defined. The values of in most indices are a function of both gravity and temperature of the star. To remove this degeneracy we compare measured indices to the TiO 5 spectral index. TiO 5, as defined by Reid et al. (1995), is sensitive to spectral type and metallicity (Woolf & Wallerstein 2006;Lépine et al. 2007), but it has minimal gravity dependance.
We show spectra of giant and dwarf stars with similar effective temperatures in Figure 3, with the loca-tion of each feature labeled. As can be seen, atomic lines are generally weaker in giants than in dwarfs. Indeed the Na I doublet (8172-8197Å) and K I (7669-7705Å) lines are barely detectible in giants, but easily identifiable in dwarf stars (Torres-Dodgen & Weaver 1993;Schiavon et al. 1997;Gorlova et al. 2003). Molecular lines provide additional luminosity-dependent spectral signatures. Metal hydride bands, such as the CaH bands defined by Reid et al. (1995) and Lépine et al. (2007) have been used for luminosity classification, although they become less useful for stars earlier than K7. The calcium triplet (

Photometric Determination of Luminosity Class
We can use the available photometry to determine the luminosity class of a much larger sample of Kepler stars lacking spectra. Brown et al. (2011) primarily use g − D51 vs. g − r and J − K vs. g − i colors to separate Kepler late-type giants from dwarfs. Both giants and the coolest dwarfs in the sample have relatively weak Mg Ib lines, creating overlap between the dwarf and giant training sets at red g − r. A similar effect happens with J −K. Near-infrared photometry (J, H, K) has long been used to separate giants and dwarfs at redder colors (Bessell & Brett 1988), in part due to strong CO and weak Na I and Ca I absorption in giant stars. But for K and early M stars with J − H < 0.7 and H − K < 0.2, the giant and dwarf sequences overlap, creating a sizable region of ambiguity. At mid-infrared wavelengths, most giant stars have warm dust emission, leading to significantly redder colors in the WISE bandpasses. Other relations can be derived from an examination of our giant and dwarf training sets. z − K vs. g − J follows a similar distribution to that of J − K vs. g − i, but the giant and dwarf sample bifurcates at g − J ≃ 3.0, which makes it useful for isolating the reddest giants (see Figure 5).
3.4. Application of training sets to the Kepler sample After each spectral index or color is measured or calculated for Kepler targets and both training sets, we identify stars as giants or dwarfs following the same technique as Gilbert et al. (2006). We begin by using the spectral index or color measurements of the training stars to produce a two-dimensional probability distribution function (PDF) for each index (or color). The PDFs are constructed by treating the strength of each index or color (henceforth S) as a Gaussian distributed variable with respect to X. For spectroscopic determination of luminosity class, X is defined to be the TiO 5 band and S is one of our gravity-sensitive indices (Na I, Ca II, Ba II/Fe I/Mn I/Ti I, K I, or CaH). For photometric determination of luminosity class, X is defined as g − J, g − i, J − H, g − r, 3.4µm -22µm, or J − 3.4µm and S is z − K, J − K, H − K, g − D51, 4.6µm -12µm, or K − 4.6µm, respectively. Values of S are binned according to their corresponding X value. Bins in X are designed to contain an equal number of stars (20-25) in each bin, and as such they are not equally spaced in X. The mean (S) and standard deviation (σ S ) of the S distribution is computed in each bin. The two-dimensional PDF takes the form: (2) where C is a normalization such that the entire PDF integrates to 1, and P (X) is the probability distribution function for X. P (X) excludes targets with anomalous X values that would indicate an improperly included earlytype star that has erroneous photometry or significantly reddened colors. PDFs for both giant and dwarf training sets overlaid on Kepler target star indices or colors are shown in Figures 4 and 5 for the spectroscopic and photometric sets, respectively. The likelihood that star i is a dwarf for a given index j is: and the likelihood given all indices is: where w j is a weighting factor. Weights are calculated by determining the efficiency of a given feature at separating giants from dwarfs as a function of X. We take a random subsample (half the total sample) from each training set, and add Poisson noise to the spectra/colors consistent with our observations or given photometric errors. We then apply Equations 2 -4 to the subsamples using w j = 1. Values of w j are then set to be the fraction of dwarfs that are correctly identified. To ensure that our determinations are not overly sensitive to our weighting scheme, we recompute the likelihoods using w j = 1 for all j. In this case no stars with spectra are assigned a different luminosity class, however, it does reduce the confidence, and it makes a significant difference for the photometric determinations. The reason for this is the significant overlap between the PDFs of the color metrics for giant and dwarf training sets (e.g. 2.3 < g − J < 2.8 and 1.6 < z − K < 1.9, also see Figure 5). In overlapping regions, indices or colors will give similar probabilities for a star being a giant or a dwarf, making the metric less useful in giant/dwarf discrimination. Weighting factors are set to 0 if any of the relevant indices/colors are missing for a given star. We identify all Kepler target stars with spectra as a giant or a dwarf with better than 99.7% (L i > 2.6 or L i < −2.6) probability. For the photometric sample, most stars are placed into unambiguous giant or dwarf categories ( L i > 1.5 for dwarfs or L i < −1.5 for giants). However, ≃ 2% of the sample are more ambiguous, most of which lack WISE photometry. Colors for a subsample of Kepler stars are shown in Figure 5 with PDFs from our giant and dwarf training sets overlaid.

Giant Star Fraction
We find that, for the coolest Kepler stars (K P −J > 2), giant stars dominate the bright (K P < 14) Kepler target stars but are relatively rare among dim (K P > 14) targets. The fraction of giants is 95 ± 1% for bright stars, Contours of the PDF correspond to 68, 90, and 95% intervals for the given training set. We positively identify each star with spectra as a giant or a dwarf with > 99.7% certainty. 7 ± 2% for dim stars, and 51 ± 3% for the combined set (based on our spectroscopy). Photometric assignments (considering K P − J > 2) give consistent giant fractions: 95 ± 2% for bright stars, 8 ± 3% for dim stars, and 59 ± 4% for all stars with K P − J > 2. The fractions in each brightness bin do not change significantly when we apply a KIC log g > 4.0 cut. The giant fraction becomes 94 ± 4% for bright stars and 5 ± 3% for dim stars. However, the fraction of giants for all stars decreases to 12 ± 3%, due mainly to the large number of stars lacking any log g classification (which are removed from this cut). Since giant/dwarf assignments based on spectroscopy are very accurate, only counting statistics are considered for the spectroscopic sample. For uncertainty estimates from the photometric sample, we re-apply our likelihood calculations using 1000 different subsets of our training sets, adding random (Poisson) noise to the photometry, and then recalculating the giant fraction in each case. The variation in giant fraction is added in quadrature with binomial errors. This does not consider systematic errors (e.g. systematic photometric errors, discrepancies between training sets and Kepler target stars, etc).  Figure 4 except using gravity-sensitive color-color relations. Contours for the training set PDFs correspond to 68 and 90% levels. We apply this cut to Kepler target stars with J − H > 0.5 or K P − J > 2.0, although only a subsample of this set is shown for clarity. Most stars fall well inside either the dwarf or giant sequence, however, even when all color relations are used, ≃ 2% of the sample still have an ambiguous luminosity class assignment. Most of these stars are those lacking photometry in one or more band. This is a particular problem for WISE photometry, which only covers ≃ 50% of the Kepler field.

Counting Estimation
We first calculate the frequency of planets following the method of Gaidos et al. (2012). The most probable mean frequency of the ith planet in the population of j = 1...N stars (f i ) is: where d i,j is the probability of detection if the planet is transiting the jth star, and p i,j is the geometric probability of a transit. For small planets and nearly circular orbits, where P is the orbital period in days and M * and R * are the stars mass and radii in solar units. Values for M * and R * are computed by interpolating a grid of stellar radii/masses from the Dartmouth Stellar Evolution Database (DSEP Dotter et al. 2008) at estimated values of T ef f , [Fe/H], and age. We use DSEP because radii and masses derived from their isochrones are in good agreement (< 0.02 RMS deviation in radius) with current empirical measurements of eclipsing binary systems (Dotter et al. 2008;Feiden et al. 2011).
For exoplanet hosts we use the metallicities given in Muirhead et al. (2012), but for field stars metallicities are drawn from a random gaussian distribution of metallicities with [F e/H] = −0.7 and σ [F e/H] = 0.20. This distribution is designed to be consistent with the distribution of M dwarfs in the solar neighborhood (Johnson & Apps 2009;Casagrande et al. 2011). Ages are assigned randomly assuming a constant star formation rate (excluding ages < 100 Myr). However, since M dwarfs do not change significantly while on the main sequence, our results are not changed when we fix all ages to 5 Gyr. The resulting stellar radii from the DSEP grid are used in conjunction with values of R p /R * from Borucki et al. (2011a) to compute planetary radii.
Estimates of T ef f can be inferred from our optical spectra. We compare our visible spectra to a grid of models of K-and M-dwarf spectra generated by the BT-SETTL version of PHOENIX (Allard et al. 2010). Details of the comparison, sub-grid interpolation, and error calculations are described in Lépine et al. (in prep). The grid of models spans T ef f of 3000-5000 K in steps of 100 K, log g values of 0.0-5.0 in steps of 0.5 dex, and metallicities of [M/H] = -1.5, -1, -0.5, 0, +0.3, and +0.5. α/Fe is taken to be solar. We report the T ef f of the best-fit interpolated model, and the standard deviation of T ef f among the set of interpolated models that are nearby in parameter space.
Our calculated values of T ef f are shown in Fig 6 vs. the temperature given in the KIC (Brown et al. 2011). Our temperatures are systematically lower than KIC temperatures by 135 +10 −30 K for the dwarf stars, and 226 +18 −29 K for the giant stars. Errors are calculated by bootstrap resampling. This is consistent with other determinations using the atmospheric models of Allard et al. (2010), including other determinations on Kepler KOI stars (Muirhead et al. 2012). Our calculated temperatures is tightly correlated with KIC temperatures. When KIC temperatures are corrected for our observed offset, the standard deviation of the difference in calculated temperatures (σ KIC−P hoenix ) is 90 K, suggesting that the KIC temperatures for low-mass stars are more precise but are less accurate than suggested by Brown et al. (2011). For field stars with visible-wavelength spectra, we adopt our calculated T ef f values, and for stars with exoplanet candidates we use the T ef f from Muirhead et al. (2012). For the remaining stars we adjust the KIC effective temperatures of Kepler stars downward randomly by 135 +10 −30 K to keep the temperatures consistent with those of the KOI stars and those with spectra in our sample. This offset is randomized to account for errors in the systematic difference between temperatures calculated from our spectra and those listed in the KIC.
We consider a planet detected (d i,j = 1) if: where δ is the transit depth, N is the number of tran- For both giants and dwarfs there is a clear 100-200 K offset between our spectroscopically determined temperatures and the KIC temperatures. This is most likely a consequence of the models used, as Castelli & Kurucz (2004) models used to fit KIC photometry to effective temperatures is unreliable below 4000 K. sits detected over the observational period, τ is the transit duration in minutes, and σ CDP P is the 30 minute combined differential photometric precision (CDPP) of Kepler . We use Quarter 0-2 30 minute CDPP values from Kepler. Our detection threshold S/N = 10 matches what is used by Howard et al. (2011), but is higher than what is used by Borucki et al. (2011a) to cut down on the number of false positives and/or highly inaccurate transit parameters.
We compute the frequency of planets with 2R ⊕ < R P < 32 ⊕ and P < 50 days around stars with 3400 < T ef f < 4100 using Equations 5 -7. We calculate the standard deviation of the frequency using a Monte Carlo analysis. Stellar parameters are perturbed randomly (see above) accounting for errors from Muirhead et al. (2012) on KOI metallicity and T ef f , and random errors from derived from T ef f fits (see Figure 6) to our spectra. Other stars are given a random error of 90 K. We perturb transit parameters R P /R * and period according to errors given by Borucki et al. (2011b). Planetary radii are recalculated from perturbed values of R P /R * and R * .
We remove planets from the KOI sample using the false positive probabilities from Morton & Johnson (2011) (a planet candidate with a 5% false positive probability is removed in 5% of the simulations). We remove giant stars from the sample using the calculated photometric likelihoods (Section 3.3) for each star, such that a star with a 10% likelihood of being a giant star will be removed from the sample in 10% of the Monte Carlo (MC) simulations. This also applies to stars with detected planet candidates, causing the planet to be removed, i.e. we consider the planet detection to be a false positive if the star is a giant. We run an additional set of MC simulations following the same criteria, but using the KIC log g > 4.0 criterion, intended as a comparison with Borucki et al. (2011b) We find that there are 0.36 ± .07 planets (with 2R ⊕ < R P < 32R ⊕ and P < 50 days) per star in the temperature range 3400 < T ef f < 4100. This value is slightly lower (by 0.09 planets per star) if giant stars are not properly removed. For comparison we run an additional Monte Carlo simulation but only remove giant stars with KIC log g > 4.0 as in Howard et al. (2011). To test how our results depend on our choice of stellar radii model (DSEP) we also run two simulations using the Yale-Yonsei (Han et al. 2009) isochrones: one with giant stars removed as explained above and another removing just giants with KIC log g > 4.0. The resulting Monte Carlo distributions are shown in Figure 7.

Likelihood estimation
We also perform a maximum likelihood estimation of the fraction of stars with planets with radii 2R ⊕ < R < 32R ⊕ and orbital period P < 50 d (see Howard et al. 2011, for a similar analysis). For discrete, binomial (detection or non-detection) events, the likelihood is expressed as: where the first product is of detections, the second is of non-detections, and ρ i is the probability that a planet with properties in the appropriate ranges will be found around the ith star. For this formulation, we have assumed that ρ ≪ 1. We adopt the specific power-law form dN = CR −α i P −β d ln R · d ln P for the intrinsic distribution of planets. If both α and β are > 0 then the normalization factor C is given by: where f is the total fraction of stars with such planets. We do not model multi-planet systems; that level of analysis is not justified given the large uncertainties in our parameters.
Following the usual procedure, we maximize the logarithm of L: where D j (R j , P j ) is the probability of detecting the jth planet around its host star (note D j (R j , P j ) = d j p j , see Equation 5 and 6), including the geometric factor, and (11) If the detection rate is low, then: We then substitute Equation 9 for C. Ignoring terms that do not depend on α, and thus do not affect its maximum likelihood value, we find the following quantity must be maximized: Likewise, The simultaneous solution for the fraction of stars with planets is found by maximizing the terms that depend on f and is simply where N p is the number of detected planets. Equation 15 immediately suggest a reduction in the last terms of Equations 13 and 14 to N p , which is independent of α and β and can be ignored. Tests with artificial Monte Carlo data sets suggest that the recovered values of α are biased downwards, but that f is robustly recovered. Because there are too few systems in our sample for adequate treatment, we fix β = 0 with a cut-off at P 1 = 1 d, consistent with the findings of previous analyses (Cumming et al. 2008;Howard et al. 2011). Equation 15 becomes: Using the cool KOIs defined here, stellar parameters derived as explained above, and Monte Carlo data sets generated by sampling with replacement, we find that f = 0.34 ± 0.08, consistent with our previous calculation. As before, we repeat our Monte Carlo simulation but only removing giant stars with KIC log g > 4, and another run using the Yale-Yonsei evolutionary tracks Fig. 7.-Number of planets per star with giant stars removed (solid line) or using KIC log g > 4.0, using isochrones from DSEP (black) or from Yale-Yonsei (red) calculated by Monte Carlo analysis. The bottom plot is calculated using likelihood estimation as explained in Section 4.2. For both plots, we consider planets with radii 2R ⊕ < R P < 32 ⊕ and periods P < 50 days, and stars with effective temperatures 3400 < T ef f < 4100. A full description of our Monte Carlo analysis is given in Section 4. (Han et al. 2009) instead of those of DSEP. The resulting Monte Carlo distributions are shown in Figure 7.

PLANET-HOST METALLICITIES
Schlaufman & Laughlin (2011) use g − r vs. J − H colors to conclude that late-type (J − H ≃ 0.62) exoplanet hosts are redder and more metal-rich than stars without a transiting planet. Because giant stars have bluer g − r colors at a given J − H color (Bessell & Brett 1988;Gilbert et al. 2006;Schlaufman & Laughlin 2011), a significant number of giant star interlopers in their sample will cause field stars to appear metal poor. Giant stars have stellar radii 10-100 times larger than dwarfs, making it much less likely that they will appear as KOIs (with the exception of false positives).
We can test their findings by creating a "pure" dwarf sample, and comparing its color distribution to that of the KOI sample. Our K P − J > 2 sample is systematically redder in J − H than the 0.56 < J − H < 0.66 bin used in Schlaufman & Laughlin (2011), preventing us from making a direct comparison. Instead, we construct samples of giants and dwarfs in the J − H ≃ 0.62 bin based on our photometric determination of luminos-ity class. For both the dwarf and giant samples, we select Kepler target stars with photometry in all bands used in our photometric assignment of luminosity class (J, H, K, D51, g, r, and all four WISE bands). We then select stars with a > 90% likelihood of being dwarfs based on our analysis in Section 3.3. The resulting dwarf sample is ≃ 2500 stars. This sample may still contain giants. To place limits on the giant contamination rate, we added Poisson noise to the photometry of both the training sets and the Kepler sample, then took random subsamples of both training sets and reapplied them to the modified photometry of the Kepler sample. We repeated this process 1000 times. By analyzing the number of giant stars in each of these new samples we find that our dwarf sample is < 1% giant stars at 95% confidence. Although this analysis ignores possible systematic errors in our technique.
We use this dwarf sample, following the method of Schlaufman & Laughlin (2011), to compare the g − r colors at a given J − H (a proxy of effective temperature) of the exoplanet host stars with our dwarf sample. We find no significant difference in color between the KOI stars and our dwarf sample. Figure 8 shows g − r colors as a function of J − H colors for the dwarf, giant, planethost, and KIC log g > 4.0 sample. Unlike the KIC log g sample, the locus of our photometrically selected dwarf sample is a good match for the KOI sample locus at J − H ≃ 0.62. For stars with K P − J > 2.0 we find an offset in g − r color of −0.03 ± 0.03 between the spectroscopically confirmed dwarfs and late-type KOI stars hosting Earth-to-Neptune sized planets. When we use our photometric sample of dwarfs in the J − H ≃ 0.62 bin we find an offset of 0.01 ± 0.02 and we can rule out the offset of 0.08 seen by Schlaufman & Laughlin (2011) with > 99.7% certainty. Our photometric selection may remove some metal-poor dwarfs. However, even when we include stars ≥ 60% likelihood of being dwarfs, which will necessarily increase the number of interloping giants, the offset is still only 0.02 ± 0.02 (consistent with zero offset).
In spite of the low giant fraction for dim Kepler target stars, it is not sufficient to simply repeat the Schlaufman & Laughlin (2011) analysis exclusively for stars with K P > 14. Since Schlaufman & Laughlin (2011) only examine stars with KIC log g > 4.0, it is far more important to investigate the distribution of misidentified giants in this color range (i.e. giant stars which were given log g > 4 in the KIC). In fact the fraction of misidentified dim giant stars in their J −H ≃ 0.62 bin is higher (12%), than it is for the K P − J > 2 star sample. We show why this is the case in Figure 9, which shows the distribution of giants, dwarfs, and misidentified giants in J − H vs. g − r space. Misidentified giants are clustered at 0.58 < J − H < 0.63. Further, the misidentified giants in this J − H range are much more blue than the dwarfs in the same range. Thus by selecting a color bin centered on J − H = 0.62, Schlaufman & Laughlin (2011) are over-selecting giant stars, even after applying a KIC log g > 4 cut (≃ 15% of this sample are giant stars). This over density of misidentified giants is the most likely explanation for the color offset seen by Schlaufman & Laughlin (2011), and also explains why the same g − r offset is not seen at redder J − H colors. Bins for all data sets are the same, but each point is offset slightly from the bin center for clarity. There is a statistically significant offset between the KIC log g > 4.0 sample and the planet hosts when we consider stars with 0.58 < J − H < 0.66, however, this offset is no longer present when misidentified giant stars are removed from the sample. Indeed, our dwarf control sample closely tracks the colors of the planet-hosting stellar population.

DISCUSSION
We use visible-wavelength spectra to determine the properties of a subset of late-type Kepler target stars. We separate giants from dwarfs by comparing our spectra to those of stars with known luminosity class, and determine effective temperatures by comparing with PHOENIX model spectra. We extend our results to a larger collection of Kepler stars using photometry from the KIC, 2MASS, and WISE catalogs. We apply our luminosity class determinations to refine estimates of the frequency of planets around stars with 3400 < T ef f < 4100, and compare the colors -and hence metallicities of stars with and without detected Earth and Neptune sized planets. We draw four major conclusions: 1. Among stars redder than K P − J = 2 (≃ K5 and later), bright (K P < 14) stars are predominantly (95 ± 1%) giants, while dim stars (K P > 14) are predominantly (93 ± 2%) dwarfs. These fractions do not change significantly (94 ± 4% and 96 ± 2% respectively) when we consider stars with KIC determined log g > 4.0. Overall 49 ± 3% of Kepler stars with K P − J > 2 are giants. However, only 12 ± 3% of said stars with KIC log g > 4.0 are giants.
2. KIC effective temperatures, based on the models of Castelli & Kurucz (2004) and g, r, i, z, J, H, K photometry, are systematically higher by 135 +10 −40 K compared to those derived from our own spectra and PHOENIX BT-SETTL atmosphere models (Allard et al. 2010).
3. Adopting the temperature scale from BT-SETTL and radii/masses from the Dartmouth Stellar Evolution Database (Dotter et al. 2008), and our giant star identification, we find that there are 0.36 ± 0.07 planets with radii 2R ⊕ < R P < 32R ⊕ and periods P < 50 days per star in the temperature range 3400 < T ef f < 4100. Using the KIC determined luminosity classes leads to a somewhat lower planet frequency of 0.27 ± 0.05 planets per star. When we use the maximum likelihood method to estimate the planet frequency, we get 0.34 ± 0.08 planets per star.
4. The g − r colors of exoplanet host stars at J − H ≃ 0.62 are consistent with an unbiased sample of Kepler dwarf stars, ruling out any large difference between hosts of Earth-to-Neptune sized planets and those without any detected planets.
Surprisingly, there are hundreds of stars in our photometric sample that could have been easily identified as giants with photometry included in the KIC, but were assigned log g > 4. The KIC primarily uses g − D51 vs g − r colors to identify giants, and many late-type stars with KIC log g > 4.0 have g − D51 vs g − r colors consistent with giants (and inconsistent with dwarfs).
Our calculated giant fraction is consistent with other independent measurements. Gaidos et al. (2012) compare radial velocity data from M2K (Apps et al. 2010;Fischer et al. 2011) to Kepler results and note that the completeness of the coolest Kepler target stars may be quite low (≃ 50%), much of which could be explained by an underestimate of the frequency of giant stars. Additionally, Ciardi et al. (2011) find that bright Kepler M stars are"predominantly giants, regardless of the KIC classification" based on JHK photometry alone.
Interestingly, we find two KOIs with colors consistent with giant stars. KOI 667 and KOI 977 both fall within our giant training set in multiple color relations, and well outside our dwarf training set. KOI 977 was identified as a giant by Muirhead et al. (2011), and they also note that KOI 667 consisted of 5 objects with 6 ′′ which may be contaminating 2MASS or WISE photometry. One of these objects could be an eclipsing binary, diluted by the other stars. KOI 667 also has a relatively high (10%) false positive probability based on Galactic structure models.
Our values of T ef f are consistent with results reported elsewhere also using BT-SETTL, including observations of the late-type KOIs with near-infrared spectra (Muirhead et al. 2011). These authors find a similar systematic offset of 123 +24 −32 K between their temperatures and KIC assigned temperatures. KIC temperatures are based on the models of Castelli & Kurucz (2004) and the evolutionary tracks of Girardi et al. (2000), which, although reliable for solar-mass stars, are untrustworthy for stars with T ef f < 3750 K (Brown et al. 2011).
Our planet frequency estimate is slightly higher than that of Howard et al. (2011), who, using results from Kepler, find that there are 0.30 ± 0.08 planets per star with 3600 < T ef f < 4100. The difference is primarily due to reliance on luminosity class determinations by Brown et al. (2011), which we find to be inaccurate. However, the difference is only within 1σ. For both our work and that of Howard et al. (2011), errors are dominated by the low number of late-type stars (and therefore planets around them) in the Kepler field and very high random (∼ 35%) errors in stellar radii.
In addition to random errors (e.g. stellar radii and R p /R * ) that are included in our Monte Carlo simulation, there may be large systematic uncertainties in atmosphere models and evolutionary tracks, which can change the resulting frequency. When we use the Yale-Yonsei isochrones, it decreases our planet frequency by ≃ 0.09 planets per star. Interestingly, this difference is similar in size to the random errors in our Monte Carlo analysis (≃ 0.08 planets per star), and the difference between proper giant removal and using KIC log g > 4.0 (≃ 0.10 planets per star). This suggests that giant star removal, improved stellar characterization of the dwarf stars, and use of reliable stellar models of late-type stars are all of importance to characterizing the frequency of planets around very cool stars.
The lack of a strong correlation between host-star metallicity and the presence of Earth-to-Neptune sized planets is consistent with what is found for solar-type stars, e.g. Mayor et al. (2011). This also matches the findings of Muirhead et al. (2011), who determine that among the late-type Kepler exoplanet hosts in our sample the median [M/H] is −0.11 ± 0.02. This distribution is consistent with, or more metal poor than, stars in the solar neighborhood (−0.05 to −0.15, Johnson & Apps 2009;Schlaufman & Laughlin 2010;Casagrande et al. 2011). A metallicity difference could only be present if Kepler target stars are significantly more metal poor than stars in the solar neighborhood. As explained in Gaidos et al. (2012), this is unlikely given the position and distance to late-type Kepler dwarfs.
Our analysis of the g − r colors of planet hosts contra-dicts the results of Schlaufman & Laughlin (2011), who find a 4σ difference between g − r colors of late-type exoplanet hosts and stars with no exoplanets present. Their result is most likely an artifact of the large number of stars which were misclassified as dwarfs in the KIC. Schlaufman & Laughlin (2011) state that their result can be reproduced if their sample of KIC log g > 4 stars is between 10% and 30% giants, which they calculate by adding stars with KIC log g < 4 stars into their control sample, and measuring the resulting g − r color offset. We find that the giant fraction is above 10% for this color range. Further, if the KIC log g > 4 sample is significantly contaminated with giants, the sample will have bluer colors than a true dwarf sample. Adding additional giants to this contaminated sample will create smaller changes in the overall color of the sample than if it had contained only dwarf stars. Thus many more giants will be required to produce a given offset, creating an artificially high estimate for the level of giant contamination required to produce the offset. Although the g − r colors of exoplanet hosts in our sample are consistent with our dwarf sample, we cannot rule out small offsets ( 0.05) in g − r color. It is possible that any metallicity effect is sufficiently small that it is diluted to non-detection by the large number of undetected exoplanets in the dwarf sample. As Kepler continues to discover planets of smaller radii and at larger orbital periods, the answer may become more clear.
This work was supported by NSF grant AST-0908419, NASA grants NNX10AI90G and NNX11AC33G (Origins of Solar Systems) to EG, as well as NSF grants AST 06-07757 and AST 09-08419 to SL. SNIFS on the UH 2.2-m telescope is part of the Nearby Supernova Factory project, a scientific collaboration among the Centre de Recherche Astronomique de Lyon, Institut de Physique Nuclaire de Lyon, Laboratoire de Physique Nuclaire et des Hautes Energies, Lawrence Berkeley National Laboratory, Yale University, University of Bonn, Max Planck Institute for Astrophysics, Tsinghua Center for Astrophysics, and the Centre de Physique des Particules de Marseille.
Some of the data presented in this paper were obtained from the Multimission Archive at the Space Tele-scope Science Institute (MAST). STScI is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS5-26555. Support for MAST for non-HST data is provided by the NASA Office of Space Science via grant NNX09AF08G and by other grants and contracts.
Funding for the SDSS and SDSS-II has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Science Foundation, the U.S. Department of Energy, the National Aeronautics and Space Administration, the Japanese Monbukagakusho, the Max Planck Society, and the Higher Education Funding Council for England. The SDSS Web Site is http://www.sdss.org/.
This publication makes use of data products from the Wide-field Infrared Survey Explorer, which is a joint project of the University of California, Los Angeles, and the Jet Propulsion Laboratory/California Institute of Technology, funded by the National Aeronautics and Space Administration.