[This article was first published on
MeanMean, and kindly contributed to
R-bloggers]. (You can report issue about the content on this page
here)
Want to share your content on R-bloggers?
click here if you have a blog, or
here if you don't.
< svg style="display: none;">< defs id="MathJax_SVG_glyphs">< path stroke-width="1" id="MJMAINB-62" d="M32 686L123 690Q214 694 215 694H221V409Q289 450 378 450Q479 450 539 387T600 221Q600 122 535 58T358 -6H355Q272 -6 203 53L160 1L129 0H98V301Q98 362 98 435T99 525Q99 591 97 604T83 620Q69 624 42 624H29V686H32ZM227 105L232 99Q237 93 242 87T258 73T280 59T306 49T339 45Q380 45 411 66T451 131Q457 160 457 230Q457 264 456 284T448 329T430 367T396 389T343 398Q282 398 235 355L227 348V105Z">< path stroke-width="1" id="MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z">< path stroke-width="1" id="MJMATHI-73" d="M131 289Q131 321 147 354T203 415T300 442Q362 442 390 415T419 355Q419 323 402 308T364 292Q351 292 340 300T328 326Q328 342 337 354T354 372T367 378Q368 378 368 379Q368 382 361 388T336 399T297 405Q249 405 227 379T204 326Q204 301 223 291T278 274T330 259Q396 230 396 163Q396 135 385 107T352 51T289 7T195 -10Q118 -10 86 19T53 87Q53 126 74 143T118 160Q133 160 146 151T160 120Q160 94 142 76T111 58Q109 57 108 57T107 55Q108 52 115 47T146 34T201 27Q237 27 263 38T301 66T318 97T323 122Q323 150 302 164T254 181T195 196T148 231Q131 256 131 289Z">< path stroke-width="1" id="MJMAIN-2C" d="M78 35T78 60T94 103T137 121Q165 121 187 96T210 8Q210 -27 201 -60T180 -117T154 -158T130 -185T117 -194Q113 -194 104 -185T95 -172Q95 -168 106 -156T131 -126T157 -76T173 -3V9L172 8Q170 7 167 6T161 3T152 1T140 0Q113 0 96 17Z">< path stroke-width="1" id="MJMATHI-74" d="M26 385Q19 392 19 395Q19 399 22 411T27 425Q29 430 36 430T87 431H140L159 511Q162 522 166 540T173 566T179 586T187 603T197 615T211 624T229 626Q247 625 254 615T261 596Q261 589 252 549T232 470L222 433Q222 431 272 431H323Q330 424 330 420Q330 398 317 385H210L174 240Q135 80 135 68Q135 26 162 26Q197 26 230 60T283 144Q285 150 288 151T303 153H307Q322 153 322 145Q322 142 319 133Q314 117 301 95T267 48T216 6T155 -11Q125 -11 98 4T59 56Q57 64 57 83V101L92 241Q127 382 128 383Q128 385 77 385H26Z">< path stroke-width="1" id="MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z">< path stroke-width="1" id="MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z">< path stroke-width="1" id="MJMATHI-66" d="M118 -162Q120 -162 124 -164T135 -167T147 -168Q160 -168 171 -155T187 -126Q197 -99 221 27T267 267T289 382V385H242Q195 385 192 387Q188 390 188 397L195 425Q197 430 203 430T250 431Q298 431 298 432Q298 434 307 482T319 540Q356 705 465 705Q502 703 526 683T550 630Q550 594 529 578T487 561Q443 561 443 603Q443 622 454 636T478 657L487 662Q471 668 457 668Q445 668 434 658T419 630Q412 601 403 552T387 469T380 433Q380 431 435 431Q480 431 487 430T498 424Q499 420 496 407T491 391Q489 386 482 386T428 385H372L349 263Q301 15 282 -47Q255 -132 212 -173Q175 -205 139 -205Q107 -205 81 -186T55 -132Q55 -95 76 -78T118 -61Q162 -61 162 -103Q162 -122 151 -136T127 -157L118 -162Z">< path stroke-width="1" id="MJMATHI-62" d="M73 647Q73 657 77 670T89 683Q90 683 161 688T234 694Q246 694 246 685T212 542Q204 508 195 472T180 418L176 399Q176 396 182 402Q231 442 283 442Q345 442 383 396T422 280Q422 169 343 79T173 -11Q123 -11 82 27T40 150V159Q40 180 48 217T97 414Q147 611 147 623T109 637Q104 637 101 637H96Q86 637 83 637T76 640T73 647ZM336 325V331Q336 405 275 405Q258 405 240 397T207 376T181 352T163 330L157 322L136 236Q114 150 114 114Q114 66 138 42Q154 26 178 26Q211 26 245 58Q270 81 285 114T318 219Q336 291 336 325Z">< path stroke-width="1" id="MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z">< path stroke-width="1" id="MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z">< path stroke-width="1" id="MJMAIN-2026" d="M78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60ZM525 60Q525 84 542 102T585 120Q609 120 627 104T646 61Q646 36 629 18T586 0T543 17T525 60ZM972 60Q972 84 989 102T1032 120Q1056 120 1074 104T1093 61Q1093 36 1076 18T1033 0T990 17T972 60Z">< path stroke-width="1" id="MJMATHI-72" d="M21 287Q22 290 23 295T28 317T38 348T53 381T73 411T99 433T132 442Q161 442 183 430T214 408T225 388Q227 382 228 382T236 389Q284 441 347 441H350Q398 441 422 400Q430 381 430 363Q430 333 417 315T391 292T366 288Q346 288 334 299T322 328Q322 376 378 392Q356 405 342 405Q286 405 239 331Q229 315 224 298T190 165Q156 25 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 114 189T154 366Q154 405 128 405Q107 405 92 377T68 316T57 280Q55 278 41 278H27Q21 284 21 287Z">< path stroke-width="1" id="MJMATHBI-3F5" d="M415 89Q423 89 429 74T436 46Q436 43 434 39Q432 36 420 29T380 11T322 -5Q311 -7 281 -7Q216 -7 168 10T94 54T56 110T44 167V181Q44 262 94 329Q104 343 119 357T162 391T234 425T327 443Q328 443 348 443T383 444Q434 444 442 438Q450 430 450 416Q446 392 424 383L376 382Q306 381 278 369Q230 349 208 294Q199 274 199 268Q199 267 291 267Q305 267 325 267T353 268Q383 268 394 263T406 241Q406 214 380 206Q375 205 279 205T183 203Q174 176 174 140Q174 87 208 65T292 43Q295 43 300 43T307 44Q337 49 372 69T415 89Z">< path stroke-width="1" id="MJMAIN-7B" d="M434 -231Q434 -244 428 -250H410Q281 -250 230 -184Q225 -177 222 -172T217 -161T213 -148T211 -133T210 -111T209 -84T209 -47T209 0Q209 21 209 53Q208 142 204 153Q203 154 203 155Q189 191 153 211T82 231Q71 231 68 234T65 250T68 266T82 269Q116 269 152 289T203 345Q208 356 208 377T209 529V579Q209 634 215 656T244 698Q270 724 324 740Q361 748 377 749Q379 749 390 749T408 750H428Q434 744 434 732Q434 719 431 716Q429 713 415 713Q362 710 332 689T296 647Q291 634 291 499V417Q291 370 288 353T271 314Q240 271 184 255L170 250L184 245Q202 239 220 230T262 196T290 137Q291 131 291 1Q291 -134 296 -147Q306 -174 339 -192T415 -213Q429 -213 431 -216Q434 -219 434 -231Z">< path stroke-width="1" id="MJMAIN-2E" d="M78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60Z">< path stroke-width="1" id="MJMATHI-63" d="M34 159Q34 268 120 355T306 442Q362 442 394 418T427 355Q427 326 408 306T360 285Q341 285 330 295T319 325T330 359T352 380T366 386H367Q367 388 361 392T340 400T306 404Q276 404 249 390Q228 381 206 359Q162 315 142 235T121 119Q121 73 147 50Q169 26 205 26H209Q321 26 394 111Q403 121 406 121Q410 121 419 112T429 98T420 83T391 55T346 25T282 0T202 -11Q127 -11 81 37T34 159Z">< path stroke-width="1" id="MJMAIN-7D" d="M65 731Q65 745 68 747T88 750Q171 750 216 725T279 670Q288 649 289 635T291 501Q292 362 293 357Q306 312 345 291T417 269Q428 269 431 266T434 250T431 234T417 231Q380 231 345 210T298 157Q293 143 292 121T291 -28V-79Q291 -134 285 -156T256 -198Q202 -250 89 -250Q71 -250 68 -247T65 -230Q65 -224 65 -223T66 -218T69 -214T77 -213Q91 -213 108 -210T146 -200T183 -177T207 -139Q208 -134 209 3L210 139Q223 196 280 230Q315 247 330 250Q305 257 280 270Q225 304 212 352L210 362L209 498Q208 635 207 640Q195 680 154 696T77 713Q68 713 67 716T65 731Z">< path stroke-width="1" id="MJMATHI-54" d="M40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40Z">< path stroke-width="1" id="MJMATHI-52" d="M230 637Q203 637 198 638T193 649Q193 676 204 682Q206 683 378 683Q550 682 564 680Q620 672 658 652T712 606T733 563T739 529Q739 484 710 445T643 385T576 351T538 338L545 333Q612 295 612 223Q612 212 607 162T602 80V71Q602 53 603 43T614 25T640 16Q668 16 686 38T712 85Q717 99 720 102T735 105Q755 105 755 93Q755 75 731 36Q693 -21 641 -21H632Q571 -21 531 4T487 82Q487 109 502 166T517 239Q517 290 474 313Q459 320 449 321T378 323H309L277 193Q244 61 244 59Q244 55 245 54T252 50T269 48T302 46H333Q339 38 339 37T336 19Q332 6 326 0H311Q275 2 180 2Q146 2 117 2T71 2T50 1Q33 1 33 10Q33 12 36 24Q41 43 46 45Q50 46 61 46H67Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628Q287 635 230 637ZM630 554Q630 586 609 608T523 636Q521 636 500 636T462 637H440Q393 637 386 627Q385 624 352 494T319 361Q319 360 388 360Q466 361 492 367Q556 377 592 426Q608 449 619 486T630 554Z">< path stroke-width="1" id="MJMAIN-50" d="M130 622Q123 629 119 631T103 634T60 637H27V683H214Q237 683 276 683T331 684Q419 684 471 671T567 616Q624 563 624 489Q624 421 573 372T451 307Q429 302 328 301H234V181Q234 62 237 58Q245 47 304 46H337V0H326Q305 3 182 3Q47 3 38 0H27V46H60Q102 47 111 49T130 61V622ZM507 488Q507 514 506 528T500 564T483 597T450 620T397 635Q385 637 307 637H286Q237 637 234 628Q231 624 231 483V342H302H339Q390 342 423 349T481 382Q507 411 507 488Z">< path stroke-width="1" id="MJMAIN-72" d="M36 46H50Q89 46 97 60V68Q97 77 97 91T98 122T98 161T98 203Q98 234 98 269T98 328L97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 60 434T96 436Q112 437 131 438T160 441T171 442H174V373Q213 441 271 441H277Q322 441 343 419T364 373Q364 352 351 337T313 322Q288 322 276 338T263 372Q263 381 265 388T270 400T273 405Q271 407 250 401Q234 393 226 386Q179 341 179 207V154Q179 141 179 127T179 101T180 81T180 66V61Q181 59 183 57T188 54T193 51T200 49T207 48T216 47T225 47T235 46T245 46H276V0H267Q249 3 140 3Q37 3 28 0H20V46H36Z">< path stroke-width="1" id="MJMAIN-2208" d="M84 250Q84 372 166 450T360 539Q361 539 377 539T419 540T469 540H568Q583 532 583 520Q583 511 570 501L466 500Q355 499 329 494Q280 482 242 458T183 409T147 354T129 306T124 272V270H568Q583 262 583 250T568 230H124V228Q124 207 134 177T167 112T231 48T328 7Q355 1 466 0H570Q583 -10 583 -20Q583 -32 568 -40H471Q464 -40 446 -40T417 -41Q262 -41 172 45Q84 127 84 250Z">< path stroke-width="1" id="MJMATHI-41" d="M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z">< path stroke-width="1" id="MJMAIN-7C" d="M139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139Z">< path stroke-width="1" id="MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z">< path stroke-width="1" id="MJMATHI-4B" d="M285 628Q285 635 228 637Q205 637 198 638T191 647Q191 649 193 661Q199 681 203 682Q205 683 214 683H219Q260 681 355 681Q389 681 418 681T463 682T483 682Q500 682 500 674Q500 669 497 660Q496 658 496 654T495 648T493 644T490 641T486 639T479 638T470 637T456 637Q416 636 405 634T387 623L306 305Q307 305 490 449T678 597Q692 611 692 620Q692 635 667 637Q651 637 651 648Q651 650 654 662T659 677Q662 682 676 682Q680 682 711 681T791 680Q814 680 839 681T869 682Q889 682 889 672Q889 650 881 642Q878 637 862 637Q787 632 726 586Q710 576 656 534T556 455L509 418L518 396Q527 374 546 329T581 244Q656 67 661 61Q663 59 666 57Q680 47 717 46H738Q744 38 744 37T741 19Q737 6 731 0H720Q680 3 625 3Q503 3 488 0H478Q472 6 472 9T474 27Q478 40 480 43T491 46H494Q544 46 544 71Q544 75 517 141T485 216L427 354L359 301L291 248L268 155Q245 63 245 58Q245 51 253 49T303 46H334Q340 37 340 35Q340 19 333 5Q328 0 317 0Q314 0 280 1T180 2Q118 2 85 2T49 1Q31 1 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Z">< path stroke-width="1" id="MJMAIN-5B" d="M118 -250V750H255V710H158V-210H255V-250H118Z">< path stroke-width="1" id="MJMATHI-70" d="M23 287Q24 290 25 295T30 317T40 348T55 381T75 411T101 433T134 442Q209 442 230 378L240 387Q302 442 358 442Q423 442 460 395T497 281Q497 173 421 82T249 -10Q227 -10 210 -4Q199 1 187 11T168 28L161 36Q160 35 139 -51T118 -138Q118 -144 126 -145T163 -148H188Q194 -155 194 -157T191 -175Q188 -187 185 -190T172 -194Q170 -194 161 -194T127 -193T65 -192Q-5 -192 -24 -194H-32Q-39 -187 -39 -183Q-37 -156 -26 -148H-6Q28 -147 33 -136Q36 -130 94 103T155 350Q156 355 156 364Q156 405 131 405Q109 405 94 377T71 316T59 280Q57 278 43 278H29Q23 284 23 287ZM178 102Q200 26 252 26Q282 26 310 49T356 107Q374 141 392 215T411 325V331Q411 405 350 405Q339 405 328 402T306 393T286 380T269 365T254 350T243 336T235 326L232 322Q232 321 229 308T218 264T204 212Q178 106 178 102Z">< path stroke-width="1" id="MJMAIN-22EE" d="M78 30Q78 54 95 72T138 90Q162 90 180 74T199 31Q199 6 182 -12T139 -30T96 -13T78 30ZM78 440Q78 464 95 482T138 500Q162 500 180 484T199 441Q199 416 182 398T139 380T96 397T78 440ZM78 840Q78 864 95 882T138 900Q162 900 180 884T199 841Q199 816 182 798T139 780T96 797T78 840Z">< path stroke-width="1" id="MJMAIN-5D" d="M22 710V750H159V-250H22V-210H119V710H22Z">< path stroke-width="1" id="MJSZ4-23A1" d="M319 -645V1154H666V1070H403V-645H319Z">< path stroke-width="1" id="MJSZ4-23A3" d="M319 -644V1155H403V-560H666V-644H319Z">< path stroke-width="1" id="MJSZ4-23A2" d="M319 0V602H403V0H319Z">< path stroke-width="1" id="MJSZ4-23A4" d="M0 1070V1154H347V-645H263V1070H0Z">< path stroke-width="1" id="MJSZ4-23A6" d="M263 -560V1155H347V-644H0V-560H263Z">< path stroke-width="1" id="MJSZ4-23A5" d="M263 0V602H347V0H263Z">< path stroke-width="1" id="MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z">< path stroke-width="1" id="MJMATHI-6A" d="M297 596Q297 627 318 644T361 661Q378 661 389 651T403 623Q403 595 384 576T340 557Q322 557 310 567T297 596ZM288 376Q288 405 262 405Q240 405 220 393T185 362T161 325T144 293L137 279Q135 278 121 278H107Q101 284 101 286T105 299Q126 348 164 391T252 441Q253 441 260 441T272 442Q296 441 316 432Q341 418 354 401T367 348V332L318 133Q267 -67 264 -75Q246 -125 194 -164T75 -204Q25 -204 7 -183T-12 -137Q-12 -110 7 -91T53 -71Q70 -71 82 -81T95 -112Q95 -148 63 -167Q69 -168 77 -168Q111 -168 139 -140T182 -74L193 -32Q204 11 219 72T251 197T278 308T289 365Q289 372 288 376Z">
Crop rotation is an agricultural production practice to increase yield, mitigate disease, and control pests.
This production practice involves growing crops in specific sequences to improve the quality of soil for the following crop.
A common example in the United States is the practice of growing soybeans before corn.
In this example soybeans fixate nitrogen in the soil leading to an increase in yield and reduction in fertilizer consumption.
Provided that this production process is prevalent and we have some data regarding where and when particular crops grow, then a stochastic process such as a Markov chain can be used to predict what will be grown where.
Luckily, the United States Department of Agriculture’s (USDA) Cropland Data Layer (CDL) can be used to obtain crop location anywhere in the continental United States from 2008-2015.
The literature on this subject for major crops including corn, soybeans, winter wheat, cotton and peanuts points towards a high degree of employment of crop rotation across the continental United States.
An analysis of the CDL data by (Sahajpal, 2013) showed that 90% of Iowa’s crop production could be represented with three different crop rotations, and 80% of the U.S. crop production could be described with 180 unique rotations.
Crop rotation analysis by (Boryan, 2014) examined corn and soybean rotations in the corn belt from 2004 to 2008.
This analysis showed that over 45% of the total cultivated acreage in Iowa, 32% of Illinois, and 20% of Nebraska could be explained by corn-to-soy rotations.
Further analysis showed that particular rotation patterns are spatially associated with particular regions.
An example of this can be seen along the Platte river in Nebraska where 65%, 49%, and 50% of the cultivated acreage within Hall, Chase, and Dawson Counties respectfully grew corn for at least four out of the five years studied, while the statewide cultivated acreage covered by continuous or near-continuous corn cropping was much lower.
Similar activity was seen in Iowa and Illinois.
Model Development
In the United States crop rotation can be observed for most major row crops such as corn, soybeans, and wheat.
A naive model will be introduced using a simple Markov chain to assist in prediction.
Future models in this blog will build on this model, and use this simple model as a benchmark.
A Naive Approach
A stochastic processes is an ordered sequence of random variables.
The relationship between these variables can be described by a stochastic model, such models are a typical way to capture changes in states such as crop rotations.
A general form of a categorical stochastic model for land use is
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="44.374ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 19105.4 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMAINB-62">< use x="639" y="0" xlink:href="#MJMAIN-28">< use x="1029" y="0" xlink:href="#MJMATHI-73">< use x="1498" y="0" xlink:href="#MJMAIN-2C">< use x="1943" y="0" xlink:href="#MJMATHI-74">< use x="2305" y="0" xlink:href="#MJMAIN-29">< use x="2972" y="0" xlink:href="#MJMAIN-3D">< use x="4028" y="0" xlink:href="#MJMATHI-66">< g transform="translate(4745,0)">< use x="0" y="0" xlink:href="#MJMAIN-28">< use x="389" y="0" xlink:href="#MJMATHI-62">< use x="819" y="0" xlink:href="#MJMAIN-28">< use x="1208" y="0" xlink:href="#MJMATHI-73">< use x="1678" y="0" xlink:href="#MJMAIN-2C">< use x="2123" y="0" xlink:href="#MJMATHI-74">< use x="2706" y="0" xlink:href="#MJMAIN-2212">< use x="3707" y="0" xlink:href="#MJMAIN-31">< use x="4208" y="0" xlink:href="#MJMAIN-29">< use x="4597" y="0" xlink:href="#MJMAIN-2C">< use x="5042" y="0" xlink:href="#MJMAIN-2026">< use x="6381" y="0" xlink:href="#MJMAIN-2C">< use x="6827" y="0" xlink:href="#MJMATHI-62">< use x="7256" y="0" xlink:href="#MJMAIN-28">< use x="7646" y="0" xlink:href="#MJMATHI-73">< use x="8115" y="0" xlink:href="#MJMAIN-2C">< use x="8560" y="0" xlink:href="#MJMATHI-74">< use x="9144" y="0" xlink:href="#MJMAIN-2212">< use x="10145" y="0" xlink:href="#MJMATHI-72">< use x="10596" y="0" xlink:href="#MJMAIN-29">< use x="10986" y="0" xlink:href="#MJMAIN-2C">< use x="11431" y="0" xlink:href="#MJMATHBI-3F5">< use x="11914" y="0" xlink:href="#MJMAIN-28">< use x="12304" y="0" xlink:href="#MJMATHI-73">< use x="12773" y="0" xlink:href="#MJMAIN-2C">< use x="13219" y="0" xlink:href="#MJMATHI-74">< use x="13580" y="0" xlink:href="#MJMAIN-29">< use x="13970" y="0" xlink:href="#MJMAIN-29">
where
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="6.259ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 2694.7 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMAINB-62">< use x="639" y="0" xlink:href="#MJMAIN-28">< use x="1029" y="0" xlink:href="#MJMATHI-73">< use x="1498" y="0" xlink:href="#MJMAIN-2C">< use x="1943" y="0" xlink:href="#MJMATHI-74">< use x="2305" y="0" xlink:href="#MJMAIN-29"> is a categorical random variable for classes
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="9.664ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 4160.8 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMAIN-7B">< use x="500" y="0" xlink:href="#MJMAIN-31">< use x="1001" y="0" xlink:href="#MJMAIN-2C">< use x="1446" y="0" xlink:href="#MJMAIN-2E">< use x="1891" y="0" xlink:href="#MJMAIN-2E">< use x="2336" y="0" xlink:href="#MJMAIN-2E">< use x="2781" y="0" xlink:href="#MJMAIN-2C">< use x="3226" y="0" xlink:href="#MJMATHI-63">< use x="3660" y="0" xlink:href="#MJMAIN-7D"> indexed by time
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="0.84ex" height="2.009ex" style="vertical-align: -0.338ex;" viewBox="0 -719.6 361.5 865.1" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-74"> in a set of temporal indexes
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="1.636ex" height="2.176ex" style="vertical-align: -0.338ex;" viewBox="0 -791.3 704.5 936.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-54">, and
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="1.09ex" height="1.676ex" style="vertical-align: -0.338ex;" viewBox="0 -576.1 469.5 721.6" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-73"> a spatial location in a region
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="1.764ex" height="2.176ex" style="vertical-align: -0.338ex;" viewBox="0 -791.3 759.5 936.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-52">.
In this model the current land use or state is a function of the prior states and random error
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.896ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 2538.7 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHBI-3F5">< use x="483" y="0" xlink:href="#MJMAIN-28">< use x="873" y="0" xlink:href="#MJMATHI-73">< use x="1342" y="0" xlink:href="#MJMAIN-2C">< use x="1787" y="0" xlink:href="#MJMATHI-74">< use x="2149" y="0" xlink:href="#MJMAIN-29">.
If we were to make the naive assumption that each land use unit is an independent realization of a stationary in time Markov Chain, where a Markov Chain is a stochastic process satisfying
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="72.068ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 31029.2 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use xlink:href="#MJMAIN-50">< use x="681" y="0" xlink:href="#MJMAIN-72">< g transform="translate(1240,0)">< use x="0" y="0" xlink:href="#MJMAIN-28">< use x="389" y="0" xlink:href="#MJMAINB-62">< use x="1029" y="0" xlink:href="#MJMAIN-28">< use x="1418" y="0" xlink:href="#MJMATHI-73">< use x="1888" y="0" xlink:href="#MJMAIN-2C">< use x="2333" y="0" xlink:href="#MJMATHI-74">< use x="2694" y="0" xlink:href="#MJMAIN-29">< use x="3361" y="0" xlink:href="#MJMAIN-2208">< use x="4307" y="0" xlink:href="#MJMATHI-41">< use x="5057" y="0" xlink:href="#MJMAIN-7C">< use x="5336" y="0" xlink:href="#MJMAINB-62">< use x="5975" y="0" xlink:href="#MJMAIN-28">< use x="6365" y="0" xlink:href="#MJMATHI-73">< use x="6834" y="0" xlink:href="#MJMAIN-2C">< use x="7279" y="0" xlink:href="#MJMATHI-74">< use x="7863" y="0" xlink:href="#MJMAIN-2212">< use x="8864" y="0" xlink:href="#MJMAIN-31">< use x="9364" y="0" xlink:href="#MJMAIN-29">< use x="9754" y="0" xlink:href="#MJMAIN-29">< use x="11662" y="0" xlink:href="#MJMAIN-3D">< g transform="translate(12718,0)">< use xlink:href="#MJMAIN-50">< use x="681" y="0" xlink:href="#MJMAIN-72">< g transform="translate(13959,0)">< use x="0" y="0" xlink:href="#MJMAIN-28">< use x="389" y="0" xlink:href="#MJMAINB-62">< use x="1029" y="0" xlink:href="#MJMAIN-28">< use x="1418" y="0" xlink:href="#MJMATHI-73">< use x="1888" y="0" xlink:href="#MJMAIN-2C">< use x="2333" y="0" xlink:href="#MJMATHI-74">< use x="2694" y="0" xlink:href="#MJMAIN-29">< use x="3361" y="0" xlink:href="#MJMAIN-2208">< use x="4307" y="0" xlink:href="#MJMATHI-41">< use x="5057" y="0" xlink:href="#MJMAIN-7C">< use x="5336" y="0" xlink:href="#MJMAINB-62">< use x="5975" y="0" xlink:href="#MJMAIN-28">< use x="6365" y="0" xlink:href="#MJMATHI-73">< use x="6834" y="0" xlink:href="#MJMAIN-2C">< use x="7279" y="0" xlink:href="#MJMATHI-74">< use x="7863" y="0" xlink:href="#MJMAIN-2212">< use x="8864" y="0" xlink:href="#MJMAIN-31">< use x="9364" y="0" xlink:href="#MJMAIN-29">< use x="9754" y="0" xlink:href="#MJMAIN-2C">< use x="10199" y="0" xlink:href="#MJMAINB-62">< use x="10839" y="0" xlink:href="#MJMAIN-28">< use x="11228" y="0" xlink:href="#MJMATHI-73">< use x="11698" y="0" xlink:href="#MJMAIN-2C">< use x="12143" y="0" xlink:href="#MJMATHI-74">< use x="12726" y="0" xlink:href="#MJMAIN-2212">< use x="13727" y="0" xlink:href="#MJMAIN-32">< use x="14228" y="0" xlink:href="#MJMAIN-29">< use x="14617" y="0" xlink:href="#MJMAIN-2C">< use x="15062" y="0" xlink:href="#MJMAIN-2026">< use x="16235" y="0" xlink:href="#MJMAIN-29">< use x="30750" y="0" xlink:href="#MJMAIN-2C">
under these conditions the stochastic model can be written as
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="30.57ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 13162 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMAINB-62">< use x="639" y="0" xlink:href="#MJMAIN-28">< use x="1029" y="0" xlink:href="#MJMATHI-73">< use x="1498" y="0" xlink:href="#MJMAIN-2C">< use x="1943" y="0" xlink:href="#MJMATHI-74">< use x="2305" y="0" xlink:href="#MJMAIN-29">< use x="2972" y="0" xlink:href="#MJMAIN-3D">< use x="4028" y="0" xlink:href="#MJMATHI-66">< g transform="translate(4745,0)">< use x="0" y="0" xlink:href="#MJMAIN-28">< use x="389" y="0" xlink:href="#MJMATHI-62">< use x="819" y="0" xlink:href="#MJMAIN-28">< use x="1208" y="0" xlink:href="#MJMATHI-73">< use x="1678" y="0" xlink:href="#MJMAIN-2C">< use x="2123" y="0" xlink:href="#MJMATHI-74">< use x="2706" y="0" xlink:href="#MJMAIN-2212">< use x="3707" y="0" xlink:href="#MJMAIN-31">< use x="4208" y="0" xlink:href="#MJMAIN-29">< use x="4597" y="0" xlink:href="#MJMAIN-2C">< use x="5042" y="0" xlink:href="#MJMATHBI-3F5">< use x="5526" y="0" xlink:href="#MJMAIN-28">< use x="5915" y="0" xlink:href="#MJMATHI-73">< use x="6385" y="0" xlink:href="#MJMAIN-2C">< use x="6830" y="0" xlink:href="#MJMATHI-74">< use x="7191" y="0" xlink:href="#MJMAIN-29">< use x="7581" y="0" xlink:href="#MJMAIN-29">< use x="12883" y="0" xlink:href="#MJMAIN-2E">
The term stationary when applied to a stochastic process implies that the distribution is invariant to the index of the process.
Stationarity can be applied to time, space or both.
For the purposes of this simple model we will assume that
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="6.259ex" height="2.843ex" style="vertical-align: -0.838ex;" viewBox="0 -863.1 2694.7 1223.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMAINB-62">< use x="639" y="0" xlink:href="#MJMAIN-28">< use x="1029" y="0" xlink:href="#MJMATHI-73">< use x="1498" y="0" xlink:href="#MJMAIN-2C">< use x="1943" y="0" xlink:href="#MJMATHI-74">< use x="2305" y="0" xlink:href="#MJMAIN-29"> is stationary in time, and each observed transition is independent and identically distributed.
Future models will relax these restrictions.
Since the transition probabilities are stationary in time, then the process can be also described via a single transition or stochastic matrix,
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="27.734ex" height="13.843ex" style="vertical-align: -6.338ex;" viewBox="0 -3231.2 11941.2 5960" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-4B">< use x="1167" y="0" xlink:href="#MJMAIN-3D">< g transform="translate(2223,0)">< g transform="translate(0,3100)">< use x="0" y="-1155" xlink:href="#MJSZ4-23A1">< g transform="translate(0,-3946.359271523179) scale(1,3.640728476821192)">< use xlink:href="#MJSZ4-23A2">< use x="0" y="-5056" xlink:href="#MJSZ4-23A3">< g transform="translate(834,0)">< g transform="translate(-11,0)">< g transform="translate(0,2300)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" xlink:href="#MJMAIN-31">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMAIN-31">< g transform="translate(0,900)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" xlink:href="#MJMAIN-32">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMAIN-31">< use x="516" y="-1001" xlink:href="#MJMAIN-22EE">< g transform="translate(23,-2401)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMATHI-63">< use transform="scale(0.707)" x="433" y="0" xlink:href="#MJMAIN-31">< g transform="translate(2300,0)">< g transform="translate(0,2300)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" xlink:href="#MJMAIN-31">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMAIN-32">< g transform="translate(0,900)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" xlink:href="#MJMAIN-32">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMAIN-32">< g transform="translate(23,-2401)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMATHI-63">< use transform="scale(0.707)" x="433" y="0" xlink:href="#MJMAIN-32">< g transform="translate(4612,0)">< use x="0" y="2300" xlink:href="#MJMAIN-2026">< use x="0" y="900" xlink:href="#MJMAIN-2026">< use x="0" y="-2401" xlink:href="#MJMAIN-2026">< g transform="translate(6784,0)">< g transform="translate(0,2300)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMAIN-31">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMATHI-63">< g transform="translate(0,900)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMAIN-32">< use transform="scale(0.707)" x="500" y="0" xlink:href="#MJMATHI-63">< use x="492" y="-1001" xlink:href="#MJMAIN-22EE">< g transform="translate(23,-2401)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMATHI-63">< use transform="scale(0.707)" x="433" y="0" xlink:href="#MJMATHI-63">< g transform="translate(9050,3100)">< use x="0" y="-1155" xlink:href="#MJSZ4-23A4">< g transform="translate(0,-3946.359271523179) scale(1,3.640728476821192)">< use xlink:href="#MJSZ4-23A5">< use x="0" y="-5056" xlink:href="#MJSZ4-23A6">
where
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="30.526ex" height="3.009ex" style="vertical-align: -1.005ex;" viewBox="-38.5 -863.1 13143.1 1295.7" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-70">< g transform="translate(503,-150)">< use transform="scale(0.707)" x="0" y="0" xlink:href="#MJMATHI-69">< use transform="scale(0.707)" x="345" y="0" xlink:href="#MJMATHI-6A">< use x="1417" y="0" xlink:href="#MJMAIN-3D">< g transform="translate(2473,0)">< use xlink:href="#MJMAIN-50">< use x="681" y="0" xlink:href="#MJMAIN-72">< use x="3547" y="0" xlink:href="#MJMAIN-28">< use x="3937" y="0" xlink:href="#MJMAINB-62">< use x="4576" y="0" xlink:href="#MJMAIN-28">< use x="4966" y="0" xlink:href="#MJMATHI-74">< use x="5327" y="0" xlink:href="#MJMAIN-29">< use x="5994" y="0" xlink:href="#MJMAIN-3D">< use x="7051" y="0" xlink:href="#MJMATHI-6A">< use x="7463" y="0" xlink:href="#MJMAIN-7C">< use x="7742" y="0" xlink:href="#MJMATHI-62">< use x="8171" y="0" xlink:href="#MJMAIN-28">< use x="8561" y="0" xlink:href="#MJMATHI-74">< use x="9144" y="0" xlink:href="#MJMAIN-2212">< use x="10145" y="0" xlink:href="#MJMAIN-31">< use x="10646" y="0" xlink:href="#MJMAIN-29">< use x="11313" y="0" xlink:href="#MJMAIN-3D">< use x="12369" y="0" xlink:href="#MJMATHI-69">< use x="12715" y="0" xlink:href="#MJMAIN-29"> for any
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="11.193ex" height="2.509ex" style="vertical-align: -0.671ex;" viewBox="0 -791.3 4819.2 1080.4" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-74">< use x="361" y="0" xlink:href="#MJMAIN-2C">< use x="806" y="0" xlink:href="#MJMATHI-74">< use x="1390" y="0" xlink:href="#MJMAIN-2212">< use x="2391" y="0" xlink:href="#MJMAIN-31">< use x="3169" y="0" xlink:href="#MJMAIN-2208">< use x="4114" y="0" xlink:href="#MJMATHI-54">.
Under the typical assumption that each row of
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="2.066ex" height="2.176ex" style="vertical-align: -0.338ex;" viewBox="0 -791.3 889.5 936.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-4B"> follows a multinomial distribution conditioned on the prior state, then estimates of
< svg xmlns:xlink="http://www.w3.org/1999/xlink" width="2.066ex" height="2.176ex" style="vertical-align: -0.338ex;" viewBox="0 -791.3 889.5 936.9" role="img" focusable="false">< g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">< use x="0" y="0" xlink:href="#MJMATHI-4B"> can be easily be estimated via maximum likelihood.
Example
The maximum likelihood estimates are simply the observed transitions for each prior state divieded by the total number of observed transitions from the prior state. To calculate these reatios we need to aggregate the year-to-year transition data from the CDL pixels for Iowa. Note that due to resampling, this may take a considerable amount of time (hours) depending on your system. To speed things up the results csv is provided through the website.
Now that you have the data, hopefully from downloading it, we can start working with it:
library(dplyr)
library(magrittr)
library(tidyr)
library(devtools)
install_github('jlisic/cdlTools')
library(cdlTools)
# read in csv file
cropChange <- read.csv("Iowa_2008_2015_change.csv")
# create a major crop type identifier
# preference is given to corn for corn/soy multiple cropping
justSoy <- setdiff(soybeans,corn)
# Major crop identifier:
# 0 non Cultivated
# 1 other cultivated
# 2 soybeans (but no dual crop soybeans and corn)
# 3 corn
cropChange$cropTypeFrom <- cropChange$In %in% cultivated
cropChange$cropTypeFrom <- cropChange$In %in% justSoy + cropChange$cropTypeFrom
cropChange$cropTypeFrom <- 2*cropChange$In %in% corn + cropChange$cropTypeFrom
cropChange$cropTypeTo <- cropChange$Out %in% cultivated
cropChange$cropTypeTo <- cropChange$Out %in% justSoy + cropChange$cropTypeTo
cropChange$cropTypeTo <- 2*cropChange$Out %in% corn + cropChange$cropTypeTo
#create a tidy transition matrix
K.tidy <- cropChange %>% # get data
group_by(cropTypeTo, cropTypeFrom)%>% # group by unique To and From
summarize(totalPixels=sum(Pixels)) # sum pixels in each group
# create the transition matrix K
K <- spread(K.tidy,cropTypeTo,totalPixels) %>% select(2:5)
K <- K/rowSums(K)
rownames(K) <- colnames(K) <- c('nonCult','cult','soybeans','corn')
print(K)
## nonCult cult soybeans corn
## nonCult 0.81769249 0.019130333 0.06618133 0.09699585
## cult 0.30518990 0.174452328 0.17803400 0.34232377
## soybeans 0.05949642 0.008826269 0.37963993 0.55203739
## corn 0.06057745 0.010194854 0.39156959 0.53765810
Next time, we will compare these results to some federal statistics.
Boryan, Claire, et al. “Monitoring US agriculture: the US department of agriculture, national agricultural statistics service, cropland data layer program.” Geocarto International 26.5 (2011): 341-358.
Boryan, Claire G., Zhengwei Yang, and Patrick Willis. “US geospatial crop frequency data layers.” Agro-geoinformatics (Agro-geoinformatics 2014), Third International Conference on. IEEE, 2014.
Sahajpal, R., et al. “Generating a Crop Rotation Dataset for the US and its Application in Inferring Land Use Change Induced Wetland Losses in the Prairie Pothole Region.” AGU Fall Meeting Abstracts. Vol. 1. 2013.