text:
Article | Open | Published:

# Semiconductor-based Multilayer Selective Solar Absorber for Unconcentrated Solar Thermal Energy Conversion

Scientific Reportsvolume 7, Article number: 5362 (2017) | Download Citation

## Abstract

Solar thermal energy conversion has attracted substantial renewed interest due to its applications in industrial heating, air conditioning, and electricity generation. Achieving stagnation temperatures exceeding 200 °C, pertinent to these technologies, with unconcentrated sunlight requires spectrally selective absorbers with exceptionally low emissivity in the thermal wavelength range and high visible absorptivity for the solar spectrum. In this Communication, we report a semiconductor-based multilayer selective absorber that exploits the sharp drop in optical absorption at the bandgap energy to achieve a measured absorptance of 76% at solar wavelengths and a low emittance of approximately 5% at thermal wavelengths. In field tests, we obtain a peak temperature of 225 °C, comparable to that achieved with state-of-the-art selective surfaces. With straightforward optimization to improve solar absorption, our work shows the potential for unconcentrated solar thermal systems to reach stagnation temperatures exceeding 300 °C, thereby eliminating the need for solar concentrators for mid-temperature solar applications such as supplying process heat.

## Introduction

Solar thermal energy conversion is of intense interest due to environmentally sustainable applications in industrial heating, air conditioning, and electricity generation1,2,3,4. For instance, solar thermal input can be used for industrial process heat instead of furnaces or can replace the compressor in conventional air conditioning units1, 2. Solar thermal energy can also be used for desalination of sea water, particularly in remote locations5.

A key element of a solar thermal system is a selective surface that simultaneously maximizes solar absorption while minimizing parasitic heat losses due to infrared thermal emission. A non-selective black surface like carbon-black can only reach a maximum temperature of about 130 °C under unconcentrated sunlight. Selective surfaces were originally proposed in the 1950s, and numerous designs have been proposed since, including cermets, metal dielectric structures, and patterned metal surfaces6,7,8,9,10,11,12,13,14. For example, Barshilia et al. developed a multilayer stack of AlxOy/Al/AlxOy, that is stable up to 400 °C in air and exhibits 96% solar absorptance and 7% thermal emittance14. Recently, Cao et al. used a calorimetric technique to determine the temperature dependent, hemispherical solar absorptance and thermal emittance of an yttria-stabilized zirconia cermet to be 91% and 13%, respectively at 600 °C10.

Another approach for achieving spectral selectivity at moderate temperatures below 500 °C is to use semiconductors with appropriately chosen bandgaps. For photon energies above the bandgap, semiconductors absorb strongly, while for sub-bandgap energies they absorb very little. Because of the near zero absorption below the bandgap, semiconductor based selective surfaces offer the potential for thermal emittance lower than that achieved with surfaces that employ textured metals in the primary absorbing medium. Further, the transition from absorbing to non-absorbing occurs over a very narrow bandwidth compared to that of traditional selective surfaces. Early work by Seraphin and others has demonstrated the potential of using semiconductors for solar thermal purposes15,16,17,18. However, semiconductors with small bandgaps suitable for absorbing the solar spectrum (0.6 eV to 1.4 eV) have high refractive index and consequently require elaborate antireflection coatings. Standard materials for solar cell antireflection coatings such as SiO2, Si3N4, and TiO2 are quite emissive in the mid-infrared, however, and are unsuitable for solar thermal applications. As a result, the performance of semiconductor-based solar thermal absorbers has lagged that of metallic and ceramic counterparts.

In this Communication, we present a semiconductor-based multilayer stack that achieves the high solar absorption and low thermal emission necessary for unconcentrated solar thermal applications. At room temperature, the measured absorption at solar wavelengths is 76%, while at thermal wavelengths the measured absorption is 5%. Variable temperature Fourier Transform Infrared Spectroscopy (FTIR) shows good stability at temperatures up to 300 °C in air, and field tests show a peak operating temperature of 225 °C that is comparable to the performance of state-of-the-art selective surfaces. With straightforward optimization, our surface could achieve temperatures exceeding 300 °C, thereby enabling the use of unconcentrated sunlight for mid-temperature applications such as supplying process heat without need for large geometric concentrators.

## Results

We begin by discussing the constituent materials for a multilayer stack needed to achieve the desired optical behavior. The most important component is the semiconductor that provides the spectrally selective absorption. The semiconductor bandgap energy must correspond to photon wavelength between 1 μm and 2 μm to absorb as much of the solar spectrum as possible. As semiconductors typically have high refractive index, additional materials with lower refractive index must be included in the stack to reduce visible wavelength reflections. For these materials, it is essential that they be transparent at wavelengths longer than the bandgap cutoff wavelength.

Considering these factors, we chose Ge as the semiconductor due to its favorable bandgap energy and CaF2 as the dielectric for antireflection. CaF2 has low refractive index of about 1.4 and is transparent in the infrared out to 20 μm, making it ideal for antireflection purposes in solar thermal applications19. For the primary back reflector, we chose Ag, sandwiched by two thin layers of Cr to improve semiconductor-metal film adhesion.

Room temperature deposited films of Ge tend to be amorphous, but thin films of amorphous Ge (aGe) have been shown to exhibit temperature stability at moderate temperatures less than 300 °C20, 21. Amorphous Ge has different above-bandgap optical properties than those of its crystalline counterpart22. Therefore, to model the 1-D stack, we use the bulk refractive index of amorphous Ge but that of crystalline Cr, Ag, and CaF2. We optimize the sequence and thickness of thin films of aGe and CaF2 for high reflectivity at wavelengths above 1.7 μm and low reflectivity below 1.5 μm using a needles method (see Methods). A schematic of the optimized multilayer absorber is shown in Fig. 1a.

The simulated absorptance of the structure at all incident angles is shown in Fig. 1b. How efficiently a selective surface converts direct sunlight into usable heat is determined by two spectrally averaged quantities. The first is the solar absorptance, α s :

$${\alpha }_{s}=\frac{{\int }_{0}^{\infty }\alpha (\lambda ){I}_{AM1.5}(\lambda )d\lambda }{{\int }_{0}^{\infty }{I}_{AM1.5}(\lambda )d\lambda },$$
(1)

where α(λ) is the spectral absorptance and I AM1.5(λ) is the AM1.5 spectrum from the sun. The second is the average thermal emittance, ε t :

$${\varepsilon }_{t}=\frac{{\int }_{0}^{\pi }{\int }_{0}^{\pi \mathrm{/2}}{\int }_{0}^{\infty }\alpha (\lambda ,\theta ){I}_{BB}(T,\lambda )\,\cos \,\theta \,\sin \,\theta \,d\lambda \,d\theta \,d\phi }{\sigma {T}^{4}},$$
(2)

where I BB (T, λ) is the black body distribution at temperature T, and σ is the Stefan-Boltzmann constant23. Using the simulated absorptance of the structure at all incident angles, shown in Fig. 1b, we calculate the average solar absorptance to be 86.4% and the average thermal emittance to be 4.4%. In particular, the calculated emissivity is lower than those of prior reported works by over 50%, highlighting the potential of semiconductor-based selective absorbers for unconcentrated solar thermal applications for which low emissivity is essential10, 13. The solar absorptance can be further increased by introducing additional layers, but for simplicity we consider the stack as designed.

