# Crop Production Regression Model - Understanding output

**URL:** <https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018>\
**Category:** Science, Research & Data\
**Tags:** crop-production\
**Created:** [May 20, 2020, 3:16pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018 "2020-05-20T15:16:54Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [May 20, 2020, 3:16pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/1 "2020-05-20T15:16:55Z")

</div>

Hello (again, sorry for all these questions),

I ran the Crop Production Regression Model twice, using two different LULC map:

- the 1st has 7 land-use classes and its resolution is 50mx50 (made in 2018 by the Japanese Space Agency)
- the 2nd one has more than 20 land-use classes and its resolution is 300mx300m (made in 2015 by ESA).

The study area is the same. I’m focusing on rice production, and I use the InVEST sample data to produce the **Landcover to Crop Table** and the **Fertilization rate table path**. I know that the 1st LULC shows more rice fields than the 2nd one.

Notwithstanding, I don’t understand the result table (here attached, showing both results). The **area (ha)** is 8 time larger with the 1st map, and that’s ok. I have the following questions:

- why the production observed of the 1st map is only 7 times larger than the second one
- what is the difference between production observed and modeled
- what is the unit of nutrients both observed and modeled (e.g. proteins)
- why I have some “modeled” values that are negative

Thank you,  
Marco[result\_table.csv](https://community.naturalcapitalalliance.org/uploads/short-url/hLFq79pSCI6FEbcCWu6bQdcabkY.csv) (2.7 KB)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [May 26, 2020, 10:49pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/2 "2020-05-26T22:49:33Z")

</div>

> - why the production observed of the 1st map is only 7 times larger than the second one

It’s hard to say for certain without taking a closer look at your inputs, but the very fact that there are big differences in your landcover codes being used would make me wonder. Are there differences in the areas being represented by each landcover code? Are there differences in how those landcover codes map to different crops?

> - what is the difference between production observed and modeled

Observed yields are taken from the Monfreda dataset. This is included in the InVEST sample data and is in the crop data folder provided as a model input. Modeled production is the actual modeled output based on your inputs, which is described here: [http://releases.naturalcapitalproject.org/invest-userguide/latest/crop\_production.html#id4](http://releases.naturalcapitalproject.org/invest-userguide/latest/crop_production.html#id4)

> - what is the unit of nutrients both observed and modeled (e.g. proteins)

There’s a description of the units in [http://releases.naturalcapitalproject.org/invest-userguide/latest/crop\_production.html#interpreting-results](http://releases.naturalcapitalproject.org/invest-userguide/latest/crop_production.html#interpreting-results). Please let us know if you have any more specific questions!

> - why I have some “modeled” values that are negative

I’d suggest taking a look at your inputs and also the Monfreda dataset in your study area and making sure that everything looks like it makes sense.

Hope this helps, and feel free to ping us back with any further questions!  
James

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [May 27, 2020, 3:45pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/3 "2020-05-27T15:45:50Z")

</div>

Hi @jdouglass,

thank you for your answers. However I still have some doubts:

> - why the production observed of the 1st map is only 7 times larger than the second one

It’s hard to say for certain without taking a closer look at your inputs, but the very fact that there are big differences in your landcover codes being used would make me wonder. Are there differences in the areas being represented by each landcover code? Are there differences in how those landcover codes map to different crops?

**There are no differences in the areas, however, each LULC map crops differently. In fact, the ESA’s one map 37 land use classes, why the Japanese Space Agency only 7**

what is the unit of nutrients both observed and modeled (e.g. proteins)  
There’s a description of the units in [http://releases.naturalcapitalproject.org/invest-userguide/latest/crop\_production.html#interpreting-results](http://releases.naturalcapitalproject.org/invest-userguide/latest/crop_production.html#interpreting-results). Please let us know if you have any more specific questions!

**So for example I would be able to tell the amount of proteins of a crop per pixel in metric tons per pixel per year?.**

why I have some “modeled” values that are negative  
I’d suggest taking a look at your inputs and also the Monfreda dataset in your study area and making sure that everything looks like it makes sense

\*\*I mean, it seems to me that everything is fine. I just used LULC maps and tabular data that I derived from the Monfreda dataset. Maybe there’s something that I should check again? I attach the inputs that I used to run the regression model (using the LULC produced by ESA) [crop\_table\_p.csv](https://community.naturalcapitalalliance.org/uploads/short-url/8Sr3WCu5jZ7I1lhPXZGvH7nBfss.csv) (27 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes) [lulc.tif](https://community.naturalcapitalalliance.org/uploads/short-url/bMF4nc6q0fiQDvi92D3BEuCTasV.tif) (152.4 KB) \*\*

Thank you so much for your help.

Marco

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 2, 2020, 10:44pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/4 "2020-06-02T22:44:44Z")

</div>

Hi Marco,

Sorry about the delay on this. I’ll respond to each of your questions as before.

> [@marco.guzzetti](#):
>
> There are no differences in the areas, however, each LULC map crops differently. In fact, the ESA’s one map 37 land use classes, why the Japanese Space Agency only 7

If there is no difference in the areas corresponding to the crop you’re modelling between these two LULC rasters, then the only other explanations would have to do with your input tables or spatial distributions of the pixels. Thanks for your ESA LULC, but could you attach your other LULC as well so I can take a closer look at what you’re seeing?

> [@marco.guzzetti](#):
>
> I mean, it seems to me that everything is fine. I just used LULC maps and tabular data that I derived from the Monfreda dataset. Maybe there’s something that I should check again? I attach the inputs that I used to run the regression model (using the LULC produced by ESA)

Thanks again for attaching your inputs. I’m sorry, I don’t think I fully understand your question here.

When I take a look at the crop model data for the `rice` crop compared with your LULC, I notice that there is a significant amount of your crop areas that are not represented by pixels in either the observed yield or the climate bin maps. In this screenshot, the red pixels represent the LULC pixel values for the `rice` crop (landcover code 20, based on your `crop_table_p.csv`) and the grey pixels are from `observed_yield/rice_yield_map.tif`. You can see that some of your study area there does not overlap the yield rasters, which may be causing some of the issues.

 ![Screen Shot 2020-06-02 at 3.41.12 PM](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/216daeb5c0b43b7e7bf1ac05090617c3536acbe3.png)

But again, I’d be really interested to see your inputs for the other landcover map and how they compares to these ESA-related inputs.

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 3, 2020, 1:42pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/5 "2020-06-03T13:42:06Z")

</div>

Dear @jdouglass,

thanks for coming back to me. Looking at your last image I understand that if the “observed\_yield” that can be found in the “model data” folder of this model, do not cover a study area, it creates problems (maybe because this is a coastal area and having a different resolution could created some problems - in that case how would you suggest to overcome this issue?)

Having said that, I’m also working on a land-locked provinces, and I’m receiving the same weird results that we discussed before. Thus, I attach here the inputs that I used to run the Regression model, using a lulc map from ESA and another one from the Japanese space agency (JAXA).

Here the description the the land cover classes:

- List item ESA - [http://maps.elie.ucl.ac.be/CCI/viewer/download/ESACCI-LC-QuickUserGuide-LC-Maps\_v2-0-7.pdf](http://maps.elie.ucl.ac.be/CCI/viewer/download/ESACCI-LC-QuickUserGuide-LC-Maps_v2-0-7.pdf)

- JAXA - [https://www.eorc.jaxa.jp/ALOS/en/lulc/lulc\_vnm\_2015to2018period.htm](https://www.eorc.jaxa.jp/ALOS/en/lulc/lulc_vnm_2015to2018period.htm)

Note: CRS is UTM zone 48N - EPSG:32748

Thank you so much.

Marco

[crop\_table\_p.csv](https://community.naturalcapitalalliance.org/uploads/short-url/8Sr3WCu5jZ7I1lhPXZGvH7nBfss.csv) (27 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes) [LULC\_ESA.tif](https://community.naturalcapitalalliance.org/uploads/short-url/eLZkOCd6JEBCLrZbh7T6Xml6Wl1.tif) (206.5 KB) [crop\_table\_p\_JAXA.csv](https://community.naturalcapitalalliance.org/uploads/short-url/xRqpKhTdd6yUKtz9r4oAE57glr6.csv) (26 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes) [crop\_table\_p.csv](https://community.naturalcapitalalliance.org/uploads/short-url/8Sr3WCu5jZ7I1lhPXZGvH7nBfss.csv) (27 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes) [LULC\_ESA.tif](https://community.naturalcapitalalliance.org/uploads/short-url/eLZkOCd6JEBCLrZbh7T6Xml6Wl1.tif) (206.5 KB)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 10, 2020, 1:03am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/6 "2020-06-10T01:03:31Z")

</div>

Hi Marco, I’m starting to dig into this problem, and I’m noticing a few things.

1. When viewing these two rasters in QGIS, they are definitely not covering the same area on the planet, so I’m not surprised that they would produce outputs that are different. See this screenshot for where they’re showing up:  
 ![Screen Shot 2020-06-09 at 5.54.26 PM](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/4b9f9791bef0f55e0154938c7b20766d53ce22eb.png)
2. Could you confirm which landcover raster is which? We have two that are attached to your previous posts: LULC\_ESA.tif and lulc.tif. Also, from your tables, one of these has a landcover code of 20 representing rice, and the other has a landcover code of 4 representing rice. HOWEVER, neither of these landcover rasters have any pixels with a landcover code of 4. Could you confirm:
  - Which raster is from the ESA and which raster is from JAXA?
  - Which landcover codes represent rice for each raster?

This’ll help to debug the issue.  
Thanks,  
James

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 10, 2020, 7:14am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/7 "2020-06-10T07:14:06Z")

</div>

Hi @jdouglass,

maybe I wasn’t clear, I apologize for that. The latest files that I sent you represents the southern and landlocked province

![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/485fb7dbecf8cbe9ec19003ba77a0c3f84729ed2.png)

I think that it would be better to work on this one since it has no coastline, where I think we could have fewer problemes concerning resolution.

Having said that, to avoid further confusion, in this message I’m sending the files that I used to run the regression model using the LULC map produced by ESA. In the next message I’ll send you the inputs that I used to run the regression model using the LULC map produced byJAXA

Please note that:

- landcover code represention rice (ESA) = 20
- landcover code represention rice (JAXA) = 4

Thank you so much for your help. Again, sorry for the mess I created

Marco[crop\_table\_p.csv](https://community.naturalcapitalalliance.org/uploads/short-url/8Sr3WCu5jZ7I1lhPXZGvH7nBfss.csv) (27 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes) [LULC\_ESA.tif](https://community.naturalcapitalalliance.org/uploads/short-url/eLZkOCd6JEBCLrZbh7T6Xml6Wl1.tif) (206.5 KB)

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 10, 2020, 7:15am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/8 "2020-06-10T07:15:29Z")

</div>

Inputs JAXA

[crop\_table\_p\_JAXA.csv](https://community.naturalcapitalalliance.org/uploads/short-url/xRqpKhTdd6yUKtz9r4oAE57glr6.csv) (26 Bytes) [fert\_rate.csv](https://community.naturalcapitalalliance.org/uploads/short-url/nT3HTY0PlIS1woe8tUJCdYcQpVe.csv) (99 Bytes)

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 10, 2020, 7:23am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/9 "2020-06-10T07:23:19Z")

</div>

The website doesn’t allow me to send you the LULC of JAXA, I compressed the inputs and I’m sending them here [Regression\_input\_Jaxa.zip](https://community.naturalcapitalalliance.org/uploads/short-url/vMbgkL4ConLp2d1OwSgzapECoan.zip) (413.6 KB)

Please let me know if you received them

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 19, 2020, 3:26pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/10 "2020-06-19T15:26:01Z")

</div>

Hi @jdouglass,

I hope you are well. I was wondering that maybe I have all these issue 'cause I’m using  
the same inputs as those of the Monfreda dataset?

Thank you,  
Marco

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 24, 2020, 12:20am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/11 "2020-06-24T00:20:57Z")

</div>

Hi Marco, I’m really sorry about the delay here, and thanks for separating your inputs!

So, as far as I can tell, the JAXA outputs look reasonable.

For the ESA outputs, I can confirm that there’s something funky going on with the outputs that’s ultimately coming down to the regression calculations themselves. I’ll have to consult with someone who knows something more about the model to try to figure out what’s going on here.

Thanks for sticking with us here, and I’m sorry about the delay!  
James

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 24, 2020, 6:47am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/12 "2020-06-24T06:47:04Z")

</div>

Hi @jdouglass,

no worries about the delay. Rather, I thank you for your huge support and help.

Here you can find more details about the two land covers, I hope that this could help to find out why we have problem with the map produced by ESA.

ESA (You would have to register in order to access to the data): [https://maps.elie.ucl.ac.be/CCI/viewer/download.php](https://maps.elie.ucl.ac.be/CCI/viewer/download.php)

JAXA: [https://www.eorc.jaxa.jp/ALOS/en/lulc/lulc\_vnm\_2015to2018period.htm`](https://www.eorc.jaxa.jp/ALOS/en/lulc/lulc_vnm_2015to2018period.htm%60)

Thank you,  
Marco

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 29, 2020, 11:57pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/13 "2020-06-29T23:57:19Z")

</div>

Thanks for these as well! After some digging, we did end up finding a bug with the Crop Production model itself that is fixed in this development build: [https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post86+g8fe0330c/InVEST\_phargogh3.8.2.post86+g8fe0330c\_x86\_Setup.exe](https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post86+g8fe0330c/InVEST_phargogh3.8.2.post86+g8fe0330c_x86_Setup.exe)

Could you try this out and check to see that the outputs seem more reasonable?

Thanks for working through this with us!  
James

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 30, 2020, 7:30am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/14 "2020-06-30T07:30:24Z")

</div>

Thank you @jdouglass,

I’ll run the models again and I’ll let you know how it works!

Marco

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 30, 2020, 12:58pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/15 "2020-06-30T12:58:35Z")

</div>

@jdouglass the model now produces both positive modeled and observed results.

Thank you so much for your help! I wouldn’t have been able to solve this problem alone.

All the best,  
Marco

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [June 30, 2020, 1:49pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/16 "2020-06-30T13:49:46Z")

</div>

I have only one last question: the result table shows modeled and observed nutrients values. How are these experessed? In metric tons per pixel?

Thank you!  
Marco

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 30, 2020, 5:29pm UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/17 "2020-06-30T17:29:03Z")

</div>

Sure thing! The yield values in the table are aggregated from the other output rasters, so since the crop production rasters are in metric tons per pixel per year, the table’s values have units of metric tons per year.

James

---

<div class="post-metadata">

**Author:** ![marco.guzzetti](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/marco.guzzetti/32/1252_2.png) [@marco.guzzetti](https://community.naturalcapitalalliance.org/u/marco.guzzetti)\
**Post date:** [July 1, 2020, 6:06am UTC](https://community.naturalcapitalalliance.org/t/crop-production-regression-model-understanding-output/1018/18 "2020-07-01T06:06:27Z")

</div>

Great, thank you so much!
