  We investigate the form of the local vertical density profile of the stars in
the Galactic disk, close to the Galactic plane. We use a homogeneous sample of
34000 ultracool dwarfs M7 to L2.5 that all lie within 350 pc of the plane. We
fit a profile of the form sech$^\alpha$, where $\alpha=2$ is the theoretically
preferred isothermal profile and $\alpha=0$ is the exponential function. Larger
values of $\alpha$ correspond to greater flattening of the profile towards the
plane. We employ a likelihood analysis that accounts in a direct way for
unresolved binaries in the sample, as well as for the spread in absolute
magnitude $M_J$ within each spectral sub-type (Malmquist bias). We measure
$\alpha=0.29^{+0.12}_{-0.13}$. The $\alpha=1$ (sech) and flatter profiles are
ruled out at high confidence for this sample, while $\alpha=0$ (exponential) is
included in the 95% credible interval. Any flattening relative to exponential
is modest, and is confined to within 50 pc of the plane. The measured value of
$\alpha$ is consistent with the results of the recent analysis by Xiang et al.
Our value for $\alpha$ is also similar to that determined for nearby spiral
galaxies by de Grijs et al., measured from photometry of galaxies viewed edge
on. The measured profile allows an accurate determination of the local space
density of ultracool dwarfs M7 to L2.5, and we use this to make a new
determination of the luminosity function at the bottom of the main sequence.
Our results for the luminosity function are a factor two to three lower than
the recent measurement by Bardalez Gagliuffi et al., that uses stars in the
local 25 pc radius bubble, but agree well with the older study by Cruz et al.