We obtained silicon wafers coated with the multilayer stack from LGA Thin Films, which coated the wafers using electron beam evaporation. We first characterized the structure of the surface using cross-sectional transmission electron microscopy (TEM) in Fig. 2a,b. The first layer of Ge, deposited on top of the Ag layer with the invisible 5 nm layer of Cr in between, is dense. However, subsequent layers of Ge, deposited on CaF2, are not dense and mix with the sandwiching layers of CaF2. The CaF2 appears to form columns that do not provide adequate adhesion sites for the subsequently deposited Ge atoms. As a result, the effective refractive index of the Ge layers that are deposited on the CaF2 layers is that of an aGe-CaF2 mixture. The designed structure accounted for this mixing by assuming that the refractive index of the initial aGe layer was still that of pure amorphous Ge, but all subsequent layers of Ge had the refractive index of an effective medium whose composition was determined to be 50% Ge and 50% CaF2 (see Supporting Information). Further, the deposition rate of CaF2 was recalibrated to correct for the discrepancy in thickness between the fabricated surface and the design. A wafer fragment of the final selective absorber is shown in Fig. 2c.

Next, we measured the room temperature spectral reflectance of the sample using UV-Vis spectroscopy and Fourier-Transform Infrared Spectroscopy (FTIR), as shown in Fig. 3a. Under real-world conditions, incident sunlight is typically close to normally incident, and the spectra in Fig. 3a can be used reliably to determine average solar absorptance. The solar absorptance before exposure to the sun obtained from this measurement is 76%. This value is lower than that of the simulated design due to discrepancies in the actual and targeted thicknesses of the individual layers. Although lower than that of other reported selective surfaces, the solar absorptance can be improved by straightforward optimization of the deposition process.

The infrared reflectance spectra were also measured at temperatures up to 300 °C in dry air, as shown in Fig. 3b. The spectra were taken with a confocal microscope and an HgCdTe (MCT) detector, while the samples were heated on a Linkham FTIR 600 temperature stage with a KBr window. Because of the added KBr window, we found the temperature dependent FTIR spectra depended sensitively on the microscope focus, and the uncertainty of these measurements was 5% absolute. As a result, there are regions in the IR, where the high IR reflectance is shown to exceed unity but by no more than 5%. However, we still use these measurements to determine trends in thermal stability. As the temperature increases, the dip in reflectance at 3 μm becomes less pronounced and is stable from 100 °C to 200 °C. At 300 °C, as indicated by the red curve in Fig. 3b, the reflectance dip at 3 μm begins to decrease again. Interestingly, the temperature cycling seems to initially cause a beneficial increase in IR reflectance. As water is absorptive at 3 μm and these samples were stored in air, a layer of water had likely adsorbed to the surface and evaporated after heating above 100 °C, causing the reflectance to increase24. Hence, the room temperature FTIR spectra shown in Fig. 3a, of samples with the adsorbed water layer, indicate a lower infrared reflectance than is actually the case. In general, the reflectance drops as temperature increases, as expected, however the total absolute change is about 5% at 300 °C.

Determining the hemispherical total thermal emittance requires infrared reflectance measurements over all angles and wavelengths. As these measurements are challenging using readily available equipment, the effectiveness of selective surfaces has been traditionally quantified by a single absorptance or reflectance spectrum, taken at room temperature. A recent work reported a procedure to obtain measurements of average solar absorptance and hemispherical thermal emittance of solar absorbers at operating temperatures25. Rather than performing this measurement, we instead determined device performance by measuring the stagnation temperature under solar insolation in field tests in Pasadena, CA. We placed the sample in a 11″ × 11″ vacuum chamber with a glass lid that was in turn placed outside and angled toward the sun, as shown in Fig. 4a,b. We adjusted the angle to ~55° such that the absorber sample was normal to the incoming sunlight. The sample temperature was measured with a type-K thermocouple secured to the surface with either Kapton tape or thermal epoxy. A second thermocouple was also taped to the chamber wall to determine the local temperature of the heat sink. We limited conductive and radiative heat losses by supporting the sample using low thermal conductivity aerogel foam on a radiation shield. The radiation shield was comprised of 10 dual-sided aluminum mirrors separated by low thermal conductivity ceramic washers. The vacuum chamber was pumped continuously to eliminate convective losses and air conductive losses. The chamber was initially pumped to below 1 × 10−5 Torr, but as the chamber warmed in the sun, outgassing occurred, leading to a maximum pressure of around 1 × 10−4 Torr.

The chamber was positioned to face south and was first exposed to the sun around 9:30am to warm up. Around 11:00am and then again around 12:00 pm, the chamber was positioned to face normal to the sun to maximize absorber temperature. At 1:00 pm after the temperature had plateaued and reached its maximum, the chamber was covered. Measured on Dec. 20, 2016, the absorber temperature peaked at 225 °C.

We also measured the stagnation temperature under insolation from an AM1.5 G solar simulator, under which the peak temperature reached 201.7 °C. Under the same conditions, a commercial state-of-the-art selective absorber reached a peak temperature of 223.1 °C, indicating that our unoptimized sample already achieved performance that is on par with state-of-the-art surfaces.

To determine sample stability, we repeated 6 temperature cycles (4 under the sun and 2 under the AM1.5 G solar simulator) over the course of 20 days, and the surface temperature was measured to be 199 °C or higher in all cases. Shown in Fig. 3a, the solar testing and consequent temperature cycling does cause noticeable changes in reflectance in the UV and in the IR, due to changes in layer morphology at high temperature. However, the average solar absorptance, calculated to be 74% after solar insolation, and the average thermal emittance are largely stable, which explains why real-world temperature performance over the 6 independent tests is consistent.

While the performance of our fabricated selective surface compares favorably with that of a state-of-the-art surface, our surface’s stagnation temperature is still considerably below 350 °C, which we predicted from its simulated optical properties. After analyzing our samples, we found this discrepancy could be explained by two reasons. First, the actual layer thicknesses deviated from the target thicknesses, resulting in larger optical reflections than expected. Second, the films of CaF2 were porous and did not provide a smooth, homogeneous surface on which the subsequent Ge films could grow. To further improve performance, primarily by improving solar absorptance, optimization of porosity and layer thickness of the CaF2 films is necessary. It has been shown that thermally evaporated CaF2 films can be grown for optical coatings with high precision26. Moreover, ion-assisted deposition of CaF2 has been shown to produce layers of smooth, dense films with the refractive index of bulk CaF2, necessary for designing absorbers with predictable optical properties27. By optimizing these two factors, we predict our surface should achieve a stagnation temperature exceeding 300 °C, with a solar absorptance of around 85%. Such a solar absorptance would be competitive with existing selective surfaces, while the low thermal emittance of our surface would lead to a substantially improved stagnation temperature that would allow unconcentrated sunlight to be used for mid-temperature applications that are presently only achievable using geometric concentrators (see Supporting Information)11. In addition, our selective absorber could significantly decrease the area required for rooftop solar thermal systems, thereby facilitating their adoption.

## Conclusion

In summary, we have designed and fabricated a semiconductor based selective solar absorber that exploits the sharp absorption transition of semiconductors at the bandgap energy to achieve high visible absorption yet low infrared emission. In field tests, we obtain peak temperatures consistently exceeding 200 °C, a value comparable to the performance of state-of-the-art surfaces. Straightforward optimization of layer thicknesses and deposition conditions indicate the peak temperature could be increased to 300 °C. Semiconductor-dielectric based selective surfaces can play an important role in expanding the application of unconcentrated solar thermal systems for mid-temperature applications.

## Methods

FTIR measurements were taken on a ThermoScientific FTIR in reflectance mode with a gold reference mirror and a (deuterated triglycine sulfate) DTGS detector from 1.4 μm to 25 μm. For the variable temperature measurement a Linkham FTIR 600 temperature stage with a KBr window and a confocal microscope was used with an MCT detector for wavelengths from 1.4 μm to 15.4 μm. UV-Vis measurements were taken on a Varian Cary5000 UV-Vis Spectrometer with integrating sphere to measure reflectance for 250 nm to 1.8 μm.

The transfer matrix method was used to calculate the reflectance and transmittance. To optimize the structure a needles method was implemented with third party software, OpenFilters28.

The films were deposited by electron beam deposition by LGA Thin Films, Inc.

### Data Availability

The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

1. 1.

Kaempener, R. Solar heat for industrial processes. IEA-ETSAP and IRENA Technology Brief E21 (2015).

2. 2.

Lim, X. How heat from the sun can keep us all cool. Nature 542, 23–24 (2017).

3. 3.

Kraemer, D. et al. High-performance flat-panel solar thermoelectric generators with high thermal concentration. Nat. Mater. 10, 532–538 (2011).

4. 4.

Kraemer, D. et al. Concentrating solar thermoelectric generators with a peak efficiency of 7.4%. Nat. Energy 1, 16153 (2016).

5. 5.

Qiblawey, H. M. & Banat, F. Solar thermal desalination technologies. Desalination 220, 633–644 (2008).

6. 6.

Tabor, H. Selective radiation. I. wavelength discrimination: A new approach to the harnessing of solar energy. Bull. Res. Council Isr. 5A, 119 (1956).

7. 7.

McDonald, G. E. Spectral reflectance properties of black chrome for use as a solar selective coating. Sol. Energy 17, 119–122 (1975).

8. 8.

Yin, Y., Pan, Y., Hang, L. X., McKenzie, D. R. & Bilek, M. M. M. Direct current reactive sputtering cr–cr2o3 cermet solar selective surfaces for solar hot water applications. Thin Solid Films 517, 1601–1606 (2009).

9. 9.

Tang, L., Cao, F., Li, Y., Bao, J. & Ren, Z. High performance mid-temperature selective absorber based on titanium oxides cermet deposited by direct current reactive sputtering of a single titanium target. J. Appl. Phys. 119, 045102 (2016).

10. 10.

Cao, F. et al. High-performance spectrally-selective solar absorber based on yttria-stabilized zirconia cermet with high-temperature stability. Energy Environ. Sci (2015).

11. 11.

Chou, J. B. et al. Enabling ideal selective solar absorption with 2d metallic dielectric photonic crystals. Adv. Mater. 26, 8041–8045 (2014).

12. 12.

Rephaeli, E. & Fan, S. Tungsten black absorber for solar light with wide angular operation range. Appl. Phys. Lett. 92 (2008).

13. 13.

Li, P. et al. Large-scale nanophotonic solar selective absorbers for high-efficiency solar thermal energy conversion. Adv. Mater. 4585–4591 (2015).

14. 14.

Barshilia, H. C., Selvakumar, N., Vignesh, G., Rajam, K. S. & Biswas, A. Optical properties and thermal stability of pulsed-sputter-deposited alxoy/al/alxoy multilayer absorber coatings. Sol. Energy Mater. Sol. Cells 93, 315–323 (2009).

15. 15.

Ackley, D. E. & Tauc, J. Silicon films as selective absorbers for solar energy conversion. Appl. Opt. 16, 2806–2809 (1977).

16. 16.

Booth, D. C., Allred, D. D. & Seraphin, B. O. Stabilized cvd amorphous silicon for high-temperature photothermal solar-energy conversion. Sol. Energy Mater. 2, 107–124 (1979).

17. 17.

Bermel, P. et al. Design and global optimization of high-efficiency thermophotovoltaic systems. Opt. Express 18, A314–A334 (2010).

18. 18.

Moon, J. et al. High performance multi-scaled nanostructured spectrally selective coating for concentrating solar power. Nano Energy 8, 238–246 (2014).

19. 19.

Palik, E. D. Handbook of Optical Constants of Solids vol. 1–3 (Academic Press, San Diego, 1985).

20. 20.

Goldschmidt, D. Amorphous germanium as a medium temperature solar selective absorber. Thin Solid Films 90, 139–143 (1982).

21. 21.

Edelman, F., Komem, Y., Bendayan, M. & Beserman, R. On the crystallization of amorphous germanium films. Appl. Surf. Sci. 70–71, Part 2, 727–730 (1993).

22. 22.

Tomlin, S. G., Khawaja, E. & Thutupalli, G. K. M. The optical properties of amorphous and crystalline germanium. Journal of Physics C: Solid State Physics 9, 4335 (1976).

23. 23.

Modest, M. F. Radiative Heat Transfer (Third Edition) (Academic Press, Boston, 2013).

24. 24.

NIST Chemistry WebBook, NIST Standard Reference Database Number 69, eds P. J. Linstrom and W. G. Mallard, chap. Infrared Spectrum (1969).

25. 25.

Kraemer, D., McEnaney, K., Cao, F., Ren, Z. & Chen, G. Accurate determination of the total hemispherical emittance and solar absorptance of opaque surfaces at elevated temperatures. Sol. Energy Mater. Sol. Cells 132, 640–649 (2015).

26. 26.

Muallem, M., Palatnik, A., Nessim, G. D. & Tischler, Y. R. Room temperature fabrication of dielectric bragg reflectors composed of a caf2/zns multilayered coating. ACS Appl. Mater. Interfaces 7, 474–481 (2015).

27. 27.

Gluck, N. S., Sankur, H. & Gunning, W. J. Ion-assisted laser deposition of caf2 thin films at low temperatures. J. Vac. Sci. Technol., A 7, 2983–2987 (1989).

28. 28.

Larouche, S. & Martinu, L. Openfilters: open-source software for the design, optimization, and synthesis of optical filters. Appl. Opt. 47, C219–C230 (2008).

## Acknowledgements

This work is part of the ‘Light-Material Interactions in Energy Conversion’ Energy Frontier Research Center funded by the US Department of Energy, Office of Science, Office of Basic Energy Sciences under Award Number DE-SC0001293. The authors thank Junlong Kou for assistance with the vacuum chamber, Prof. George Rossman for FTIR assistance, Carol Garland for the transmission electron microscopy work, and the Molecular Materials Research Center of the Beckman Institute at Caltech for the UV-Vis measurements. The authors also thank Prof. Harry Atwater for helpful discussions.

## Author information

### Affiliations

1. #### Division of Engineering and Applied Science, California Institute of Technology, Pasadena, California, 91125, United States

• Nathan H. Thomas
•  & Austin J. Minnich
2. #### Ginzton Laboratory, Department of Electrical Engineering, Stanford University, Stanford, California, 94305, United States

• Zhen Chen
•  & Shanhui Fan

• Zhen Chen

### Contributions

N.T., Z.C., S.F., and A.M. wrote this manuscript. All authors reviewed the manuscript.

### Competing Interests

The authors declare that they have no competing interests.

### Corresponding author

Correspondence to Austin J. Minnich.


text:
# if f(x)=2x-3 and fg(x)=2x+1,find g(x)

Luca B. | Certified Educator

calendarEducator since 2011

starTop subjects are Math, Science, and Business

You should notice that the composition of the functions f and g is a linear function.

You need to remember how to compose two functions such that:

`(fog)(x) = f(g(x))`

Since `f(x) = 2x - 3` , you should substitute g(x) for x such that:

`f(g(x)) = 2g(x) - 3`

The problem provides the information that `f(g(x)) = 2x+1` , hence, you should set the equations 2g(x) - 3 and 2x+1 equal such that:

`2g(x) - 3 = 2x + 1 =gt 2g(x) = 2x + 1 + 3`

`2g(x) = 2x + 4`

Dividing by 2 yields:

`g(x) = x + 2`

Hence, evaluating the function g(x) under the given conditions yields `g(x) = x + 2` .

check Approved by eNotes Editorial

dodafone | Student

first we see that g(x) should be a linear polynomial as only then fg(x) will come out to be linear

let g(x)=ax + b

fg(x)=2(ax +b) -3

=x(2a) +(2b-3) which is given equal to 2x +1

on comparing we get
2a=2        a=1

2b-3=1     b=2

g(x)=x+2

check Approved by eNotes Editorial

format: plain


text:
# product $\sigma$-measurable function and measurability in one component

I'm struggling with the proof for this:

Let $(X,\mathcal{X})$ and $(Y,\mathcal{Y})$ be two measurable spaces and recall the product $\sigma$-field $\mathcal{X}\otimes \mathcal{Y}$. Let $f:X\times Y\to \mathbb{R}$ be $\mathcal{X}\otimes \mathcal{Y}$-measurable function. Show that for all $x\in X$ the $f_x:Y\to \mathbb{R},f_x(y)=f(x,y)$ is $\mathcal{Y}$-measurable

My attempt, the preimage of $f_x$ is the set $M_x=\{y\in Y:f(x,y)\in X\times Y\}$, if we have shown that $M_x\in \mathcal{Y}$ then we are done, since the image of $f_x$ is equal to $f(x,y)$ which is in the product $\sigma$-Algebra.

My problem is for me it seems, that the Statement $M_x\in \mathcal{Y}$ is already coming from the Definition of $\mathcal{Y}$ since $\{y\in Y\}\in \sigma(Y)$.

It suffices to show that for every $A \in \mathcal{X}\otimes \mathcal{Y}$ the set $A_x = \{y \in Y: (x,y) \in A \}$ is in $\mathcal{Y}$. And for this it suffices to show that the class $\mathcal{E}$ of all $A \in \mathcal{X}\otimes \mathcal{Y}$ for which this claim holds is a sigma-algebra that contains the measurable rectangles $B \times C$ with $B \in \mathcal{X}$, $C \in \mathcal{Y}$. It's clear that $\mathcal{E}$ contains the measurable rectangles. To see that it's a sigma-albegra note that the $(A_x)^c = (A^c)_x$ and similarly for countable unions.


text:
How can I switch from Single Image to Image Sequence in Compositor network, with a script?

I have this piece of Python code:

import bpy
import os

# switch on nodes
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree

# Clear default nodes
for node in tree.nodes:
tree.nodes.remove(node)

# Create input image node
image_node = tree.nodes.new(type='CompositorNodeImage')
file_path = "C:\\DEV\\testSequence.1114.exr"
image_node.frame_duration = 200
image_node.frame_start = 1114
image_node.frame_offset = 1114
image_node.location = 0,0

This script makes a node in the compositor tree and loads the file in C:/DEV/testSequence.1114.exr; however, instead of 'Single Image', I want to switch to 'Image Sequence'. how can do this in script?

image_node.image.source = 'SEQUENCE'


text:
# Particle wave function

hubble_bubble
Does anyone have a calculation that can calculate a particle wave function over 1 Planck time interval?


text:
# Partially defined boolean function

Consider boolean function $$f(x_{1}, x_{2}, \dots, x_{n})$$. The value of $$f$$ is defined on some set of inputs, and some inputs are undefined (let us label undefined value with $$?$$). It is possible to set $$f$$‘s value on some inputs, no matter if they were initially defined.

The problem is to set some of the inputs such that:

• all initially undefined inputs become defined (i. e. no $$?$$ in function truth table);
• $$f$$ is monotone in the common sense.

The optimization part is to use the minimum possible assignments. How can one find an optimal way in the time $$\mathcal{O} \left( p(n) \left( 2^{n} \right)^{2} \right)$$, where $$p(n)$$ is polynomial?


text:
Two workers

One worker needs 40 hours to do a job, and the second would do it in 30 hours. They worked together for several hours, then the second was recalled, and the first completed the job itself in 5 hours. How many hours did they work together, and how much did each of them do?

x =  15 h
a =  0.5
b =  0.5

Step-by-step explanation:

$a=\frac{x+5}{40}=\frac{15+5}{40}=\frac{1}{2}=0.5$
$b=\frac{x}{30}=\frac{15}{30}=\frac{1}{2}=0.5$

Did you find an error or inaccuracy? Feel free to write us. Thank you!

Tips to related online calculators
Need help to calculate sum, simplify or multiply fractions? Try our fraction calculator.
Do you have a linear equation or system of equations and looking for its solution? Or do you have a quadratic equation?
Do you want to convert time units like minutes to seconds?

Related math problems and questions:

• Two workers
The first worker would himself completed the work in 8 hours, the other in 6 hours. After two hours of joint work, the worker left the first worker to a doctor, and others completed the work himself. How many hours worked the other worker himself?
• Two workers
The first worker completed the task by himself in 9 hours, the second in 15 hours. After two hours of joint work left first worker to a doctor and the second finished the job himself. How many hours worked second worker himself?
• Trucks
Truck take you the some amount of clay in 30 hours. Second truck in 40 hours. Trucks carted the clay away some time together then the second truck broke down and the first one completed the job in five hours. What time worked together?
• Work
The first worker would need less than 4 hours to complete the task than the other worker. In fact, both workers worked for two hours together, then the first worker did the remaining work himself. In what proportion should the remuneration of the workers
• Workers
Two workers A and B, will be done work together for 15 days. They worked together for 13.5 days. Then A worker became ill, and worker B finish the job alone for 7.5 days. If every worker was working alone, how many days took whole work for worker A and B?
• Workers 2
Worker dug the trench for 7 hours, another worker for 10 hours. They recruited to work even one worker more. Digging should be done for 2 hours. For how long would dig third worker alone?
• Gas pipeline
Worker Molnár excavated the gas pipeline in 15 hours, worker Lakatoš in 12 hours and worker Soukup in 10 hours. After how many hours of joint work will the excavation be completed?
• Workers
Two workers would fulfill a certain task when working together for 5 days, the first if he worked himself done work in 13 days. How many days will do the whole job a second worker?
• Parquet floor
Three workers laid the parquet floor for 2.301 hour. The first one would do this work alone 7 hours, the second in 6 hours. For how many hours would fulfill this work the third worker if he worked alone?
• Two workers
Two workers work together and perform the job in 12 hours. If one has done half the work and then the second worker next half of the work it will take 25 hours. How long would it take job them separately?


text:
name - Maple Help

Names

Description

 • A name in its simplest form is a letter followed by zero or more letters, digits, underscore characters (_) and question marks (?), with lowercase and uppercase letters distinct.  The maximum length of a name is system dependent. On 32-bit platforms, it is 268,435,439 characters; on 64-bit platforms, it is 34,359,738,335 characters.
 • There are two types of names: indexed names and symbols (non-indexed names).
 • Any expression can be assigned to a name. If no value has been assigned to the name, then it stands for itself.
 • Names can be formed with the concatenation operator || or with the function cat. For more information, see the help page for cat.
 • A variable name beginning with _Env is considered an environment variable.
 • Names that start with an underscore (with the exception of _Env) are used as global variable names by Maple and are effectively reserved for use by library code. Do not use a symbol beginning with an underscore. In addition, the empty name  has various special uses in Maple and should not be assigned a value. Failure to follow these rules can lead to unexpected results.
 • Names containing a slash (/) are generally reserved for use by library code and should not be assigned a value unless explicitly recommended on a help page.
 • Names that end with a tilde (~) are used by Maple to denote variables with assumptions on them and therefore should also be avoided by users.
 • Names that start with a tilde are used by the Maple spreadsheet component.  The tilde can be followed by a sequence of alphanumeric, underscore, or dollar sign characters.
 • A name can also be formed by enclosing any sequence of characters in a pair of left single quotes ( ). For example: This is a name! := 1.
 • Any valid Maple name formed without using left single quotes is precisely the same as the name formed by surrounding the name with left single quotes.  Therefore, x and x both refer to the same name x. However, a keyword cannot be used as a name unless it is enclosed in left single quotes.
 • In some previous releases of Maple, names formed by using left single quotes were used as character strings instead of names. A common example was the string used as an error message, for example,  ERROR(the argument must be an integer). This use of names has been made obsolete by the addition of the string type in Maple.
 • A backslash (\) within a name is considered an escape character to introduce control characters.  For more information, see backslash.  To display a name that includes the \ character, you must use two consecutive backslash characters: \\.
 • Two successive left single quotes that appear after the opening of a name are parsed as a single left single quote.  Thus,  abcde yields abcde. Alternatively, a left single quote can be written within a name by preceding it with a backslash (\ ), for example, abc\de.
 • The type function understands the type names symbol and indexed, and the type name is defined to be either of symbol or indexed.
 • A symbol can be converted into a string by using convert(aSymbol, string). Likewise, a string can be converted into a symbol by using convert(aString, symbol). Alternatively, one can use convert(aString, name).


text:
## A gentle introduction to an integrated occupancy model that combines presence-only and detection/non-detection data, and how to fit it in JAGS

Species distribution models (SDMs) are useful tools in ecology and conservation biology. As the name implies, SDMs are used to estimate species presence or abundance across geographic space and through time. At their core, SDMs are a way to correlate environmental covariates–be they spatial, temporal, or both–to known locations of a species. Generally this is done through some form of regression analysis.

SDMs are being regularly improved, and one class of model I am very excited about is integrated SDMs. These models were developed, in part, to take advantage of the ever growing data sources that ecologists have access to (e.g., data from public participatory science, museum collections, and wildlife surveys, among others). What is great about integrated SDMs is that they allow you to combine these different types of species location data within the same statistical model. And because of this, integrated SDMs usually (not always) improve the predictive accuracy and precision of your model estimates. And while models that combine data sources are being used now more than ever, I would argue that they are still not seeing widespread use. So why is that?

In my opinion, the biggest hurdle that prevents the wide scale adoption of integrated SDMs is that the math associated to them can be complex and use non-standard likelihood functions that may need to be coded up from scratch. And to be honest, trying to understand that math is hard, especially as papers that introduce such models may need to skip some algebraic steps in the model formulation to save space! And while I am no expert in integrated SDMs, I wanted to take the time to dispel some of the confusion for one model I have been using in my own research, which is an integrated SDM that combines opportunistic presence-only data (e.g., data from public participatory science) with detection / non-detection data (e.g., data from camera traps, repeated bird counts, etc.).

In this post I am going to 1) walk through the model in Koshkina et al. (2017), 2) show how the model can be written out in JAGS, and 3) simulate some data and fit the model to show that it works. This post is long, so I have not included any of the simulation code here. Instead, you can find all of it, including the JAGS implementation of the model, on this GitHub repository. David Hope was also nice enough to implement this integrated model in Stan, and compared the parameter estimates from JAGS and Stan on their GitHub repository. So if you’re looking for a Stan implementation, look no further!

Here are some links to these three sections of the post in case you want to skip around.

## The model

The Koshkina et al. (2017) integrated SDM, which was based on the model in Dorazio (2014), uses an inhomogeneous Poisson process model for the latent state. A Poisson process is just a mathematical object (e.g., a square with an x and y axis) in which points are randomly located. An inhomogeneous Poisson process, however, means the density of points on this object depends on your location on the object. Ecologically, this means that there is some region in geographic space (e.g., the city of Chicago, Illinois) and the modeled species abundance in that region varies across space.

So, for our region, B, we have a set of locations that individuals of our species occupies $$s_1,...,s_n$$ and those locations are assumed to be a inhomogenous Poisson process. Thus, the limiting expected density of our species (number of individuals per unit area) can be described by the non-negative intensity function $$\lambda(s)$$. Taking this one step further, the abundance of our species in region B is a Poisson random variable with mean:

$\mu(B) = \int_B \lambda(s)ds$

which just means we take the integral across our landscape (i.e., slice up the landscape into tiny little bits, count all the individuals in each slice, and add that all together). It’s not difficult to make $$\lambda(s)$$ a function of environmental variables, you use the log link and add in an intercept and slope term for each covariate $$\boldsymbol{x}(s)$$. The fact that $$\boldsymbol{x}(s)$$ is bold means that there are a vector of covariates for each location, and the first element of $$\boldsymbol{x}(s)$$ should be a 1 so that the intercept is always included. For example, if you have 3 covariates $$\boldsymbol{x}(s)$$ would actually have a length of 4. Thus, for i in 1,…,I covariates

$\text{log}(\lambda(s)) = \boldsymbol{\beta}\boldsymbol{x}(s)^\intercal = \beta_1 \times x(s)_1 +\cdots+ \beta_I x(s)_I$

The abundance model across the whole study area is then

$N(B) \sim \text{Poisson}(\mu(B))$

Some other important things to note here is that we can also model the number of individuals within any subregion of B, which also has a Poisson distribution. So, if you have a set of non-overlapping subregions where $$r_1 \cup \cdots \cup r_k = B$$ (this means the union of all the subregions equals B) then $$N(r_k) \sim \text{Poisson}(\mu(r_k))$$.

I bring up this subregion modeling for two reasons. First, when we write the model in JAGS we are going to have to discretize the landscape to approximate the integral in the latent state model. So, we may as well start thinking about what breaking up the region into little pieces looks like now. Second, creating subregions makes it more intuitive to think about modeling occupancy instead of abundance. Why? Because if we set out to study a species in an area, chances are we know a priori that the probability at least one individual occupies B is 1, but there may be variation in the different subregions. To model occupancy we need to convert $$\mu(r_k)$$ into a probability, which can be done with the inverse complimentary log-log link (inverse cloglog)

$\psi_k = Pr(N(r_k) > 0) = (1 - \text{exp}({-\mu(r_k)}))$

where $$\psi_k$$ is the probability of occupancy for subregion $$r_k$$. This could then be modeled as a Bernoulli trial where $$z_k = 1$$ if the species occupies subregion $$r_k$$.

$z_k \sim \text{Bernoulli}(\psi_k)$

And that is the latent state model! So far this should mostly remind you of Poisson regression (except for that little jaunt into occupancy modeling). The big exception, however, is that integral across space that we need to contend with in JAGS, and we’ll get there soon enough.

Because we are fitting a Bayesian model, we get to take a small departure from the way the data model is described in Koshkina et al. (2017). In their model explanation, they initially combined the presence-only data detectability and probability of detection from the detection/non-detection data into one term. We, however, will keep them separate the whole time. The detection / non-detection data model is the easier of the two, because it’s equivalent to the detection process of a standard occupancy model, so let’s start there.

Remember those $$r_k$$ subregions of B that are non-overlapping parts of the study area? Let’s assume we do not sample every point in B and instead sample some subset of the subregions. For j in 1,…,J subregions sampled (hereafter sites) let $$r_k[j]$$ represent the jth site sampled ($$k[j]$$ means there is nested indexing). We then have for w in 1,..,W sampling occasions at these sites, which results in a J by W binary observation matrix $$y_{j,w}$$. If we detected the species at site j on sampling occasion w, $$y_{j,w} = 1$$, otherwise it is zero (assuming equal sampling at all sites). The probability of detecting the species given their presence $$\rho_{j,w}$$ can then be estimated as:

$y_{j,w}|z_{k[j]} \sim \text{Bernoulli}(\rho_{j,w} \times z_{k[j]})$

and $$\rho_{j,w}$$ can be made a function of covariates using the logit link, which could vary across sites or sampling occasions. For q in 1,…,Q covariates this is the linear predictor of the detection / non-detection data model is

$\text{logit}(\rho_{j,w}) = \boldsymbol{a}\boldsymbol{v}_{j,w}^\intercal = a_1 \times v_{1,j,w} + \cdots + a_Q \times v_{Q,j,w}$

where a is a vector of regression coefficients (intercept and slope terms) and V is a Q by J by W array where the first element of $$\boldsymbol{v}_{j,w} = 1$$ to account for the model intercept.

Modeling the opportunistic presence-only data is a little more complex because we assume the presence-only data are a thinned Poisson process. What that means is that we multiply $$\lambda(s)$$ by some estimated probability (i.e., the presence-only detectabilty), which “thins” it. This thinning is helpful because we expect that the opportunistic presence-only data has some bias in where it was collected becuase there may not be a rigorous sampling design. As such, some areas may be oversampled while other areas are undersampled and we do not want that to bias our species abundance estimate.

The probability of being detected in the presence-only data, b(s), can be made a function of g in 1,..,G covariates such that

$\text{logit}(b(s)) = \boldsymbol{c}\boldsymbol{h}(s)^\intercal = c_1 \times h(s)_1 + \cdots + c_G \times h(s)_G$

Where $$\boldsymbol(c)$$ is a vector that contains the intercept and slope terms while $$\boldsymbol(h)(s)$$ is a vector of G covariates, where the first element is 1 to account for the intercept Before we move on there is one really important thing to bring up. For this model to be identifiable, $$\boldsymbol{x}$$(s) must have one unique covariate that $$\boldsymbol{h}(s)$$ does not have, and $$\boldsymbol{h}(s)$$ must have one unique covariate $$\boldsymbol{x}(s)$$ does not have. If you put the exact same covariates on the latent state and the presence-only data model, your model will not converge. Keep that in mind while you consider hypotheses for your own data!

As this is a thinned Poisson process, the the expected number of presence only locations throughout B is the product of $$\lambda(s)$$ and$$b(s)$$, assuming that the species was detected at m locations $$s_1,\cdots,s_m$$ where m < n. In other words, we make the assumption that the number of individuals detected in the presence-only data is less than the total number of individuals of that species on the landscape. Thus,

$\pi(B) = \int_B \lambda(s)b(s)ds$

Following Dorazio (2014) the likelihood of the presence only data is

$\begin{eqnarray} L(\boldsymbol{\beta},\boldsymbol{c}) &=& \text{exp} \big(- \int_B\lambda(s)b(s)ds \big) \prod_{i=1}^m\lambda(s_i)b(s_i) \nonumber \\ &=& \text{exp}\Big(-\int_B\frac{\text{exp}(\boldsymbol{\beta}\boldsymbol{x}(s)^\intercal + \boldsymbol{c}\boldsymbol{h}(s)^\intercal )}{1 + \text{exp}(\boldsymbol{c}\boldsymbol{h}(s)^\intercal )}ds\Big) \prod_{i=1}^m\frac{\text{exp}(\boldsymbol{\beta}\boldsymbol{x}(s_i)^\intercal + \boldsymbol{c}\boldsymbol{h}(s_i)^\intercal )}{1 + \text{exp}(\boldsymbol{c}\boldsymbol{h}(s_i)^\intercal )} \nonumber \end{eqnarray}$

And if I had to guess, this is where people can get lost with this model! This likelihood is not necessarily that intuitive so it makes it difficult to know how to code it in your Bayesian programming language of choice. But if we go through it piece by piece, the math here is not all that scary.

To let you know we are headed, this equation is dividing the thinned Poisson process at all of the presence only data points by the thinned Poisson process over the entire region B (i.e., the integral). Yet, there is no fraction here, so how did I arrive at this conclusion? Whenever you see negative signs thrown around with exponential terms or natural logarithms, there could be some divison happening on the log scale. For example, if you remember that exp(log(x)) = x, here are two different ways to write the equation $$10 / 2 = 5$$

$\begin{eqnarray} 10 / 2 &=& 5 \nonumber \\ \text{exp}\big(\text{log}(10) - \text{log}(2)\big) &=& 5 \nonumber \\ \text{exp}(-\text{log}(2)) \times 10 &=& 5 \nonumber \end{eqnarray}$

This is also really easy to check in R as well

10 / 2
[1] 5

exp(log(10) - log(2))
[1] 5

exp(-log(2)) * 10
[1] 5

If you look closely at that third example, its not too hard to recognize it as a simplified version of $$\text{exp} \big(- \int_B\lambda(s)b(s)ds \big) \prod_{i=1}^m\lambda(s_i)b(s_i)$$. So, because exp(-x) * y == y/x, the first term term in our likelihood is the denominator and represents the thinned Poisson process over the region B, while the second term in our likelihood is the numerator that represents the thinned Poisson process over the m presence-only locations. With that out of the way, we just need to figure out what the likelihood is doing with the regression coefficients from the latent state model ($$\beta$$) and the regression coefficients associated to the presence-only thinning probability ($$\boldsymbol{c}$$).

For those familiar with logistic regression, you can hopefully notice that the likelihood

$\text{exp}\Big(-\int_B\frac{\text{exp}(\boldsymbol{\beta}\boldsymbol{x}(s)^\intercal + \boldsymbol{c}\boldsymbol{h}(s)^\intercal )}{1 + \text{exp}(\boldsymbol{c}\boldsymbol{h}(s)^\intercal )}ds\Big) \prod_{i=1}^m\frac{\text{exp}(\boldsymbol{\beta}\boldsymbol{x}(s_i)^\intercal + \boldsymbol{c}\boldsymbol{h}(s_i)^\intercal )}{1 + \text{exp}(\boldsymbol{c}\boldsymbol{h}(s_i)^\intercal )}$

made a slight modification to the inverse logit link, $$\text{logit}^{-1}(x) = \frac{\text{exp}(x)}{1 + \text{exp}(x)}$$. The inverse logit link is important to know, especially if you do any amount of occupancy modeling, because it converts logit-scale coefficients back to the probability scale. It looks like this likelihood function added the log-scale coefficients from the latent state model ($$\boldsymbol{\beta}$$) into the numerator of the inverse logit link, while the logit-scale coefficients ($$\boldsymbol{c}$$) from the thinning process are in the numerator and the denominator. To see what this means, let’s explore how this modified inverse logit link function works in R, assuming that $$\lambda(s) = 20$$ and $$b(s) = 0.75$$.

# The parameters
lambda <- 20
b <- 0.75

# Transform these variables to their
#  respective scales.

log_lambda <- log(lambda)

logit_b <- log(b/(1 - b))

# Modified inverse logit
answer <- exp(log_lambda + logit_b) / (1 + exp(logit_b))

# compare that to lambda * b
#  both == 15
[1] 15 15

Therefore, this modified inverse logit is the inverse link function for the regression coefficients associated to the thinned Poisson process $$\lambda(s)b(s)$$! Knowing that, we could take the presence-only data likelihood and abstract it out a little further:

$L(\boldsymbol{\beta},\boldsymbol{c}) = \frac{\prod_{i=1}^m PO^{-1}(\boldsymbol{\beta}\boldsymbol{x}(s_i)^\intercal, \boldsymbol{c}\boldsymbol{h}(s_i)^\intercal)}{\text{exp}(\int_B PO^{-1}(\boldsymbol{\beta}\boldsymbol{x}(s)^\intercal, \boldsymbol{c}\boldsymbol{h}(s)^\intercal ds))}$

where

$PO^{-1}(x,y) = \frac{\text{exp}(x + y)}{1 + \text{exp}(y)}$

And that is the breakdown of the likelihood of the presence-only data. Hopefully this additional explanation here makes the model a bit easier to understand. In summary, this model has three linear predictors. One for the latent state that is partially informed by the presence-only data and detection/non-detection data, one to account for the bias in the opportunistic presence-only data, and one to account for false absences in the detection / non-detection data.

## How to code up the model in JAGS

For this example I’m going to focus on modeling species occupancy instead of abundance, though the model can easily be modified to estimate abundance by changing the likelihood function of the latent state model.

To code up this model in JAGS there are two things we need to overcome.

1. Approximating the integrals in the model with a Riemann sum.
2. Incorporate the non-standard likelihood of the presence-only data model with the Bernoulli “ones trick”.

The first step is not difficult. For the region B, all we need to do is break it up into a “sufficiently fine grid” (Dorazio 2014) and evaluate the model in each grid cell.

What is sufficiently fine? I’ve seen some suggestions that you need at least 10000, but in reality the number of cells is going to depend on the landscape heterogeneity you are trying to capture and your data. For example, a small study region roughly the size of a city may not need 10000 grid cells. In my own research, I’ve had success splitting Chicago, IL, which is about 606 km2, into roughly 2500 500m2 grid cells (and the simulation below has around 4500 grid cells). So if you are trying to use this model on your own you may need to do some trial and error to determine what is an appropriate cell count is (i.e., fit the model with different grid cell sizes to see if it has an influence on the parameters in the latent state model).

Perhaps the trickiest part related to discretizing the region, however, means all of the data input into the model needs to be aggregated to the scale of the grid (i.e., the covariates and species data). In R, the raster::aggregate function will do most of that work for you. In the simulated example, I also created the function agg_pres() which aggregated species presence on the landscape to the appropriate grid size (which is in the script ./utilities/sim_utility.R here).

Now back to the model. Let npixel be the total number of grid cells on our landscape and cell_area be the log area of the gridded cell (we have to include a log offset term into the latent state linear predictor to account for the the gridding we did). The latent state model is then:

for(pixel in 1:npixel){
# latent state linear predictor
#
# x_s  = covariates for latent state
# beta = latent state regression coefficients
# cell_area = log area of grid cell
#
log(lambda[pixel]) <-inprod(x_s[pixel,1:I], beta[1:I]) + cell_area
# Species presence in a gridcell as a Bernoulli trial
z[pixel] ~ dbern(1 - exp(-lambda[pixel]))
}

Remember, however, that the presence-only data model needs to be evaluated across the entire landscape as well (i.e., the integral that is the denominator of the presence-only data model likelihood). Therefore, we should also calculate the thinning probability for each cell here too.

for(pixel in 1:npixel){
# latent state linear predictor
#
# x_s  = covariates for latent state
# beta = latent state model regression coefficients
# cell_area = log area of grid cell
#
log(lambda[pixel]) <-inprod(x_s[pixel,], beta) + cell_area
# Species presence in a gridcell as a Bernoulli trial
z[pixel] ~ dbern(1 - exp(-lambda[pixel]))
# presence only thinning prob linear predictor
#
# h_s = covariates for thinning probability
# cc  = presence-only data model regression coefficients
#
logit(b[pixel]) <-  inprod(h_s[pixel,] , cc)
}

And now we can start coding up the likelihood of the presence-only data model. While you can easily create your own likelihood functions in Nimble, it’s not quite as simple in JAGS. However, there are some workarounds, and my personal favorite is the Bernoulli “ones trick”.

To do this for the presence-only data model there are a two steps. First, code up the likelihood for each of the m presence-only data points. Second, input that likelihood for each data point into a Bernoulli trial and divide it by some large constant value to ensure the likelihood is between 0 and 1 such that ones[i] ~ dbern(likelihood[i]/CONSTANT), where ones is a vector of ones the same length as m. CONSTANT = 10000 is a good place to start. This little trick evaluates the likelihood of data point i given the current model parameters in the MCMC chain, which is exactly what we need.

Note, however, that the presence-only data model likelihood function presented in Koshkina et al. (2017) is for ALL the data points, and we need to evaluate the likelihood of each data point on its own. To do this, all we need to do is remove the product from the numerator because we are only looking at a single data point from the numerator and divide the denominator by m (i.e., the number of presence-only data points). If you recall that exp(log(x) - log(y)) = x/y we can write the presence-only likelihood in JAGS using nested indexing to map the m datapoints back to their respective grid cell. If I wanted to I could have coded up the presence-only data model inverse link function and applied it to the regression coefficients & covariates for each cell. However, we have already calculated lambda and b in the model so we can use them instead.

# The presence only data model.
#
# This part of the model uses
#  what we have calculated above (lambda
#  and b). The denominator of this likelihood
#  is a scalar so we can calculate it
#  outside of a for loop. Let's do that first,
#  which we are approximating as a Riemann sum.
#
po_denominator <- inprod(lambda[1:npixel], b[1:npixel] ) / m
#
# Loop through each presence-only datapoint
#  using Bernoulli one's trick. The numerator
#  is just the thinned poisson process for
#  the ith data point, and we use some
#  nested indexing to map the data to
#  it's associated grid cell.
for(po in 1:m){
ones[po] ~ dbern(
exp(
log(lambda[po_pixel[po]]*b[po_pixel[po]]) -
log(po_denominator)
) / CONSTANT
)
}

Here, po_pixel denotes the grid cell of the ith presence only data point.

Finally, the detection/non-detection data model is basically what you’d see in a standard occupancy model, but again uses nested indexing to map the sampled site to it’s respective grid cell. I’m making the assumption here that the W sampling occasions are i.i.d. random variables and so will model them as a binomial process such that

for(site in 1:nsite){
# detection/non-detection data model linear predictor
#
#  v = detection covariates for the entire region B
#  a = det/non-det data model regression coefficients
#
logit(rho[site]) <-inprod(v[pa_pixel[site], ],a)
# The number of detections for site is a binomial
#  process with Pr(rho[site]) | z = 1 with
#  W sampling occasions per site.
y[site] ~ dbin(
z[pa_pixel[site]] * rho[site],
W
)
}

Here is all of the model put together plus some non-informative priors for all the parameters and a derived parameter to track how many cells the species occupies.

model{
# Bayesian version of the Koshkina (2017) model.
#
# The latent-state model
for(pixel in 1:npixel){
# latent state linear predictor
#
# x_s  = covariates for latent state
# beta = latent state model regression coefficients
# cell_area = log area of grid cell
#
log(lambda[pixel]) <-inprod(x_s[pixel,], beta) + cell_area
# Species presence in a gridcell as a Bernoulli trial
z[pixel] ~ dbern(1 - exp(-lambda[pixel]))
# presence only thinning prob linear predictor
#
# h_s = covariates for thinning probability
# cc  = presence-only data model regression coefficients
#
logit(b[pixel]) <-  inprod(h_s[pixel,] , cc)
}
# The presence only data model.
#
# This part of the model just uses the
#  what we have calculated above (lambda
#  and b). The denominator of this likelihood
#  is actually a scalar so we can calculate it
#  outside of a for loop. Let's do that first.
#
# The presence_only data model denominator, which
#  is the thinned poisson process across the
#  whole region (divided by the total number of
#  data points because it has to be
#  evaluated for each data point).
po_denominator <- inprod(lambda[1:npixel], b[1:npixel] ) / m
#
# Loop through each presence-only datapoint
#  using Bernoulli one's trick. The numerator
#  is just the thinned poisson process for
#  the ith data point.
for(po in 1:m){
ones[po] ~ dbern(
exp(
log(lambda[po_pixel[po]]*b[po_pixel[po]]) -
log(po_denominator)
) / CONSTANT
)
}
#
# Detection / non-detection data model
for(site in 1:nsite){
# detection/non-detection data model linear predictor
#
#  v = detection covariates for the entire region B
#  a = det/non-det data model regression coefficients
#
logit(rho[site]) <-inprod(v[pa_pixel[site], ],a)
# The number of detections for site is a binomial
#  process with Pr(rho[site]) | z = 1 with
#  W sampling occasions per site.
y[site] ~ dbin(
z[pa_pixel[site]] * rho[site],
W
)
}
#
# Priors for latent state model
for(latent in 1:nlatent){
beta[latent] ~ dnorm(0, 0.01)
}
# Priors for presence-only data model
for(po in 1:npar_po){
cc[po] ~ dlogis(0, 1)
}
# Priors for det/non-det data model
for(pa in 1:npar_pa){
a[pa] ~ dlogis(0, 1)
}
# Derived parameter, the number of cells occupied
zsum <- sum(z)
}

## Simulating some data

I’m not going to share all of the simulation code here as it is hundreds of lines long. However, I do want to demonstrate that this model works, and works better than a standard occupancy model. To look at all the simulation code and try it for yourself, visit this repository here. You just need to run through simulate_poisson_process.R to simulate the data and fit the models.

If you are not interested in that code, here are the steps I took to simulate the data:

1. Create the study region and give it a spatially autocorrelated environmental covariate.
2. Generate latent species abundance on the landscape, which is correlated to the environmental covariate from step 1.
3. Create a secondary environmental covariate that is correlated to the bias in the presence-only data.
4. Generate presence-only data, which samples from the latent species abundance in step 2 based on the environmental covariate in step 3 (i.e., some individuals are observed in the presence-only dataset).
5. Aggregate covariates and species presence on the landscape down to a coarser resolution for modeling purposes.
6. Place some sites to sample your detection / non-detection data across the landscape at the same scale as this new coarser resolution.
7. If the species is present at these sites, sample their presence with imperfect detection.

Following this I fit the simulated data to two models. The first model had the same latent-state and detection/non-detection data model, but I removed the presence-only data model so that it is just a standard occupancy model with a cloglog link. The second model is the integrated model from above fit to all of the data.

For this simulation, I assumed there was a single covariate that influenced the latent state and one covariate that influenced the bias of the presence-only data. For simplicity, I also assumed that imperfect detection at sampling sites did not vary (i.e., the data model for detection/non-detection data was intercept only). Some other general bookkeeping for this simulation:

1. One hundred sites were sampled for the detection / non-detection data.
2. The intercept and slope coefficients for the latent state were respectively 6 and 1.
3. The intercept and slope coefficients for the presence-only thinning probability were respectively -0.75 and 1.5.
4. The by-survey probability fo detecting an individual given their presence at a sample site was 0.3 (about -0.85 on the logit scale).

When comparing the outputs of the latent state estimates from the standard occupancy model that only used detection / non-detection data to the integrated occupancy model that also used presence-only data, it clear that the integrated model has greater accuracy and precision.

The horizontal lines in the plot above are the true parameter values I used to simulate the data..

Digging into the results from the rest of model, it’s also clear that the integrated model did a great job retrieving the parameters from the other linear predictors.

In order, beta represents the latent state terms, cc are the presence-only data model terms, and a was the intercept term from the detection/non-detection data model.

One last thing before I wrap this up. If you use this model yourself, you must remember to include the log-offset term in order to make model predictions. For example, if I wanted to make predictions across the environmental covariate that was related to the species latent occupancy state, the code would look something like (assuming you are working with the model objects from simulate_poisson_process.R:

# matrix for predictions.
#  intercept and slope.
for_pred <- cbind(1, seq(-2,2, 0.01))

# The log-offset I supplied to JAGS
my_log_offset <- my_data\$cell_area

# get mcmc samples for latent state terms
#  intmm = integrated mcmc samples
latent_parms <- intmm[,c("beta[1]", "beta[2]")]

# predictions on cloglog scale
my_preds <- latent_parms %*% t(for_pred) + my_log_offset

# inverse cloglog to convert to probability
my_preds <- 1 - exp(-exp(my_preds))

# get quantiles for plotting
my_preds <- apply(
my_preds,
2,
quantile,
probs = c(0.025,0.5,0.975)
)

plot(
my_preds[2,] ~ for_pred[,2],
type = "l",
lwd = 3,
ylim = c(0,1),
xlab = "Environmental covariate",
ylab = "Pr(Occupancy)",
las = 1,
bty = "l"
)
lines(my_preds[1,] ~ for_pred[,2],lty =2, lwd = 2)
lines(my_preds[3,] ~ for_pred[,2],lty =2, lwd = 2)

legend("topleft", c("Median estimate", "95% CI"), lty = c(1,2), lwd = c(3,2),
bty = "n", cex = 1.3)

And there you have it, a JAGS implementation of the Koshkina et al. (2017) model.


text:
# Electrodynamics problem

## Homework Statement

Circular plate radius R is uniformly charged and the charge of plate is Q. Find the electric field in arbitrary point perpendicular to the plate that passes through the center. Case $$R\rightarrow \infty$$ compared with a score of Gaussian theorem.

## Homework Equations

Gauss theorem

$$\int_S \vec{E}\cdot\vec{dS}=\frac{q}{\epsilon_0}$$

## The Attempt at a Solution

I calculate first part of assignment.

$$\vec{E}_A=\frac{1}{4\pi\epsilon_0}\int_S\frac{\sigma dS}{r^3}\vec{r}$$

$$dS=\rho d\rho d\varphi$$

$$r=\sqrt{\rho^2+z^2}$$

$$\vec{r}=z\vec{e}_z-\rho\vec{e}_{\rho}$$

and get

$$\vec{E}_A=\frac{\sigma}{2\epsilon_0}\frac{z}{|z|}(1-cos\alpha_0)$$

When $$R\rightarrow \infty$$ $$\alpha_0\rightarrow \frac{\pi}{2}$$

So when $$R\rightarrow \infty$$

$$\vec{E}_A=\frac{\sigma}{2\epsilon_0}sgnz \vec{e}_z$$

I don't know how can I do the second part with Gauss theorem? Thanks for your help!

## Answers and Replies

Related Advanced Physics Homework Help News on Phys.org
When R -> infinity, the plate -> something. What is it?

When R -> infinity, the plate -> something. What is it?
infinite plane?

Correct
And what does the Gauss theorem give for E of an uniformly charged infinite plane?